示例#1
0
/**
 * ADMIN SUBMENUS
 *
 * output admin submenus
 * @since 7.0
 */
function bizzthemes_add_submenus()
{
    global $themeid, $themename, $frameversion, $builder_hook, $frame_hook, $design_hook, $editor_hook, $license_hook, $tools_hook, $update_hook;
    // Re-define theme name
    if (isset($GLOBALS['opt']['bizzthemes_branding_back_name']['value']) && $GLOBALS['opt']['bizzthemes_branding_back_name']['value'] != '') {
        $themename = $GLOBALS['opt']['bizzthemes_branding_back_name']['value'];
    } else {
        $themename = $themename;
    }
    #default
    $theme_api = bizzthemes_license_api();
    $pending_license = !isset($theme_api) || $theme_api['valid'] != 'true' ? '!' : '';
    // theme version
    if (function_exists('wp_get_theme')) {
        $this_theme_data = wp_get_theme();
        $this_theme_version = $this_theme_data->Version;
    } else {
        $this_theme_data = get_theme_data(TEMPLATEPATH . '/style.css');
        $this_theme_version = $this_theme_data['Version'];
    }
    $remote_theme_version = get_transient('remote_t_version_' . $themeid);
    $this_theme_version = trim(str_replace('.', '', $this_theme_version));
    $remote_theme_version = trim(str_replace('.', '', $remote_theme_version));
    if (strlen($this_theme_version) == 2) {
        $this_theme_version = $this_theme_version . '0';
    }
    if (strlen($remote_theme_version) == 2) {
        $remote_theme_version = $remote_theme_version . '0';
    }
    // framework version
    $localversion = $frameversion;
    $remoteversion = get_transient('remote_f_version_' . $themeid);
    $fw_remote_changelog = 'http://www.bizzthemes.com/framework/changelog.txt';
    $localversion = trim(str_replace('.', '', $localversion));
    $remoteversion = trim(str_replace('.', '', $remoteversion));
    if (strlen($localversion) == 2) {
        $localversion = $localversion . '0';
    }
    if (strlen($remoteversion) == 2) {
        $remoteversion = $remoteversion . '0';
    }
    $pending_update = ($this_theme_version < $remote_theme_version || $localversion < $remoteversion) && $remote_theme_version != 'Currently Unavailable' ? '1' : '';
    $adminmenu_layout = isset($GLOBALS['opt']['bizzthemes_adminmenu_layout']['value']) ? $GLOBALS['opt']['bizzthemes_adminmenu_layout']['value'] : '';
    $adminmenu_design = isset($GLOBALS['opt']['bizzthemes_adminmenu_design']['value']) ? $GLOBALS['opt']['bizzthemes_adminmenu_design']['value'] : '';
    $adminmenu_license = isset($GLOBALS['opt']['bizzthemes_adminmenu_license']['value']) ? $GLOBALS['opt']['bizzthemes_adminmenu_license']['value'] : '';
    $adminmenu_editor = isset($GLOBALS['opt']['bizzthemes_adminmenu_editor']['value']) ? $GLOBALS['opt']['bizzthemes_adminmenu_editor']['value'] : '';
    $adminmenu_version = isset($GLOBALS['opt']['bizzthemes_adminmenu_version']['value']) ? $GLOBALS['opt']['bizzthemes_adminmenu_version']['value'] : '';
    $adminmenu_tools = isset($GLOBALS['opt']['bizzthemes_adminmenu_tools']['value']) ? $GLOBALS['opt']['bizzthemes_adminmenu_tools']['value'] : '';
    $menu_function = $adminmenu_layout != 'true' ? 'bizz-layout' : 'bizzthemes';
    if ($adminmenu_layout != 'true') {
        $builder_hook = add_submenu_page($menu_function, $themename, __('Builder', 'bizzthemes'), 'manage_options', 'bizz-layout', 'bizzthemes_layout');
    }
    $frame_hook = add_submenu_page($menu_function, $themename, __('Framework', 'bizzthemes'), 'manage_options', 'bizzthemes', 'bizzthemes_options');
    if ($adminmenu_design != 'true') {
        $design_hook = add_submenu_page($menu_function, $themename, __('Design', 'bizzthemes'), 'manage_options', 'bizz-design', 'bizzthemes_options');
    }
    if ($adminmenu_editor != 'true') {
        $editor_hook = add_submenu_page($menu_function, $themename, __('Editor', 'bizzthemes'), 'manage_options', 'bizz-editor', array('bizz_custom_editor', 'bizzthemes_editor'));
    }
    if ($adminmenu_license != 'true' && (isset($_GET['page']) && $_GET['page'] == 'bizz-license' || $pending_license != '')) {
        $license_hook = add_submenu_page($menu_function, $themename, sprintf(__('License<span id="awaiting-mod" class="update-plugins"><span class="pending-count update-count">%s</span></span>', 'bizzthemes'), $pending_license), 'manage_options', 'bizz-license', 'bizzthemes_license_page');
    }
    if ($adminmenu_tools != 'true' && isset($_GET['page']) && $_GET['page'] == 'bizz-tools') {
        $tools_hook = add_submenu_page($menu_function, $themename, __('Backup', 'bizzthemes'), 'manage_options', 'bizz-tools', array('bizz_custom_tools', 'bizzthemes_tools'));
    }
    if ($adminmenu_version != 'true' && (isset($_GET['page']) && $_GET['page'] == 'bizz-update' || $pending_update != '') && !is_child_theme()) {
        $update_hook = add_submenu_page($menu_function, $themename, sprintf(__('Update<span id="awaiting-mod" class="update-plugins"><span class="pending-count update-count">%s</span></span>', 'bizzthemes'), $pending_update), 'manage_options', 'bizz-update', 'bizzthemes_framework_update_page');
    }
}
示例#2
0
function bizz_license_package()
{
    global $themeid, $bizz_package;
    $theme_api = bizzthemes_license_api();
    if (isset($theme_api) && isset($theme_api['package']) && $theme_api['valid'] == 'true' && $theme_api['themeid'] == $themeid) {
        if ($theme_api['package'] == 'standard') {
            $bizz_package = 'c3RhbmRhcmQ=';
        } elseif ($theme_api['package'] == 'agency') {
            $bizz_package = 'YWdlbmN5';
        } elseif ($theme_api['package'] == 'club') {
            $bizz_package = 'Y2x1Yg==';
        } else {
            $bizz_package = 'other';
        }
    } else {
        $bizz_package = 'ZnJlZQ==';
    }
}