' . t('Configuration Editor') . ''; $content .= '
' . t('Warning: Changing some settings could render your channel inoperable. Please leave this page unless you are comfortable with and knowledgeable about how to correctly use this feature.') . '
' . EOL . EOL; if(argc() == 3) { $content .= 'pconfig[' . local_channel() . ']' . EOL; $content .= 'pconfig[' . local_channel() . '][' . escape_tags(argv(1)) . ']' . EOL . EOL; $content .= 'pconfig[' . local_channel() . '][' . escape_tags(argv(1)) . '][' . escape_tags(argv(2)) . '] = ' . get_pconfig(local_channel(),escape_tags(argv(1)),escape_tags(argv(2))) . EOL; if(in_array(argv(2),disallowed_pconfig())) { notice( t('This setting requires special processing and editing has been blocked.') . EOL); return $content; } else $content .= pconfig_form(escape_tags(argv(1)),escape_tags(argv(2))); } if(argc() == 2) { $content .= 'pconfig[' . local_channel() . ']' . EOL; load_pconfig(local_channel(),escape_tags(argv(1))); foreach($a->config[local_channel()][escape_tags(argv(1))] as $k => $x) { $content .= 'pconfig[' . local_channel() . '][' . escape_tags(argv(1)) . '][' . $k . '] = ' . escape_tags($x) . EOL; } } if(argc() == 1) { $r = q("select * from pconfig where uid = " . local_channel()); if($r) { foreach($r as $rr) { $content .= 'pconfig[' . local_channel() . '][' . escape_tags($rr['cat']) . '][' . escape_tags($rr['k']) . '] = ' . escape_tags($rr['v']) . EOL; } } } return $content; } function pconfig_form($cat,$k) { $o = '
'; $o .= ''; $v = get_pconfig(local_channel(),$cat,$k); if(strpos($k,'password') !== false) $v = z_unobscure($v); $o .= ''; $o .= ''; if(strpos($v,"\n")) $o .= ''; else $o .= ''; $o .= EOL . EOL; $o .= ''; $o .= '
'; return $o; }