$s) { $core->blog->settings->addNamespace($ns); foreach ($s as $k => $v) { if ($_POST['s_type'][$ns][$k] == 'array') { $v = json_decode($v, true); } $core->blog->settings->$ns->put($k, $v); } $core->blog->triggerBlog(); } dcPage::addSuccessNotice(__('Configuration successfully updated')); http::redirect($p_url); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # Global settings update if (!empty($_POST['gs']) && is_array($_POST['gs'])) { try { foreach ($_POST['gs'] as $ns => $s) { $core->blog->settings->addNamespace($ns); foreach ($s as $k => $v) { if ($_POST['gs_type'][$ns][$k] == 'array') { $v = json_decode($v, true); } $core->blog->settings->$ns->put($k, $v, null, null, true, true); } $core->blog->triggerBlog(); } dcPage::addSuccessNotice(__('Configuration successfully updated')); http::redirect($p_url . '&part=global'); } catch (Exception $e) { $core->error->add($e->getMessage()); } } $part = !empty($_GET['part']) && $_GET['part'] == 'global' ? 'global' : 'local'; function settingLine($id, $s, $ns, $field_name, $strong_label) { if ($s['type'] == 'boolean') { $field = form::combo(array($field_name . '[' . $ns . '][' . $id . ']', $field_name . '_' . $ns . '_' . $id), array(__('yes') => 1, __('no') => 0), $s['value'] ? 1 : 0); } else { if ($s['type'] == 'array') { $field = form::field(array($field_name . '[' . $ns . '][' . $id . ']', $field_name . '_' . $ns . '_' . $id), 40, null, html::escapeHTML(json_encode($s['value']))); } else { $field = form::field(array($field_name . '[' . $ns . '][' . $id . ']', $field_name . '_' . $ns . '_' . $id), 40, null, html::escapeHTML($s['value'])); } } $type = form::hidden(array($field_name . '_type' . '[' . $ns . '][' . $id . ']', $field_name . '_' . $ns . '_' . $id . '_type'), html::escapeHTML($s['type'])); $slabel = $strong_label ? '%s' : '%s'; return '' . '' . '' . $field . '' . '' . $s['type'] . $type . '' . '' . html::escapeHTML($s['label']) . '' . ''; } ?> about:config '', html::escapeHTML($core->blog->name) => '', __('about:config') => '' )) . dcPage::notices(); ?>

blog->name)); ?>

' . '' . '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '' . "\n" . '' . "\n" . ''; $table_footer = '
%s
' . __('Setting ID') . '' . __('Value') . '' . __('Type') . '' . __('Description') . '
'; $settings = array(); foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) { foreach ($namespace->dumpSettings() as $k => $v) { $settings[$ns][$k] = $v; } } ksort($settings); if (count($settings) > 0) { $ns_combo = array(); foreach ($settings as $ns => $s) { $ns_combo[$ns] = '#l_' . $ns; } echo '
' . '

' . ' ' . form::combo('ls_nav', $ns_combo) . ' ' . '' . $core->formNonce() . '

'; } ?>
$s) { ksort($s); echo sprintf($table_header, 'l_' . $ns, $ns); foreach ($s as $k => $v) { echo settingLine($k, $v, $ns, 's', !$v['global']); } echo $table_footer; } ?>

formNonce(); ?>

blog->settings->dumpNamespaces() as $ns => $namespace) { foreach ($namespace->dumpGlobalSettings() as $k => $v) { $settings[$ns][$k] = $v; } } ksort($settings); if (count($settings) > 0) { $ns_combo = array(); foreach ($settings as $ns => $s) { $ns_combo[$ns] = '#g_' . $ns; } echo '
' . '

' . ' ' . form::combo('gs_nav', $ns_combo) . ' ' . '' . '' . $core->formNonce() . '

'; } ?>
$s) { ksort($s); echo sprintf($table_header, 'g_' . $ns, $ns); foreach ($s as $k => $v) { echo settingLine($k, $v, $ns, 'gs', false); } echo $table_footer; } ?>

formNonce(); ?>