$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 '
Setting ID | '."\n". ''.__('Value').' | '."\n". ''.__('Type').' | '."\n". ''.__('Description').' | '."\n". '
---|