only show apps available to user

This commit is contained in:
Ralf Becker 2014-10-21 09:15:42 +00:00
parent 23c0285825
commit 5391fd1674

View File

@ -36,8 +36,8 @@ class preferences_settings
/** /**
* Edit preferences * Edit preferences
* *
* @param array $content=null * @param array $content =null
* @param string $msg='' * @param string $msg =''
*/ */
function index(array $content=null, $msg='') function index(array $content=null, $msg='')
{ {
@ -155,14 +155,14 @@ class preferences_settings
} }
$sel_options = $readonlys = null; $sel_options = $readonlys = null;
$content = $this->get_content($appname, $type, $sel_options, $readonlys, $preserve['types'], $tpl); $data = $this->get_content($appname, $type, $sel_options, $readonlys, $preserve['types'], $tpl);
$preserve['appname'] = $preserve['old_appname'] = $content['appname']; $preserve['appname'] = $preserve['old_appname'] = $data['appname'];
$preserve['type'] = $preserve['old_type'] = $content['type']; $preserve['type'] = $preserve['old_type'] = $data['type'];
if (isset($old_tab)) $content['tabs'] = $old_tab; if (isset($old_tab)) $data['tabs'] = $old_tab;
if ($msg) egw_framework::message($msg, $msg_type ? $msg_type : 'error'); if ($msg) egw_framework::message($msg, $msg_type ? $msg_type : 'error');
$tpl->exec('preferences.preferences_settings.index', $content, $sel_options, $readonlys, $preserve, 2); $tpl->exec('preferences.preferences_settings.index', $data, $sel_options, $readonlys, $preserve, 2);
} }
/** /**
@ -173,7 +173,7 @@ class preferences_settings
* @param array $types setting-name => type * @param array $types setting-name => type
* @param string $appname appname or 'common' * @param string $appname appname or 'common'
* @param string $type 'user', 'default', 'forced' * @param string $type 'user', 'default', 'forced'
* @param boolean $only_verify=false * @param boolean $only_verify =false
* @return string with verification error or null on success * @return string with verification error or null on success
*/ */
function process_array(array &$repository, array $values, array $types, $appname, $type, $only_verify=false) function process_array(array &$repository, array $values, array $types, $appname, $type, $only_verify=false)
@ -455,7 +455,7 @@ class preferences_settings
$sel_options['appname'] = array(); $sel_options['appname'] = array();
foreach($GLOBALS['egw']->hooks->hook_implemented('settings') as $app) foreach($GLOBALS['egw']->hooks->hook_implemented('settings') as $app)
{ {
if ($app != 'preferences' && $GLOBALS['egw_info']['apps'][$app]) if ($app != 'preferences' && $GLOBALS['egw_info']['user']['apps'][$app])
{ {
$sel_options['appname'][$app] = $GLOBALS['egw_info']['apps'][$app]['title']; $sel_options['appname'][$app] = $GLOBALS['egw_info']['apps'][$app]['title'];
} }
@ -499,7 +499,7 @@ class preferences_settings
* *
* @param string|array $default default value(s) to get label for * @param string|array $default default value(s) to get label for
* @param array $values values optional including optgroups * @param array $values values optional including optgroups
* @param boolean $lang=true * @param boolean $lang =true
* @return string comma-separated and translated labels * @return string comma-separated and translated labels
*/ */
protected static function get_default_label($default, array $values, $lang=true) protected static function get_default_label($default, array $values, $lang=true)
@ -543,8 +543,8 @@ class preferences_settings
* Sets $this->appname and $this->settings * Sets $this->appname and $this->settings
* *
* @param string $appname appname or 'common' * @param string $appname appname or 'common'
* @param string $type='user' 'default', 'forced', 'user' or 'group' * @param string $type ='user' 'default', 'forced', 'user' or 'group'
* @param int|string $account_id=null account_id for user or group prefs, or "forced" or "default" * @param int|string $account_id =null account_id for user or group prefs, or "forced" or "default"
* @return boolean * @return boolean
*/ */
protected function call_hook($appname, $type='user', $account_id=null) protected function call_hook($appname, $type='user', $account_id=null)