make home a regular application, which can eg. disabled, incl. moving all services using "home" as appname to "api" and moved some other forgotten stuff from phpgwapi&etemplate to api

This commit is contained in:
Ralf Becker
2016-05-01 09:57:48 +00:00
parent fa9cd4766f
commit 429177686a
86 changed files with 194 additions and 168 deletions

View File

@@ -764,7 +764,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
if(typeof self.favorite_popup.group != "undefined" && self.favorite_popup.group.getValue() != '')
{
// Admin stuff - save preference server side
self.egw.jsonq(self.appname+'.egw_framework.ajax_set_favorite.template',
self.egw.jsonq('EGroupware\\Api\\Framework::ajax_set_favorite',
[
self.appname,
name.val(),
@@ -874,7 +874,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
$j(trash).hide();
// Delete preference server side
var request = egw.json(app.appname + ".egw_framework.ajax_set_favorite.template",
var request = egw.json("EGroupware\\Api\\Framework::ajax_set_favorite",
[app.appname, id, "delete", group, ''],
function(result) {
// Got the full response from callback, which we don't want
@@ -1117,15 +1117,15 @@ var AppJS = (function(){ "use strict"; return Class.extend(
{
var resolve = _resolve;
var reject = _reject;
self.egw.json('home.home_tutorial_ui.ajax_data', [self.egw.app_name()], function(_data){
resolve(_data);
self.egw.json('EGroupware\\Api\\Framework\\Tutorial::ajax_data', [self.egw.app_name()], function(_data){
resolve(_data);
}).sendRequest();
});
},
/**
* Create and Render etemplate2 for egroupware tutorial
* sidebox option. The .xet file is stored in etemplate/templates/default/egw_tutorials
* sidebox option. The .xet file is stored in api/templates/default/egw_tutorials
*
* @description tutorials json object should have the following structure:
* object:
@@ -1159,7 +1159,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
{
// et2 object
var etemplate = new etemplate2 (div, false);
var template = egw.webserverUrl+'/etemplate/templates/default/egw_tutorial.xet?1';
var template = egw.webserverUrl+'/api/templates/default/egw_tutorial.xet?1';
this.egwTutorialGetData().then(function(_data){
var lang = egw.preference('lang');
@@ -1200,10 +1200,39 @@ var AppJS = (function(){ "use strict"; return Class.extend(
*/
egwTutorialPopup: function (_tuid)
{
var url = egw.link('/index.php', 'menuaction=home.home_tutorial_ui.popup&tuid='+_tuid);
var url = egw.link('/index.php', 'menuaction=api.EGroupware\\Api\\Framework\\Tutorial.popup&tuid='+_tuid);
egw.open_link(url,'_blank','960x580');
},
/**
* Function to set video iframe base on selected tutorial from tutorials box
*
* @param {string} _url
*/
tutorial_videoOnClick: function (_url)
{
var frame = etemplate2.getByApplication('api')[0].widgetContainer.getWidgetById('src');
if (frame)
{
frame.set_value(_url);
}
},
/**
* Function calls on discard checkbox and will set
* the egw_tutorial_noautoload preference
*
* @param {type} egw
* @param {type} widget
*/
tutorial_autoloadDiscard: function (egw, widget)
{
if (widget)
{
this.egw.set_preference('common', 'egw_tutorial_noautoload', widget.get_value());
}
},
/**
* Check if Mailvelope is available, open (or create) "egroupware" keyring and call callback with it
*
@@ -1257,7 +1286,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
downloadSync: function(_downloadObj)
{
return new Promise(function(_resolve,_reject){});
},
},
/**
* function called by Mailvelope to upload an encrypted private key backup
@@ -1492,7 +1521,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
menu:_content
}
},
template: egw.webserverUrl+'/etemplate/templates/default/pgp_backup_restore.xet',
template: egw.webserverUrl+'/api/templates/default/pgp_backup_restore.xet',
class: "pgp_backup_restore",
modal:true
});
@@ -1546,7 +1575,7 @@ var AppJS = (function(){ "use strict"; return Class.extend(
value: {
content: _content
},
template: egw.webserverUrl+'/etemplate/templates/default/pgp_installation.xet',
template: egw.webserverUrl+'/api/templates/default/pgp_installation.xet',
class: "pgp_installation",
modal: true
//resizable:false,

View File

@@ -381,7 +381,7 @@
/**
* Creates the egw object --- if the egw object should be created, some data
* has already been set inside the object by the egw_framework::header
* has already been set inside the object by the Api\Framework::header
* function and the instance has been marked as "prefsOnly".
*/
if (typeof window.egw != "undefined" && window.egw.prefsOnly)

View File

@@ -105,8 +105,7 @@ egw.extend('jsonq', egw.MODULE_GLOBAL, function()
}
if (something_to_send)
{
// TODO: Passing this to the "home" application looks quite ugly
var request = egw.json('home.queue', jobs_to_send, jsonq_callback, this);
var request = egw.json('api.queue', jobs_to_send, jsonq_callback, this);
request.sendRequest(true);
}
}

View File

@@ -65,7 +65,7 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function()
if (typeof prefs[_app] == 'undefined')
{
var request = this.json('home.egw_framework.ajax_get_preference.template', [_app], _callback, _context);
var request = this.json('EGroupware\\Api\\Framework::ajax_get_preference', [_app], _callback, _context);
request.sendRequest(typeof _callback == 'function', 'GET'); // use synchronous (cachable) GET request
if (typeof prefs[_app] == 'undefined') prefs[_app] = {};
if (typeof _callback == 'function') return false;
@@ -91,7 +91,7 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function()
// if there is no change, no need to submit it to server
if (typeof prefs[_app] != 'undefined' && prefs[_app][_name] === _val) return;
this.jsonq('home.egw_framework.ajax_set_preference.template',[_app, _name, _val], _callback);
this.jsonq('EGroupware\\Api\\Framework::ajax_set_preference',[_app, _name, _val], _callback);
// update own preference cache, if _app prefs are loaded (dont update otherwise, as it would block loading of other _app prefs!)
if (typeof prefs[_app] != 'undefined')

View File

@@ -100,7 +100,7 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
if(jQuery.isEmptyObject(accountStore))
{
// Synchronous
egw.json('home.egw_framework.ajax_user_list.template',[],
egw.json('EGroupware\\Api\\Framework::ajax_user_list',[],
function(data) {
accountStore = jQuery.extend(true, {}, data||{});
}
@@ -166,7 +166,7 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
// something not found in cache --> ask server
if (_account_ids.length)
{
egw.json('home.egw_framework.ajax_account_data.template',[_account_ids, _field, _resolve_groups],
egw.json('EGroupware\\Api\\Framework::ajax_account_data',[_account_ids, _field, _resolve_groups],
function(_data) {
for(var account_id in _data)
{
@@ -229,7 +229,7 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
}
else
{
this.link_title('home-accounts', _id, function(_label)
this.link_title('api-accounts', _id, function(_label)
{
store[i].label = _label;
if (_id < 0)