Esempio n. 1
0
/**
 * Create and display plugin help tab content: Plugin Info/ Usage etc..
 *
 * @since  1.0.0
 *
 * @uses   ddw_gle_core_sidebars_exists()
 *
 * @param  $gle_help_usage
 *
 * @return string/HTML of help tab content.
 */
function ddw_gle_help_content_usage()
{
    echo '<h4>' . __('Section and Template based layout changing', 'genesis-layout-extras') . ':</h4>' . '<p><blockquote>' . __('This plugin for the Genesis Theme Framework allows modifying of default layouts for homepage, singular, archive, attachment, search and 404 pages via its options page under the Genesis menu.', 'genesis-layout-extras') . ' ' . sprintf(__('In addition you can also modify the default layout option for pages generated by various popular plugins - if installend - among these are: %1$s forum plugin, %2$s plugin, %3$s and %4$s.', 'genesis-layout-extras'), 'bbPress 2.x', 'AgentPress Listings', 'WooCommerce, Jigoshop, Easy Digital Downloads', 'Sugar Events Calendar') . '</blockquote></p>';
    if (ddw_gle_core_sidebars_exists('sidebar')) {
        echo '<h4>' . __('Registering additional layouts', 'genesis-layout-extras') . ':</h4>' . '<p><blockquote>' . sprintf(__('Since version 2.0.0 of this plugin you can also register up to six (6!) additional alternate layout options. All of these make use of the %s and most also of the %s. So make sure both are registered with your child theme.', 'genesis-layout-extras'), '<em>' . __('Secondary Sidebar (Sidebar-Alt)', 'genesis-layout-extras') . '</em>', '<em>' . __('Primary Sidebar', 'genesis-layout-extras') . '</em>') . '</blockquote></p>';
    }
    // end if
}
Esempio n. 2
0
/**
 * Register additional layout options for Genesis Child Themes.
 *
 * @since  2.0.0
 *
 * @uses   ddw_gle_core_sidebars_exists()
 * @uses   genesis_get_option()
 * @uses   genesis_register_layout()
 */
