diff --git a/api/js/etemplate/et2_widget_toolbar.js b/api/js/etemplate/et2_widget_toolbar.js index 997c71b7ad..38529e0b8a 100644 --- a/api/js/etemplate/et2_widget_toolbar.js +++ b/api/js/etemplate/et2_widget_toolbar.js @@ -152,10 +152,17 @@ var et2_toolbar = (function(){ "use strict"; return et2_DOMWidget.extend([et2_II this.div.empty(); this.actionbox.empty(); this.actionlist.empty(); - this.actionbox.append(''+egw.lang('more')+' ...'+''); + var admin_setting = this.options.is_admin ? 'admin': ''; + this.actionbox.append(''+egw.lang('more')+' ...'+admin_setting+''); this.actionbox.append('
'); 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; if (pref && !jQuery.isArray(pref)) this.preference = pref; diff --git a/api/src/Etemplate/Widget/Toolbar.php b/api/src/Etemplate/Widget/Toolbar.php index d1dbd47f67..f834b57fca 100644 --- a/api/src/Etemplate/Widget/Toolbar.php +++ b/api/src/Etemplate/Widget/Toolbar.php @@ -40,4 +40,20 @@ class Toolbar extends Etemplate\Widget 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; + } + } }