Ejemplo n.º 1
0
/**
 * Load the text domain for translation of the plugin.
 * Load admin helper functions - only within 'wp-admin'.
 * 
 * @since 1.0.0
 *
 * @param string $gtbe_wp_lang_dir
 * @param string $gtbe_lang_dir
 */
function ddw_gtbe_init()
{
    /** Set filter for WordPress languages directory */
    $gtbe_wp_lang_dir = GTBE_PLUGIN_BASEDIR . '/../../languages/genesis-toolbar-extras/';
    $gtbe_wp_lang_dir = apply_filters('gtbe_filter_wp_lang_dir', $gtbe_wp_lang_dir);
    /** Set filter for plugin's languages directory */
    $gtbe_lang_dir = GTBE_PLUGIN_BASEDIR . '/languages/';
    $gtbe_lang_dir = apply_filters('gtbe_filter_lang_dir', $gtbe_lang_dir);
    /** First look in WordPress' "languages" folder = custom & update-secure! */
    load_plugin_textdomain('genesis-toolbar-extras', false, $gtbe_wp_lang_dir);
    /** Then look in plugin's "languages" folder = default */
    load_plugin_textdomain('genesis-toolbar-extras', false, $gtbe_lang_dir);
    /** Include admin helper functions */
    if (is_admin()) {
        require_once GTBE_PLUGIN_DIR . '/includes/gtbe-admin.php';
        if (basename(get_template_directory()) == 'genesis') {
            require_once GTBE_PLUGIN_DIR . '/includes/gtbe-file-menus.php';
            if (!class_exists('Genesis_Admin_Readme')) {
                global $gtbe_admin_readme;
                $gtbe_admin_readme = new DDW_GTBE_Admin_Readme();
            }
            if (file_exists(ddw_gtbe_filter_url_child_changelog())) {
                global $gtbe_admin_changelog;
                $gtbe_admin_changelog = new DDW_GTBE_Admin_Changelog();
            }
        }
        // end-if Genesis check
    }
    // end-if is_admin check
    /** Define constants and set defaults for removing all or certain sections */
    if (!defined('GTBE_DISPLAY')) {
        define('GTBE_DISPLAY', TRUE);
    }
    if (!defined('GTBE_RESOURCES_DISPLAY')) {
        define('GTBE_RESOURCES_DISPLAY', TRUE);
    }
    if (!defined('GTBE_CHILD_THEME_DISPLAY')) {
        define('GTBE_CHILD_THEME_DISPLAY', TRUE);
    }
    if (!defined('GTBE_EXTENSIONS_DISPLAY')) {
        define('GTBE_EXTENSIONS_DISPLAY', TRUE);
    }
    if (!defined('GTBE_MANAGE_CONTENT_DISPLAY')) {
        define('GTBE_MANAGE_CONTENT_DISPLAY', TRUE);
    }
    if (!defined('GTBE_DE_DISPLAY')) {
        define('GTBE_DE_DISPLAY', TRUE);
    }
    if (!defined('GTBE_TRANSLATIONS_DISPLAY')) {
        define('GTBE_TRANSLATIONS_DISPLAY', TRUE);
    }
    if (!defined('GTBE_MYSP_DISPLAY')) {
        define('GTBE_MYSP_DISPLAY', TRUE);
    }
    if (!defined('GTBE_OLDFORUMS_DISPLAY')) {
        define('GTBE_OLDFORUMS_DISPLAY', TRUE);
    }
}
Ejemplo n.º 2
0
 if (!(defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT) && !function_exists('dynamik_theme_settings') && current_user_can('edit_themes') && current_theme_supports('gtbe-theme-editor')) {
     /** Include plugin file with seo plugin support links */
     require_once GTBE_PLUGIN_DIR . '/includes/gtbe-editfiles.php';
 }
 // end-if theme editor check
 /** Hook: tpchild_theme_before_readme */
 do_action('gtbe_tpchild_before_readme');
 /** Display Readme.txt Child Theme Info */
 if (class_exists('Genesis_Admin_Readme') && file_exists(ddw_gtbe_filter_url_child_readme())) {
     $menu_items['tpchild-readme'] = array('parent' => $tpchild, 'title' => __('README Info', 'genesis-toolbar-extras'), 'href' => admin_url('admin.php?page=genesis-readme'), 'meta' => array('target' => '', 'title' => __('README Info', 'genesis-toolbar-extras')));
 } elseif (class_exists('DDW_GTBE_Admin_Readme') && file_exists(ddw_gtbe_filter_url_child_readme())) {
     $menu_items['tpchild-readme'] = array('parent' => $tpchild, 'title' => __('README Info', 'genesis-toolbar-extras'), 'href' => admin_url('admin.php?page=gtbe-readme'), 'meta' => array('target' => '', 'title' => __('README Info', 'genesis-toolbar-extras')));
 }
 // end-if readme check
 /** Display changelog.txt Child Theme Info */
 if (class_exists('DDW_GTBE_Admin_Changelog') && file_exists(ddw_gtbe_filter_url_child_changelog())) {
     $menu_items['tpchild-changelog'] = array('parent' => $tpchild, 'title' => __('Changelog Info', 'genesis-toolbar-extras'), 'href' => admin_url('admin.php?page=gtbe-changelog'), 'meta' => array('target' => '', 'title' => __('Changelog Info', 'genesis-toolbar-extras')));
 }
 // end-if changelog check
 /** Hook: tpchild_theme_before_support */
 do_action('gtbe_tpchild_before_support');
 /** Child Theme Support */
 if ($tpchild_is_support == 'tpsupport_yes') {
     $menu_items['tpchild-support'] = array('parent' => $tpchild, 'title' => apply_filters('gtbe_filter_theme_support_title', __('Support Site', 'genesis-toolbar-extras')), 'href' => esc_url_raw(apply_filters('gtbe_filter_theme_support_url', $tpchild_support)), 'meta' => array('title' => apply_filters('gtbe_filter_theme_support_tooltip', _x('Support Site/Info for Child Theme', 'Translators: For the tooltip', 'genesis-toolbar-extras'))));
 }
 // end-if child support check
 /** Hook: tpchild_theme_before_codex */
 do_action('gtbe_tpchild_before_codex');
 /** Child Theme Codex */
 if ($tpchild_is_codex == 'tpcodex_yes') {
     $menu_items['tpchild-codex'] = array('parent' => $tpchild, 'title' => apply_filters('gtbe_filter_theme_docs_title', __('Knowledge Base', 'genesis-toolbar-extras')), 'href' => esc_url_raw(apply_filters('gtbe_filter_theme_docs_url', $tpchild_codex)), 'meta' => array('title' => apply_filters('gtbe_filter_theme_docs_tooltip', _x('Documentation/ Knowledge Base for Child Theme', 'Translators: For the tooltip', 'genesis-toolbar-extras'))));
Ejemplo n.º 3
0
    /**
     * Callback for displaying the Changelog admin page.
     *
     * Checks if the file contents are readable, and echoes out HTML.
     *
     * @since 1.3.0
     */
    public function admin()
    {
        /** Assume we cannot find the file */
        $changelog_file = false;
        /** Get the file contents */
        $changelog_file = @file_get_contents(ddw_gtbe_filter_url_child_changelog());
        /** If we can't find file contents, show a message */
        if (!$changelog_file || empty($changelog_file)) {
            $changelog_file = '<div class="error"><p>' . sprintf(__('The %s file was not found in the child theme, or it was empty.', 'genesis-toolbar-extras'), '<code>changelog.txt</code>') . '</p></div>';
        }
        ?>
		<div id="genesis-changelog-file" class="wrap">
			<?php 
        screen_icon('edit-pages');
        ?>
			<h2><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h2>
			<code><?php 
        echo wpautop($changelog_file);
        ?>
</code>
		</div>
		<?php 
    }