mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
get preferences working again
This commit is contained in:
parent
ca8cf03ff2
commit
eb10db6e3f
@ -43,30 +43,23 @@
|
|||||||
$this->xmlrpc = @is_object($GLOBALS['server']) && $GLOBALS['server']->last_method;
|
$this->xmlrpc = @is_object($GLOBALS['server']) && $GLOBALS['server']->last_method;
|
||||||
$this->session_data = $GLOBALS['egw']->session->appsession('session_data','preferences');
|
$this->session_data = $GLOBALS['egw']->session->appsession('session_data','preferences');
|
||||||
|
|
||||||
if($appname)
|
$this->appname = $appname;
|
||||||
{
|
|
||||||
$this->call_hook($appname);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_session($appname,$type,$show_help,$prefix)
|
function save_session($appname,$type,$show_help,$prefix,$notifies='')
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->session->appsession('session_data','preferences',array(
|
$GLOBALS['egw']->session->appsession('session_data','preferences',array(
|
||||||
'type' => $type, // save our state in the app-session
|
'type' => $type, // save our state in the app-session
|
||||||
'show_help' => $show_help,
|
'show_help' => $show_help,
|
||||||
'prefix' => $prefix,
|
'prefix' => $prefix,
|
||||||
'appname' => $appname // we use this to reset prefix on appname-change
|
'appname' => $appname, // we use this to reset prefix on appname-change
|
||||||
|
'notifies' => $notifies,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
function call_hook($appname)
|
function call_hook($appname)
|
||||||
{
|
{
|
||||||
$this->appname = $appname;
|
$this->appname = $appname;
|
||||||
if(!$GLOBALS['egw']->hooks->single('settings',$this->appname))
|
|
||||||
{
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
$this->settings = array_merge($this->settings,$GLOBALS['settings']);
|
|
||||||
|
|
||||||
$GLOBALS['egw']->translation->add_app($this->appname);
|
$GLOBALS['egw']->translation->add_app($this->appname);
|
||||||
if($this->appname != 'preferences')
|
if($this->appname != 'preferences')
|
||||||
@ -74,6 +67,12 @@
|
|||||||
$GLOBALS['egw']->translation->add_app('preferences'); // we need the prefs translations too
|
$GLOBALS['egw']->translation->add_app('preferences'); // we need the prefs translations too
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$GLOBALS['egw']->hooks->single('settings',$this->appname))
|
||||||
|
{
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
$this->settings = array_merge($this->settings,$GLOBALS['settings']);
|
||||||
|
|
||||||
/* Remove ui-only settings */
|
/* Remove ui-only settings */
|
||||||
if($this->xmlrpc)
|
if($this->xmlrpc)
|
||||||
{
|
{
|
||||||
@ -165,11 +164,11 @@
|
|||||||
continue; // dont write empty password-fields
|
continue; // dont write empty password-fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$prefs[$var] = stripslashes($value);
|
$prefs[$var] = get_magic_quotes_gpc() ? stripslashes($value) : $value;
|
||||||
|
|
||||||
if($notifies[$var]) // need to translate the key-words back
|
if($this->session_data['notifies'][$var]) // need to translate the key-words back
|
||||||
{
|
{
|
||||||
$prefs[$var] = $GLOBALS['egw']->preferences->lang_notify($prefs[$var],$notifies[$var],True);
|
$prefs[$var] = $GLOBALS['egw']->preferences->lang_notify($prefs[$var],$this->session_data['notifies'][$var],True);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
function uisettings()
|
function uisettings()
|
||||||
{
|
{
|
||||||
$this->bo =& CreateObject('preferences.bosettings');
|
$this->bo =& CreateObject('preferences.bosettings',$_GET['appname']);
|
||||||
|
|
||||||
if($GLOBALS['egw']->acl->check('run',1,'admin'))
|
if($GLOBALS['egw']->acl->check('run',1,'admin'))
|
||||||
{
|
{
|
||||||
@ -149,7 +149,7 @@
|
|||||||
{
|
{
|
||||||
if($valarray['admin'])
|
if($valarray['admin'])
|
||||||
{
|
{
|
||||||
next;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch($valarray['type'])
|
switch($valarray['type'])
|
||||||
@ -230,13 +230,7 @@
|
|||||||
// TODO - what is the purpose of this?
|
// TODO - what is the purpose of this?
|
||||||
if(count($notifies)) // there have been notifies in the hook, we need to save in the session
|
if(count($notifies)) // there have been notifies in the hook, we need to save in the session
|
||||||
{
|
{
|
||||||
$this->bo->save_session(
|
$this->bo->save_session($_GET['appname'],$GLOBALS['type'],$this->show_help,$this->prefix,$notifies);
|
||||||
$GLOBALS['type'], // save our state in the app-session
|
|
||||||
$this->show_help,
|
|
||||||
$this->prefix,
|
|
||||||
$_GET['appname'], // we use this to reset prefix on appname-change
|
|
||||||
$notifies
|
|
||||||
);
|
|
||||||
//_debug_array($notifies);
|
//_debug_array($notifies);
|
||||||
}
|
}
|
||||||
if($this->is_admin())
|
if($this->is_admin())
|
||||||
@ -404,7 +398,7 @@
|
|||||||
$s .= '<option value="' . $var . '"';
|
$s .= '<option value="' . $var . '"';
|
||||||
if("$var" == "$selected") // the "'s are necessary to force a string-compare
|
if("$var" == "$selected") // the "'s are necessary to force a string-compare
|
||||||
{
|
{
|
||||||
$s .= ' selected';
|
$s .= ' selected="1"';
|
||||||
}
|
}
|
||||||
$s .= '>' . $value . '</option>';
|
$s .= '>' . $value . '</option>';
|
||||||
}
|
}
|
||||||
@ -490,8 +484,8 @@
|
|||||||
|
|
||||||
$notifies[$name] = $vars; // this gets saved in the app_session for re-translation
|
$notifies[$name] = $vars; // this gets saved in the app_session for re-translation
|
||||||
|
|
||||||
$help = $help && $run_lang ? lang($help) : $help;
|
$help = $help && ($run_lang || is_null($run_lang)) ? lang($help) : $help;
|
||||||
if($subst_help)
|
if($subst_help || is_null($subst_help))
|
||||||
{
|
{
|
||||||
$help .= '<p><b>'.lang('Substitutions and their meanings:').'</b>';
|
$help .= '<p><b>'.lang('Substitutions and their meanings:').'</b>';
|
||||||
foreach($vars as $var => $var_help)
|
foreach($vars as $var => $var_help)
|
||||||
|
@ -70,9 +70,9 @@
|
|||||||
$sbox = createobject('phpgwapi.sbox');
|
$sbox = createobject('phpgwapi.sbox');
|
||||||
$langs = $GLOBALS['egw']->translation->get_installed_langs();
|
$langs = $GLOBALS['egw']->translation->get_installed_langs();
|
||||||
|
|
||||||
foreach($GLOBALS['egw_info']['user']['apps'] as $app)
|
$user_apps = array();
|
||||||
|
foreach($GLOBALS['egw_info']['user']['apps'] as $app => $data)
|
||||||
{
|
{
|
||||||
$app = $app[0];
|
|
||||||
if($GLOBALS['egw_info']['apps'][$app]['status'] != 2 && $app)
|
if($GLOBALS['egw_info']['apps'][$app]['status'] != 2 && $app)
|
||||||
{
|
{
|
||||||
$user_apps[$app] = $GLOBALS['egw_info']['apps'][$app]['title'] ? $GLOBALS['egw_info']['apps'][$app]['title'] : lang($app);
|
$user_apps[$app] = $GLOBALS['egw_info']['apps'][$app]['title'] ? $GLOBALS['egw_info']['apps'][$app]['title'] : lang($app);
|
||||||
|
Loading…
Reference in New Issue
Block a user