forked from extern/egroupware
W.I.P. of toolbar admin default prefs
This commit is contained in:
parent
47c8143339
commit
ccda87b157
@ -152,10 +152,17 @@ var et2_toolbar = (function(){ "use strict"; return et2_DOMWidget.extend([et2_II
|
|||||||
this.div.empty();
|
this.div.empty();
|
||||||
this.actionbox.empty();
|
this.actionbox.empty();
|
||||||
this.actionlist.empty();
|
this.actionlist.empty();
|
||||||
this.actionbox.append('<h class="ui-toolbar-menulistHeader">'+egw.lang('more')+' ...'+'</h>');
|
var admin_setting = this.options.is_admin ? '<span class="toolbar-admin-pref">admin</span>': '';
|
||||||
|
this.actionbox.append('<h class="ui-toolbar-menulistHeader">'+egw.lang('more')+' ...'+admin_setting+'</h>');
|
||||||
this.actionbox.append('<div id="' + this.id + '-menulist' +'" class="ui-toolbar-menulist" ></div>');
|
this.actionbox.append('<div id="' + this.id + '-menulist' +'" class="ui-toolbar-menulist" ></div>');
|
||||||
var that = this;
|
var that = this;
|
||||||
|
if (this.options.is_admin)
|
||||||
|
{
|
||||||
|
this.actionbox.find('.toolbar-admin-pref').click(function(e){
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
// TODO
|
||||||
|
});
|
||||||
|
}
|
||||||
var pref = (!egwIsMobile())? egw.preference(this.dom_id,this.egw().getAppName()): undefined;
|
var pref = (!egwIsMobile())? egw.preference(this.dom_id,this.egw().getAppName()): undefined;
|
||||||
if (pref && !jQuery.isArray(pref)) this.preference = pref;
|
if (pref && !jQuery.isArray(pref)) this.preference = pref;
|
||||||
|
|
||||||
|
@ -40,4 +40,20 @@ class Toolbar extends Etemplate\Widget
|
|||||||
if (true) $valid = $value;
|
if (true) $valid = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up what we know on the server side.
|
||||||
|
*
|
||||||
|
* @param string $cname
|
||||||
|
* @param array $expand values for keys 'c', 'row', 'c_', 'row_', 'cont'
|
||||||
|
*/
|
||||||
|
public function beforeSendToClient($cname, array $expand=null)
|
||||||
|
{
|
||||||
|
if ($GLOBALS['egw_info']['user']['apps']['admin'])
|
||||||
|
{
|
||||||
|
$form_name = self::form_name($cname, $this->id, $expand);
|
||||||
|
$value = &self::get_array(self::$request->modifications, $form_name, true);
|
||||||
|
$value['is_admin'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user