$s)
{
$core->auth->user_prefs->addWorkspace($ws);
foreach ($s as $k => $v) {
$core->auth->user_prefs->$ws->put($k,$v);
}
}
http::redirect($p_url.'&upd=1');
}
catch (Exception $e)
{
$core->error->add($e->getMessage());
}
}
# Global prefs update
if (!empty($_POST['gs']) && is_array($_POST['gs']))
{
try
{
foreach ($_POST['gs'] as $ws => $s)
{
$core->auth->user_prefs->addWorkspace($ws);
foreach ($s as $k => $v) {
$core->auth->user_prefs->$ws->put($k,$v,null,null,true,true);
}
}
http::redirect($p_url.'&upd=1&part=global');
}
catch (Exception $e)
{
$core->error->add($e->getMessage());
}
}
$part = !empty($_GET['part']) && $_GET['part'] == 'global' ? 'global' : 'local';
function prefLine($id,$s,$ws,$field_name,$strong_label)
{
if ($s['type'] == 'boolean') {
$field = form::combo(array($field_name.'['.$ws.']['.$id.']',$field_name.'_'.$id),
array(__('yes') => 1, __('no') => 0),$s['value'] ? 1 : 0);
} else {
$field = form::field(array($field_name.'['.$ws.']['.$id.']',$field_name.'_'.$id),40,null,
html::escapeHTML($s['value']));
}
$slabel = $strong_label ? '%s' : '%s';
return
'
'.
' | '.
''.$field.' | '.
''.$s['type'].' | '.
''.html::escapeHTML($s['label']).' | '.
'
';
}
?>
user:preferences
'',
html::escapeHTML($core->auth->userID()) => '',
''.__('user:preferences').'' => ''
));
if (!empty($_GET['upd'])) {
dcPage::success(__('Preferences successfully updated'));
}
if (!empty($_GET['upda'])) {
dcPage::success(__('Preferences definition successfully updated'));
}
?>
%s'.
'
'.
''."\n".
' Setting ID | '."\n".
' '.__('Value').' | '."\n".
' '.__('Type').' | '."\n".
' '.__('Description').' | '."\n".
'
'."\n".
''."\n".
'
';
$table_footer = '';
$prefs = array();
foreach ($core->auth->user_prefs->dumpWorkspaces() as $ws => $workspace) {
foreach ($workspace->dumpPrefs() as $k => $v) {
$prefs[$ws][$k] = $v;
}
}
ksort($prefs);
if (count($prefs) > 0) {
$ws_combo = array();
foreach ($prefs as $ws => $s) {
$ws_combo[$ws] = '#l_'.$ws;
}
echo
'
';
}
?>
auth->user_prefs->dumpWorkspaces() as $ws => $workspace) {
foreach ($workspace->dumpGlobalPrefs() as $k => $v) {
$prefs[$ws][$k] = $v;
}
}
ksort($prefs);
if (count($prefs) > 0) {
$ws_combo = array();
foreach ($prefs as $ws => $s) {
$ws_combo[$ws] = '#g_'.$ws;
}
echo
'
';
}
?>