function ddw_gle_register_additional_layouts()
{
    /** Register additional layouts if 'Sidebar-Alt' exists (is registered) */
    if (ddw_gle_core_sidebars_exists('sidebar')) {
        /**
         * a) special:
         */
        /** Layout: Sidebars below Content (SBC) (like a special "Full-Width-Content" flavor :) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_sbc', GLE_SETTINGS_FIELD) && !defined('GPEX_PLUGIN_BASEDIR')) {
            genesis_register_layout('sidebars-below-content', array('label' => __('Sidebars below Content', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_sidebars_below_content', esc_url(plugins_url('images/gle_sbc.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /** Layout: Primary below Content (PBC) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_pbc', GLE_SETTINGS_FIELD)) {
            genesis_register_layout('primary-below-content', array('label' => __('Primary below Content', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_primary_below_content', esc_url(plugins_url('images/gle_pbc.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /** Layout: Primary above Content (PAC) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_pac', GLE_SETTINGS_FIELD)) {
            genesis_register_layout('primary-above-content', array('label' => __('Primary above Content', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_primary_above_content', esc_url(plugins_url('images/gle_pac.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /** Layout: Header+Nav/Content/Sidebar (HNCS) */
        if (!GLE_NO_HNCS_LAYOUT_OPTION && (function_exists('genesis_get_option') && genesis_get_option('gle_layout_hncs', GLE_SETTINGS_FIELD))) {
            genesis_register_layout('headernav-content-sidebar', array('label' => __('Header+Nav/Content/Sidebar', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_headernav_content_sidebar', esc_url(plugins_url('images/gle_hncs.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /**
         * b) 2-column:
         */
        /** Layout: Content/Sidebar-Alt (CSA) (like a special "Content-Sidebar" flavor :) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_c_salt', GLE_SETTINGS_FIELD) && !defined('GPEX_PLUGIN_BASEDIR')) {
            genesis_register_layout('content-sidebaralt', array('label' => __('Content/Sidebar-Alt', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_content_sidebaralt', esc_url(plugins_url('images/gle_c-salt.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /** Layout: Sidebar-Alt/Content (SAC) (like a special "Sidebar-Content" flavor :) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_salt_c', GLE_SETTINGS_FIELD) && !defined('GPEX_PLUGIN_BASEDIR')) {
            genesis_register_layout('sidebaralt-content', array('label' => __('Sidebar-Alt/Content', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_sidebaralt_content', esc_url(plugins_url('images/gle_salt-c.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /**
         * c) 3-column:
         */
        /** Layout: Content/Sidebar-Alt/Sidebar (CSAS) (like a special "Content-Sidebar-Sidebar" flavor :) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_c_salt_s', GLE_SETTINGS_FIELD)) {
            genesis_register_layout('content-sidebaralt-sidebar', array('label' => __('Content/Sidebar-Alt/Sidebar', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_content_sidebaralt_sidebar', esc_url(plugins_url('images/gle_c-salt-s.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /** Layout: Sidebar/Sidebar-Alt/Content (SSAC) (like a special "Sidebar-Sidebar-Content" flavor :) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_s_salt_c', GLE_SETTINGS_FIELD)) {
            genesis_register_layout('sidebar-sidebaralt-content', array('label' => __('Sidebar/Sidebar-Alt/Content', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_sidebar_sidebaralt_content', esc_url(plugins_url('images/gle_s-salt-c.gif', dirname(__FILE__))))));
        }
        // end-if settings check
        /** Layout: Sidebar/Content/Sidebar-Alt (SCSA) (like a special "Sidebar-Content-Sidebar" flavor :) */
        if (function_exists('genesis_get_option') && genesis_get_option('gle_layout_s_c_salt', GLE_SETTINGS_FIELD)) {
            genesis_register_layout('sidebar-content-sidebaralt', array('label' => __('Sidebar/Content/Sidebar-Alt', 'genesis-layout-extras'), 'img' => apply_filters('gle_filter_layout_image_sidebar_content_sidebaralt', esc_url(plugins_url('images/gle_s-c-salt.gif', dirname(__FILE__))))));
        }
        // end-if settings check
    }
    // end if 'Sidebar Alt' check
}
Esempio n. 3
0
 /**
  * Set up the Help Tab system.
  *
  * @since 2.0.0
  *
  * @uses  callback functions located in theme file
  *        '/includes/gle-admin-help.php' with the actual help tab content
  * @uses  get_current_screen()
  * @uses  WP_Screen::add_help_tab()
  * @uses  WP_Screen::set_help_sidebar()
  * @uses  ddw_gle_help_sidebar_content()
  * @uses  ddw_gle_help_sidebar_content_extra()
  */
 function help()
 {
     /** Get current screen */
     $screen = get_current_screen();
     /** Display help tabs only for WordPress 3.3 or higher */
     if (!class_exists('WP_Screen') || !$screen) {
         return;
     }
     /** Add starting/general help tab */
     $screen->add_help_tab(array('id' => 'gle-plugin-start-help', 'title' => __('Genesis Layout Extras', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_content_plugin_start', 'ddw_gle_plugin_start_help')));
     /** Add Layout Extras help tab */
     if (ddw_gle_core_sidebars_exists('sidebar')) {
         $screen->add_help_tab(array('id' => 'gle-layout-extras-help', 'title' => __('Layouts', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_content_layout_extras', 'ddw_gle_help_content_layout_extras')));
     }
     // end if
     /** Add Post Type Support help tab */
     if (ddw_gle_check_cpts()) {
         $screen->add_help_tab(array('id' => 'gle-post-type-support-help', 'title' => _x('Additional Post Type Support', 'Translators: Help tab menu title', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_content_post_type_support', 'ddw_gle_help_content_post_type_support')));
     }
     // end if
     /** Help tab only if supported plugins active */
     if (ddw_gle_supported_plugins()) {
         /** Add Plugin Support help tab */
         $screen->add_help_tab(array('id' => 'gle-plugin-support-help', 'title' => __('Plugin Support', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_content_plugins', 'ddw_gle_admin_help_plugins')));
         require_once GLE_PLUGIN_DIR . '/includes/gle-admin-help-plugins.php';
     }
     // end-if plugins check
     /**
      * Help tab only if supported child themes are active
      */
     /** Function slug part - variable init */
     $gle_child_theme_help = 'default';
     /** By StudioPress */
     if ((function_exists('minimum_portfolio_post_type') || function_exists('executive_portfolio_post_type')) && post_type_exists('portfolio')) {
         /** StudioPress function slug part */
         $gle_child_theme_help = 'studiopress';
         require_once GLE_PLUGIN_DIR . '/includes/gle-admin-help-' . $gle_child_theme_help . '.php';
     }
     /** By Themedy brand */
     if (ddw_gle_supported_themedy() && (post_type_exists('products') || post_type_exists('photo'))) {
         /** Themedy function slug part */
         $gle_child_theme_help = 'themedy';
         require_once GLE_PLUGIN_DIR . '/includes/gle-admin-help-' . $gle_child_theme_help . '.php';
     }
     // end-if child theme themedy check
     /** By ZigZagPress brand */
     if (ddw_gle_supported_zigzagpress()) {
         /** ZigZagPress function slug part */
         $gle_child_theme_help = 'zigzagpress';
         require_once GLE_PLUGIN_DIR . '/includes/gle-admin-help-' . $gle_child_theme_help . '.php';
     }
     // end-if child theme zigzagpress check
     /** Add the help tab */
     if ('studiopress' == $gle_child_theme_help || 'themedy' == $gle_child_theme_help || 'zigzagpress' == $gle_child_theme_help) {
         require_once GLE_PLUGIN_DIR . '/includes/gle-admin-help-' . $gle_child_theme_help . '.php';
         $screen->add_help_tab(array('id' => 'gle-child-theme-support', 'title' => __('Child Theme Support', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_' . $gle_child_theme_help . '', 'ddw_gle_admin_help_' . $gle_child_theme_help . '')));
     }
     // end-if child support check
     /** Add FAQ help tab */
     $screen->add_help_tab(array('id' => 'gle-faq-help', 'title' => __('FAQ - Frequently Asked Questions', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_content_faq', 'ddw_gle_help_content_faq')));
     /** Add Translations help tab */
     $screen->add_help_tab(array('id' => 'gle-plugin-translations-help', 'title' => __('Translations', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_content_translations', 'ddw_gle_help_content_translations')));
     /** Add Recommended Plugins help tab */
     $screen->add_help_tab(array('id' => 'gle-recommended-plugins-help', 'title' => __('Recommended Plugins', 'genesis-layout-extras'), 'callback' => apply_filters('gle_filter_help_content_recommended_plugins', 'ddw_gle_help_content_recommended_plugins')));
     /** Add help sidebar */
     $screen->set_help_sidebar(ddw_gle_help_sidebar_content_extra() . ddw_gle_help_sidebar_content());
 }