本文整理汇总了PHP中Setting::getThemes方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getThemes方法的具体用法?PHP Setting::getThemes怎么用?PHP Setting::getThemes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::getThemes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_url
?>
</h1>
<form action="<?php
echo get_url("plugin/themer/savesettings");
?>
" method="post">
<table class="fieldset" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="label"><label for="settings-sidebar_width"><?php
echo __("Select an admin theme");
?>
</label></td>
<td class="field">
<?php
$pawed = array();
foreach (Setting::getThemes() as $key => $found) {
if (in_array($key, array("fox", "wint", "wordpress-3.8"))) {
$pawed[$key] = ucwords(str_replace("-", " ", $found));
}
}
if (count($pawed) == 0) {
echo "<i>" . __("No pawedWolf admin theme found!") . "</i>";
} else {
?>
<select name="settings[theme]"><?php
foreach ($pawed as $paw => $title) {
?>
<option value="<?php
echo $paw;
?>
"><?php
示例2: array
| @file ./enable.php
| @author svanlaere
| @version 1.1.0 [1.0.0] - Stable
|
| @license GPL License
| @copyright Copyright © 2015 svanlaere
*/
if (!defined("IN_CMS")) {
exit;
}
// CHECK
$error = true;
if (version_compare(PHP_VERSION, "5.3.0") <= 0) {
$error = "php";
} else {
$themes = Setting::getThemes();
$supported = array("fox", "wint", "wordpress-3.8");
foreach ($themes as $key => $theme) {
if (in_array($key, $supported)) {
$error = false;
break;
}
}
}
// PERFORM
if ($error !== false) {
if ($error !== "php") {
Plugin::deactivate("themer");
Flash::set("error", __("This plugin requires a pawedWolf admin theme!"));
} else {
Plugin::deactivate("themer");
示例3: __
?>
</td>
</tr>
<tr>
<td class="label"><label for="setting_theme"><?php
echo __('Administration Theme');
?>
</label></td>
<td class="field">
<select class="select" id="setting_theme" name="setting[theme]" onchange="$('css_theme').href = '<?php
echo CORE_FOLDER;
?>
/admin/themes/' + this[this.selectedIndex].value + '/styles.css';">
<?php
$current_theme = Setting::get('theme');
foreach (Setting::getThemes() as $code => $label) {
?>
<option value="<?php
echo $code;
?>
"<?php
if ($code == $current_theme) {
echo ' selected="selected"';
}
?>
><?php
echo __($label);
?>
</option>
<?php
}
示例4: savesettings
function savesettings()
{
if (!isset($_POST["settings"]) || !isset($_POST["settings"]["action"])) {
Flash::set("error", __("Could not save settings, no settings found."));
} else {
$action = $_POST["settings"]["action"];
if ($action == "theme") {
$themes = array_keys(Setting::getThemes());
if (in_array($_POST["settings"]["theme"], $themes)) {
$sql = "UPDATE " . TABLE_PREFIX . "setting SET value=:theme WHERE name='theme';";
Record::query($sql, array(":theme" => $_POST["settings"]["theme"]));
Flash::set("success", __("The settings have been saved."));
} else {
Flash::set("error", __("An error occured trying to save the settings."));
}
} else {
if ($action == "reset") {
// RESET SETTINGS
$settings = array("fox" => array("color" => "color.fox.css"), "wordpress-3.8" => array("color" => "default.css", "sidebar_width" => 180), "wint" => array("color" => "default.css", "sidebar_width" => 200, "responsive" => true));
$settings = $settings[$this->theme];
} else {
// VALIDATE SETTINGS
if (isset($_POST["settings"]["color"])) {
$colors = array_keys($this->getColors());
if (in_array($_POST["settings"]["color"], $colors)) {
$settings["color"] = $_POST["settings"]["color"];
}
}
if (isset($_POST["settings"]["sidebar_width"])) {
if (is_numeric($_POST["settings"]["sidebar_width"])) {
$settings["sidebar_width"] = (int) $_POST["settings"]["sidebar_width"];
}
}
if (isset($_POST["settings"]["responsive"])) {
$settings["responsive"] = true;
} else {
if ($this->theme == "wint") {
$settings["responsive"] = false;
}
}
}
// SET SETTINGS
if (isset($settings)) {
$insert = array();
$insert[$this->theme] = serialize($settings);
$settings = Plugin::setAllSettings($insert, "themer");
} else {
$settings = false;
}
if ($settings === true) {
Flash::set("success", __("The settings have been saved."));
} else {
Flash::set("error", __("An error occured trying to save the settings."));
}
}
}
redirect(get_url("plugin/themer/settings"));
die;
}