} TPL::assign("maintenance_mode", OPTIONS::website("maintenance_mode")); TPL::render("v_settings/settings_maintenance"); break; case "backend": if (isset($_POST['new_background'])) { // change image $new_image = replace_cards($_POST['new_background'], array(), true); OPTIONS::set('admin', 'background', $new_image, USER::get('id')); // return result die('ok'); } if (isset($_POST['new_color'])) { // change color scheme $color_scheme = substr(substr($_POST['new_color'], 5), 0, -1); OPTIONS::set('admin', 'color_scheme', $color_scheme, USER::get('id')); // return result die('ok'); } // get backgrounds list ---------------------------------------- $backgrounds = array(); foreach (glob(FOLDER_ADMIN . "template/assets/backgrounds/*.{jpg,png}", GLOB_BRACE) as $bg) { $infos = array("link" => str_replace(array(FOLDER_BASE, DS), array(BASE_URL, "/"), $bg), "img" => basename($bg), "thumb" => str_replace(array(FOLDER_BASE, DS), array(BASE_URL, "/"), $bg)); $infos['current'] = $infos['link'] == admin_get_background(true) ? true : false; $backgrounds[] = $infos; } TPL::assign("backgrounds", $backgrounds); // ------------------------------------------------------------- // set render TPL::render("v_settings/settings_backend"); break;
public static function service_thumbs_remove_allow($size) { // arrange allowed sizes if (!is_array($size)) { $size = array($size); } $current = explode(",", OPTIONS::website("service_thumbs_allowed_sizes")); foreach ($current as $i => $v) { if (in_array($v, $size)) { unset($current[$i]); } } $current = implode(",", $current); // update OPTIONS::set('website', 'service_thumbs_allowed_sizes', $current); // return return true; }
*/ case "templates_list": TPL::assign("templates_list", DRAWLINE::templates_list()); TPL::render('v_design/templates_list'); break; /* * install a template */ /* * install a template */ case "template_install": if (isset($_GET['package'])) { $package = str_replace(array("/", ".."), "", $_GET['package']); if (file_exists(FOLDER_EXTENDER . "templates" . DS . $package . DS . "index.php")) { if (OPTIONS::set("website", "frontend_template", $package)) { TPL::message("The template was changed successfuly.", "success"); } else { TPL::message("We encounted an error. Please try again!"); } } else { TPL::message("I can't find this template on the server."); } } else { redirect(ADMIN_URL); } TPL::assign("templates_list", DRAWLINE::templates_list()); TPL::render('v_design/templates_list'); break; } }
public static function remove_page_type($type_name) { global $db; $actual = array(); $current = self::get_page_types(); foreach ($current as $c) { if ($c['type_name'] != $type_name) { $actual[] = $c; } } $actual = json_encode($actual); return OPTIONS::set("website", "page_types", $actual) ? true : false; }