コード例 #1
0
            $Settings->saveConfig($where, $value);
        }
    } else {
        /*
         *	Setup option values;
         */
        $i18nfiles = FileFolderList("./lang/", $depth = 1, $current = '', $level = 0);
        $available_languages = available_languages($i18nfiles);
        foreach ($available_languages as $null => $language) {
            $options_languages[$language[file]] = "{$language['langinternational']} ({$language['langnational']})";
        }
        $options_yesno = array("yes" => i18n("generic_yes"), "no" => i18n("generic_no"));
        $options_storage = array("mysql" => "mySQL Database", "flat" => "Flat file (var_dump) DB");
        $options_comment_requirepreview = array("yes" => "Require preview before posting", "no" => "Do not require preview");
        $options_mysql_info = array(makeField("text", "config[storage][mysqluser]", "mysqluser", $Settings->co[storage][mysqluser], i18n("options_mysql_username", "MySQL"), "inshort"), makeField("text", "config[storage][mysqlpass]", "mysqlpass", $Settings->co[storage][mysqlpass], i18n("options_mysql_password", "MySQL,<small>,</small>"), "inshort"), makeField("text", "config[storage][mysqlhost]", "mysqlhost", $Settings->co[storage][mysqlhost], i18n("options_mysql_host", "MySQL,<small>,</small>"), "inshort"), makeField("text", "config[storage][mysqldatabase]", "mysqldb", $Settings->co[storage][mysqldatabase], i18n("options_mysql_database", "MySQL"), "inshort"));
        $settingfields = array("general" => array("name" => i18n("options_general"), makeField("text", "config[general][uniquekey]", "uniquekey", $Settings->co[general][uniquekey], i18n("options_d_unique", "<small>,</small>"), "inlong", "top"), makeField("text", "config[general][adminmail]", "adminmail", $Settings->co[general][adminmail], "Administrator email", "inmedium", "top"), makeField("text", "config[general][dateoffset]", "dateoffset", $Settings->co[general][dateoffset], i18n("options_dateoffset"), "inshort"), formGroup($options_mysql_info, i18n("options_mysql_info")), radioGroup($options_yesno, "emailspam", "config[general][emailspam]", i18n("options_emailspam"), $Settings->co[general][emailspam]), radioGroup($options_languages, "defaultlanguage", "config[general][defaultlanguage]", i18n("options_default_lang"), $Settings->co[general][defaultlanguage])), "articles" => array("name" => i18n("dashboard_Articles"), makeField("text", "config[articles][dateformat]", "articledateformat", $Settings->co[articles][dateformat], "Articles date format", $group)), "comments" => array("name" => i18n("dashboard_Comments"), radioGroup($options_yesno, "requireregister", "config[comments][requireregister]", i18n("options_requireregister"), $Settings->co[comments][requireregister]), makeField("text", "config[comments][dateformat]", "commentdateformat", $Settings->co[comments][dateformat], "Comments date format"), makeField("text", "config[comments][avatar][size]", "gravatarsize", $Settings->co[comments][avatar][size], "Gravatar size (in pixels)"), makeField("text", "config[comments][avatar][defaulturl]", "gravatardefault", $Settings->co[comments][avatar][defaulturl], "Default gravatar (url)", "inlong"), radioGroup($options_yesno, "requireemail", "config[comments][requiremail]", "Require email?", $Settings->co[comments][requiremail])));
        $main_content .= '<form id="config" method="post" action="">';
        $main_content .= '<div id="storage_select" class="div_extended">';
        $main_content .= radioGroup($options_storage, "storage", "config[storage][backend]", "Database backend", $Settings->co[storage][backend]);
        $main_content .= '</div><div class="div_normal">';
        foreach ($settingfields as $class => $fields) {
            $main_content .= formGroup($fields, $fields[name]);
        }
        $main_content .= '<p><input class="save" type="submit" value="Save" name="configsave" /></p></div>';
        $main_content .= '</form>';
    }
}
#
#	Add / List categories
#
if ($_GET[screen] == "categories" && !$_POST[addcat]) {
コード例 #2
0
	<li id="options_menu_categories"><a href="?panel=options&amp;screen=categories">' . i18n("menu_categories") . '</a></li>
	<li id="options_menu_setup"><a href="?panel=options&amp;screen=setup"><span style="color: #f32988;">k</span>nife' . i18n("menu_setup") . '</a></li>
</ul>
';
$settingclass = new SettingsStorage('settings');
$currentcats = $settingclass->settings['categories'];
$alltemplates = $settingclass->settings['templates'];
#
# Knife setup
#
function makeField($type, $name, $id, $value, $label)
{
    return "<input type=\"{$type}\" name=\"{$name}\" id=\"{$id}\" value=\"{$value}\" /> <label for=\"{$id}\">{$label}</label>";
}
if ($_GET[screen] == "setup") {
    $main_content = makeField("text", "something", "theid", "something", "Label");
    $main_content .= "\n\t\n\t\n\t";
}
#
#	Add / List categories
#
if ($_GET[screen] == "categories" && !$_POST[addcat]) {
    $moduletitle = i18n("dashboard_categories");
    $statusmessage = i18n("dashboard_categories");
    $main_content = '
	<div id="manage_cats_wrapper">
	<div class="div_normal options_categorylist">
	<fieldset>
		<legend>' . i18n("categories_current") . '</legend>
	<table>
		<thead>