Beispiel #1
0
function wp_persistant_notice()
{
    global $pagenow;
    $cherry_url_info = get_option('cherry_url_info');
    $cherry_new_version = get_option('cherry_new_version');
    $cherry_version = get_theme_info(PARENT_NAME, 'Version');
    $pageHidden = array("update.php", "update-core.php", 'cherry-options_page_options-framework-data-management', 'admin.php');
    $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode(PARENT_NAME), 'upgrade-theme_' . urlencode(PARENT_NAME));
    if (!get_user_meta(get_current_user_id(), '_wp_hide_notice', true) && !in_array($pagenow, $pageHidden) && is_admin() && $cherry_new_version > $cherry_version) {
        printf('<div class="updated"><p><strong>%1$s <a href="%2$s" class="thickbox" title="cherry">%3$s</a> %4$s <a href="%5$s" onclick="%6$s">%7$s</a><br>%8$s<br><a href="%9$s"> %10$s </a></strong></p></div>', theme_locals('new_version'), $cherry_url_info . '?TB_iframe=true&width=1024&height=800', theme_locals('view_version') . ' ' . $cherry_new_version . ' ' . theme_locals('details'), theme_locals('or'), $update_url, "if ( confirm('Updating this theme will lose any customizations you have made. \\'Cancel\\' to stop, \\'OK\\' to update.') ) {return true;}return false;", theme_locals('update_now'), theme_locals('info_box_4'), esc_url(add_query_arg('wp_nag', wp_create_nonce('wp_nag'))), theme_locals('dismiss_notice'));
    }
}
Beispiel #2
0
function pretheme_init(&$a)
{
    if ($_REQUEST['theme']) {
        $theme = $_REQUEST['theme'];
        $info = get_theme_info($theme);
        if ($info) {
            // unfortunately there will be no translation for this string
            $desc = $info['description'] . ' ' . $info['version'];
        } else {
            $desc = '';
        }
        echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc));
    }
    killme();
}
Beispiel #3
0
 function init()
 {
     if ($_REQUEST['theme']) {
         $theme = $_REQUEST['theme'];
         $info = get_theme_info($theme);
         if ($info) {
             // unfortunately there will be no translation for this string
             $desc = $info['description'];
             $version = $info['version'];
             $credits = $info['credits'];
         } else {
             $desc = '';
             $version = '';
             $credits = '';
         }
         echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
     }
     killme();
 }
