break;
 case "seo":
     TPL::render("v_settings/settings_seo");
     break;
 case "maintenance":
     if (isset($_POST['save_changes'])) {
         OPTIONS::set("website", "maintenance_mode", $_POST['maintenance_mode']);
         TPL::message("Actualizarile au fost efectuate cu succes.", "success");
     }
     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));
Example #2
0
function admin_get_background($return = false)
{
    $template = replace_cards(OPTIONS::prefered('admin', 'background'));
    if (!filter_var($template, FILTER_VALIDATE_URL)) {
        $template = FOLDER_ADMIN . "template/assets/backgrounds/" . $template;
        $template = str_replace(array(FOLDER_BASE, DS), array(BASE_URL, "/"), $template);
    }
    // output the result
    if ($return) {
        return $template;
    } else {
        echo $template;
    }
}