Implement reset user preferences for admin toolbar actions

This commit is contained in:
Hadi Nategh 2018-08-21 17:22:58 +02:00
parent 3c85c5ce9c
commit 698e77e0cb
3 changed files with 8 additions and 1 deletions

View File

@ -713,7 +713,7 @@ var et2_toolbar = (function(){ "use strict"; return et2_DOMWidget.extend([et2_II
];
var self = this;
var sel_options = {actions:[]};
var content = {actions:[]};
var content = {actions:[], reset:false};
for (var key in _actions)
{
if (_actions[key]['children'] && this.flat_list)

View File

@ -81,6 +81,9 @@ class Toolbar extends Etemplate\Widget
$GLOBALS['egw']->preferences->save_repository(true, 'default');
$GLOBALS['egw']->preferences->read(true);
break;
case 'reset':
if ($setting) $GLOBALS['egw']->preferences->change_preference($app, $id,'', null, 'user');
break;
default:
}
}

View File

@ -13,6 +13,10 @@
<description value="default visible actions" label="%s:"/>
<taglist id="actions" editModeEnabled="false" allowFreeEntries="false" autocomplete_url=' ' class="et2_fullWidth"/>
</row>
<row>
<description value="reset all to default" label="%s:"/>
<checkbox id="reset" statustext="This will reset toolbar preferences for all users and set them to configured default prefs."/>
</row>
</rows>
</grid>
</template>