Beispiel #4
0
 function get()
 {
     $theme = argv(1);
     if (!$theme) {
         killme();
     }
     $schemalist = array();
     $theme_config = "";
     if (($themeconfigfile = $this->get_theme_config_file($theme)) != null) {
         require_once $themeconfigfile;
         if (class_exists('\\Zotlabs\\Theme\\' . ucfirst($theme) . 'Config')) {
             $clsname = '\\Zotlabs\\Theme\\' . ucfirst($theme) . 'Config';
             $th_config = new $clsname();
             $schemas = $th_config->get_schemas();
             if ($schemas) {
                 foreach ($schemas as $k => $v) {
                     $schemalist[] = ['key' => $k, 'val' => $v];
                 }
             }
             $theme_config = $th_config->get();
         }
     }
     $info = get_theme_info($theme);
     if ($info) {
         // unfortunately there will be no translation for this string
         $desc = $info['description'];
         $version = $info['version'];
         $credits = $info['credits'];
     } else {
         $desc = '';
         $version = '';
         $credits = '';
     }
     $ret = ['theme' => $theme, 'img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits, 'schemas' => $schemalist, 'config' => $theme_config];
     json_return_and_die($ret);
 }
Beispiel #5
0
echo G5_ADMIN_URL;
?>
/theme.js"></script>

<p class="theme_p">설치된 테마 : <?php 
echo number_format($total_count);
?>
</p>

<?php 
if ($total_count > 0) {
    ?>
<ul id="theme_list">
    <?php 
    for ($i = 0; $i < $total_count; $i++) {
        $info = get_theme_info($theme[$i]);
        $name = get_text($info['theme_name']);
        if ($info['screenshot']) {
            $screenshot = '<img src="' . $info['screenshot'] . '" alt="' . $name . '">';
        } else {
            $screenshot = '<img src="' . G5_ADMIN_URL . '/img/theme_img.jpg" alt="">';
        }
        if ($config['cf_theme'] == $theme[$i]) {
            $btn_active = '<span class="theme_sl theme_sl_use">사용중</span><button type="button" class="theme_sl theme_deactive" data-theme="' . $theme[$i] . '" ' . 'data-name="' . $name . '">사용안함</button>';
        } else {
            $tconfig = get_theme_config_value($theme[$i], 'set_default_skin');
            if ($tconfig['set_default_skin']) {
                $set_default_skin = 'true';
            } else {
                $set_default_skin = 'false';
            }
Beispiel #6
0
<?php

$min_lvl = 800;
$edit_lvl = 600;
$maxuserlisted = 500;
require "../../php_includes/cmaster.inc";
std_init();
$cTheme = get_theme_info();
?>
<!-- $Id: users.php,v 1.55 2009/06/09 15:43:58 mrbean_ Exp $ //-->
<?php 
$theuser = trim($theuser);
$nrw_lvl = 0;
if (acl(XWEBAXS_2)) {
    $nrw_lvl = 1;
}
if (acl(XWEBAXS_3)) {
    $nrw_lvl = 2;
}
if (isset($canview)) {
    unset($canview);
}
if (isset($canedit)) {
    unset($canedit);
}
if ($admin >= $edit_lvl || acl(XAT_CAN_VIEW) || acl(XAT_CAN_EDIT)) {
    $canview = 1;
} else {
    $canview = 0;
}
if ($admin >= $edit_lvl || acl(XAT_CAN_EDIT)) {
Beispiel #7
0
 /**
  * @brief Themes admin page.
  *
  * @return string
  */
 function get()
 {
     $allowed_themes_str = get_config('system', 'allowed_themes');
     $allowed_themes_raw = explode(',', $allowed_themes_str);
     $allowed_themes = array();
     if (count($allowed_themes_raw)) {
         foreach ($allowed_themes_raw as $x) {
             if (strlen(trim($x))) {
                 $allowed_themes[] = trim($x);
             }
         }
     }
     $themes = array();
     $files = glob('view/theme/*');
     if ($files) {
         foreach ($files as $file) {
             $f = basename($file);
             $is_experimental = intval(file_exists($file . '/.experimental'));
             $is_supported = 1 - intval(file_exists($file . '/.unsupported'));
             // Is not used yet
             $is_allowed = intval(in_array($f, $allowed_themes));
             $themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
         }
     }
     if (!count($themes)) {
         notice(t('No themes found.'));
         return '';
     }
     /*
      * Single theme
      */
     if (\App::$argc == 3) {
         $theme = \App::$argv[2];
         if (!is_dir("view/theme/{$theme}")) {
             notice(t("Item not found."));
             return '';
         }
         if (x($_GET, "a") && $_GET['a'] == "t") {
             check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
             // Toggle theme status
             $this->toggle_theme($themes, $theme, $result);
             $s = $this->rebuild_theme_table($themes);
             if ($result) {
                 info(sprintf('Theme %s enabled.', $theme));
             } else {
                 info(sprintf('Theme %s disabled.', $theme));
             }
             set_config('system', 'allowed_themes', $s);
             goaway(z_root() . '/admin/themes');
         }
         // display theme details
         require_once 'library/markdown.php';
         if ($this->theme_status($themes, $theme)) {
             $status = "on";
             $action = t("Disable");
         } else {
             $status = "off";
             $action = t("Enable");
         }
         $readme = Null;
         if (is_file("view/theme/{$theme}/README.md")) {
             $readme = file_get_contents("view/theme/{$theme}/README.md");
             $readme = Markdown($readme);
         } else {
             if (is_file("view/theme/{$theme}/README")) {
                 $readme = "<pre>" . file_get_contents("view/theme/{$theme}/README") . "</pre>";
             }
         }
         $admin_form = '';
         if (is_file("view/theme/{$theme}/php/config.php")) {
             require_once "view/theme/{$theme}/php/config.php";
             if (function_exists("theme_admin")) {
                 $admin_form = theme_admin($a);
             }
         }
         $screenshot = array(get_theme_screenshot($theme), t('Screenshot'));
         if (!stristr($screenshot[0], $theme)) {
             $screenshot = null;
         }
         $t = get_markup_template('admin_plugins_details.tpl');
         return replace_macros($t, array('$title' => t('Administration'), '$page' => t('Themes'), '$toggle' => t('Toggle'), '$settings' => t('Settings'), '$baseurl' => z_root(), '$plugin' => $theme, '$status' => $status, '$action' => $action, '$info' => get_theme_info($theme), '$function' => 'themes', '$admin_form' => $admin_form, '$str_author' => t('Author: '), '$str_maintainer' => t('Maintainer: '), '$screenshot' => $screenshot, '$readme' => $readme, '$form_security_token' => get_form_security_token('admin_themes')));
     }
     /*
      * List themes
      */
     $xthemes = array();
     if ($themes) {
         foreach ($themes as $th) {
             $xthemes[] = array($th['name'], $th['allowed'] ? "on" : "off", get_theme_info($th['name']));
         }
     }
     $t = get_markup_template('admin_plugins.tpl');
     return replace_macros($t, array('$title' => t('Administration'), '$page' => t('Themes'), '$submit' => t('Submit'), '$baseurl' => z_root(), '$function' => 'themes', '$plugins' => $xthemes, '$experimental' => t('[Experimental]'), '$unsupported' => t('[Unsupported]'), '$form_security_token' => get_form_security_token('admin_themes')));
 }
    function admin_data_management()
    {
        global $framework_version;
        ?>
			<div id="optionsframework-metabox" class="metabox-holder">
				<div id="optionsframework" class="postbox store-holder">
					<div class="wrap">
						<h3><?php 
        echo theme_locals("data_management");
        ?>
</h3>
						<div class="data_management">
							<p><?php 
        echo theme_locals("info_box_1");
        ?>
</p>
							<div class="theme_box">
								<h4><?php 
        echo theme_locals('cherry_framework');
        ?>
</h4>
								<?php 
        if (FILE_WRITEABLE) {
            ?>
									<div class="error"><p><?php 
            echo theme_locals("info_box_2");
            ?>
</p></div>
								<?php 
        }
        ?>
								<div class="controls framework_info">
									<span class="data_label"><?php 
        echo theme_locals("name");
        ?>
:</span><span class="data_val"><?php 
        echo get_theme_info(PARENT_NAME, 'Name');
        ?>
</span><br>
									<span class="data_label"><?php 
        echo theme_locals("author");
        ?>
:</span><span class="data_val"><?php 
        echo get_theme_info(PARENT_NAME, 'Author');
        ?>
</span><br>
									<span class="data_label"><?php 
        echo theme_locals("your_version");
        ?>
:</span><span id="your_version_<?php 
        echo PARENT_NAME;
        ?>
" class="data_val"><?php 
        echo $framework_version;
        ?>
</span><br>
									<span class="data_label"><?php 
        echo theme_locals("update_version");
        ?>
:</span><span id="update_version" class="data_val"><?php 
        echo check_update();
        ?>
</span><br>
									<span class="data_label"><?php 
        echo theme_locals("backup_version");
        ?>
:</span><span id="version_<?php 
        echo PARENT_NAME;
        ?>
" class="data_val"><?php 
        echo get_file_date(PARENT_NAME)->backup_version;
        ?>
</span><br>
									<span class="data_label"><?php 
        echo theme_locals("backup_date");
        ?>
:</span><span id="date_<?php 
        echo PARENT_NAME;
        ?>
" class="data_val"><?php 
        echo get_file_date(PARENT_NAME)->date;
        ?>
</span><br>
									<span class="data_label"><?php 
        echo theme_locals("description");
        ?>
:</span><span class="data_val"><?php 
        echo get_theme_info(PARENT_NAME, 'Description');
        ?>
</span><br>
									<?php 
        add_radio_button(get_theme_info(PARENT_NAME, 'Template'), "", true);
        ?>
								</div>
								<?php 
        if (FILE_WRITEABLE) {
            ?>
								<div class="buttons_controls">
									<div class="button_wrapper">
										<?php 
            $update_url = wp_nonce_url('update.php?action=upgrade-theme&amp;theme=' . urlencode(PARENT_NAME), 'upgrade-theme_' . urlencode(PARENT_NAME));
            $disable_class = "";
            $cap = "";
            if ($framework_version >= check_update()) {
                $cap = '<span class="cap"></span>';
                $disable_class = "disable_button";
            }
            echo "<a id=\"update_framework\" class=\"button-primary " . $disable_class . "\" href=\"" . $update_url . "\" onclick=\"if ( confirm('Updating this theme will lose any customizations you have made. \\'Cancel\\' to stop, \\'OK\\' to update.') ) {return true;}return false;\">" . theme_locals("update") . "</a>" . $cap;
            ?>
									</div>
									<div class="button_wrapper">
										<a class="button-primary backup_theme" href="<?php 
            echo PARENT_NAME;
            ?>
"  title="<?php 
            echo theme_locals('backup');
            ?>
"><?php 
            echo theme_locals("backup");
            ?>
</a>
									</div>
									<div class="button_wrapper">
										<a class="button-primary restore_theme " href="<?php 
            echo PARENT_NAME;
            ?>
" title="<?php 
            echo theme_locals('restore');
            ?>
"><?php 
            echo theme_locals("restore");
            ?>
</a>
									</div>
									<div class="button_wrapper">
										<a class="button-primary download_backup" href="<?php 
            echo PARENT_NAME;
            ?>
" title="<?php 
            echo theme_locals('download_backup');
            ?>
"><?php 
            echo theme_locals("download_backup");
            ?>
</a>
									</div>
								</div>
								<?php 
        } else {
            printf('<p><em>' . theme_locals('warning_notice_1') . ' ' . theme_locals('warning_notice_3') . '</em></p>');
        }
        ?>
							</div>
							<?php 
        $themes_dir = get_theme_root();
        $themes = scandir($themes_dir);
        $themes_array = array();
        foreach ($themes as $theme) {
            if (is_dir("{$themes_dir}/{$theme}")) {
                if (strtolower(get_theme_info($theme, 'Template')) == 'cherryframework' && strtolower($theme) != 'cherryframework') {
                    array_push($themes_array, $theme);
                }
            }
        }
        if (count($themes_array) != 0) {
            ?>

							<div class="theme_box">
								<h4><?php 
            echo theme_locals("child_theme");
            ?>
</h4>
								<div class="controls child_theme">
									<div class="child_theme_title">
										<span class="select"> </span>
										<span class="child_preview"><?php 
            echo theme_locals("preview");
            ?>
</span>
										<span class="name"><?php 
            echo theme_locals("name");
            ?>
</span>
										<span class="date"><?php 
            echo theme_locals("backup_date");
            ?>
</span>
									</div>
									<div class="child_theme_list">
										<?php 
            $input_checked = true;
            foreach ($themes_array as $theme) {
                echo '<label>';
                echo '<span class="select">';
                add_radio_button($theme, "theme_name", $input_checked);
                if ($input_checked) {
                    $input_checked = false;
                }
                echo '</span>';
                echo '<span class="child_preview">';
                if (file_exists($themes_dir . "/{$theme}/screenshot.png")) {
                    echo '<img src="' . get_theme_root_uri() . "/{$theme}/screenshot.png" . '" alt="' . $theme . '">';
                }
                echo '</span>';
                echo '<span class="name">' . $theme . '</span>';
                echo '<span id="date_' . $theme . '" class="date">' . get_file_date($theme)->date . '</span>';
                echo '</label>';
                $not_child_theme = false;
            }
            ?>
									</div>
								</div>
								<?php 
            if (FILE_WRITEABLE) {
                ?>
								<div class="buttons_controls">
									<div class="button_wrapper">
										<a class="button-primary backup_theme" href="CherryFramework"  title="<?php 
                echo theme_locals('backup');
                ?>
"><?php 
                echo theme_locals("backup");
                ?>
</a>
									</div>
									<div class="button_wrapper">
										<a class="button-primary restore_theme" href="CherryFramework" title="<?php 
                echo theme_locals('restore');
                ?>
"><?php 
                echo theme_locals("restore");
                ?>
</a>
									</div>
									<div class="button_wrapper">
										<a class="button-primary download_backup" href="CherryFramework" title="<?php 
                echo theme_locals('download_backup');
                ?>
"><?php 
                echo theme_locals("download_backup");
                ?>
</a>
									</div>
								</div>
								<?php 
            } else {
                printf('<p><em>' . theme_locals('warning_notice_1') . ' ' . theme_locals('warning_notice_3') . '</em></p>');
            }
            ?>
							</div>
							<?php 
        }
        ?>
						</div>
					</div>
				</div>
			</div>
			<?php 
    }
Beispiel #9
0
<?php

$sub_menu = "100280";
include_once './_common.php';
if ($is_admin != 'super') {
    die('최고관리자만 접근 가능합니다.');
}
$theme = trim($_POST['theme']);
$theme_dir = get_theme_dir();
if (!in_array($theme, $theme_dir)) {
    die('선택하신 테마가 설치되어 있지 않습니다.');
}
$info = get_theme_info($theme);
if ($info['screenshot']) {
    $screenshot = '<img src="' . $info['screenshot'] . '" alt="' . $name . '">';
} else {
    $screenshot = '<img src="' . G5_ADMIN_URL . '/img/theme_img.jpg" alt="">';
}
$name = get_text($info['theme_name']);
if ($info['theme_uri']) {
    $name = '<a href="' . set_http($info['theme_uri']) . '" target="_blank" class="thdt_home">' . $name . '</a>';
}
$maker = get_text($info['maker']);
if ($info['maker_uri']) {
    $maker = '<a href="' . set_http($info['maker_uri']) . '" target="_blank" class="thdt_home">' . $maker . '</a>';
}
$license = get_text($info['license']);
if ($info['license_uri']) {
    $license = '<a href="' . set_http($info['license_uri']) . '" target="_blank" class="thdt_home">' . $license . '</a>';
}
?>
Beispiel #10
0
/**
 * Themes admin page
 *
 * @param App $a
 * @return string
 */
function admin_page_themes(&$a)
{
    $allowed_themes_str = get_config('system', 'allowed_themes');
    $allowed_themes_raw = explode(',', $allowed_themes_str);
    $allowed_themes = array();
    if (count($allowed_themes_raw)) {
        foreach ($allowed_themes_raw as $x) {
            if (strlen(trim($x))) {
                $allowed_themes[] = trim($x);
            }
        }
    }
    $themes = array();
    $files = glob('view/theme/*');
    /* */
    if ($files) {
        foreach ($files as $file) {
            $f = basename($file);
            $is_experimental = intval(file_exists($file . '/experimental'));
            $is_supported = 1 - intval(file_exists($file . '/unsupported'));
            $is_allowed = intval(in_array($f, $allowed_themes));
            if ($is_allowed or $is_supported or get_config("system", "show_unsupported_themes")) {
                $themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
            }
        }
    }
    if (!count($themes)) {
        notice(t('No themes found.'));
        return '';
    }
    /**
     * Single theme
     */
    if ($a->argc == 3) {
        $theme = $a->argv[2];
        if (!is_dir("view/theme/{$theme}")) {
            notice(t("Item not found."));
            return '';
        }
        if (x($_GET, "a") && $_GET['a'] == "t") {
            check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
            // Toggle theme status
            toggle_theme($themes, $theme, $result);
            $s = rebuild_theme_table($themes);
            if ($result) {
                install_theme($theme);
                info(sprintf('Theme %s enabled.', $theme));
            } else {
                uninstall_theme($theme);
                info(sprintf('Theme %s disabled.', $theme));
            }
            set_config('system', 'allowed_themes', $s);
            goaway($a->get_baseurl(true) . '/admin/themes');
            return '';
            // NOTREACHED
        }
        // display theme details
        require_once 'library/markdown.php';
        if (theme_status($themes, $theme)) {
            $status = "on";
            $action = t("Disable");
        } else {
            $status = "off";
            $action = t("Enable");
        }
        $readme = Null;
        if (is_file("view/theme/{$theme}/README.md")) {
            $readme = file_get_contents("view/theme/{$theme}/README.md");
            $readme = Markdown($readme);
        } else {
            if (is_file("view/theme/{$theme}/README")) {
                $readme = "<pre>" . file_get_contents("view/theme/{$theme}/README") . "</pre>";
            }
        }
        $admin_form = "";
        if (is_file("view/theme/{$theme}/config.php")) {
            function __get_theme_admin_form(&$a, $theme)
            {
                $orig_theme = $a->theme;
                $orig_page = $a->page;
                $orig_session_theme = $_SESSION['theme'];
                require_once "view/theme/{$theme}/theme.php";
                require_once "view/theme/{$theme}/config.php";
                $_SESSION['theme'] = $theme;
                $init = $theme . "_init";
                if (function_exists($init)) {
                    $init($a);
                }
                if (function_exists("theme_admin")) {
                    $admin_form = theme_admin($a);
                }
                $_SESSION['theme'] = $orig_session_theme;
                $a->theme = $orig_theme;
                $a->page = $orig_page;
                return $admin_form;
            }
            $admin_form = __get_theme_admin_form($a, $theme);
        }
        $screenshot = array(get_theme_screenshot($theme), t('Screenshot'));
        if (!stristr($screenshot[0], $theme)) {
            $screenshot = null;
        }
        $t = get_markup_template("admin_plugins_details.tpl");
        return replace_macros($t, array('$title' => t('Administration'), '$page' => t('Themes'), '$toggle' => t('Toggle'), '$settings' => t('Settings'), '$baseurl' => $a->get_baseurl(true), '$plugin' => $theme, '$status' => $status, '$action' => $action, '$info' => get_theme_info($theme), '$function' => 'themes', '$admin_form' => $admin_form, '$str_author' => t('Author: '), '$str_maintainer' => t('Maintainer: '), '$screenshot' => $screenshot, '$readme' => $readme, '$form_security_token' => get_form_security_token("admin_themes")));
    }
    // reload active themes
    if (x($_GET, "a") && $_GET['a'] == "r") {
        check_form_security_token_redirectOnErr($a->get_baseurl() . '/admin/themes', 'admin_themes', 't');
        if ($themes) {
            foreach ($themes as $th) {
                if ($th['allowed']) {
                    uninstall_theme($th['name']);
                    install_theme($th['name']);
                }
            }
        }
        info("Themes reloaded");
        goaway($a->get_baseurl() . '/admin/themes');
    }
    /**
     * List themes
     */
    $xthemes = array();
    if ($themes) {
        foreach ($themes as $th) {
            $xthemes[] = array($th['name'], $th['allowed'] ? "on" : "off", get_theme_info($th['name']));
        }
    }
    $t = get_markup_template("admin_plugins.tpl");
    return replace_macros($t, array('$title' => t('Administration'), '$page' => t('Themes'), '$submit' => t('Save Settings'), '$reload' => t('Reload active themes'), '$baseurl' => $a->get_baseurl(true), '$function' => 'themes', '$plugins' => $xthemes, '$experimental' => t('[Experimental]'), '$unsupported' => t('[Unsupported]'), '$form_security_token' => get_form_security_token("admin_themes")));
}
Beispiel #11
0
  if(count($data) == 0) {
    die(json_encode(set_error_arr("Invalid request")));
  }

  require_once('ml_header.php');

  switch ($data['action']) {
    case 'getAllThemesList':
      get_all_themes_list();
      break;
    case 'getAllThemes':
      get_all_themes();
      break;
    case 'getThemeInfo':
      get_theme_info();
      break;
    case 'saveThemeInfo':
      save_theme_info();
      break;
    case 'deleteTheme':
      delete_theme();
      break;
    case 'getAllCategoriesList':
      get_all_categories_list();
      break;
    case 'getCategoryInfo':
      get_category_info();
      break;
    case 'saveCategoryInfo':
      save_category_info();