Example #1
0
 function theme_config($args = array())
 {
     static $page_type;
     if (!isset($page_type)) {
         $page_type = $this->get(array('theme', 'type'));
     }
     if ($this->_check_args($args)) {
         $found = false;
         $config = array();
         if (is_array($args[0])) {
             $key = array_shift($args[0]);
             if (count($args[0]) == 0) {
                 array_shift($args);
             }
         } else {
             $key = array_shift($args);
         }
         if (!isset($this->_configs[$key])) {
             $path = OP_PAGES . $page_type . '/' . $key;
             $theme_url = OP_URL . 'pages/' . $page_type . '/' . $key . '/';
             if (file_exists($path . '/config.php')) {
                 op_textdomain(OP_SN . '_p_' . $key, $path . '/');
                 require_once $path . '/config.php';
                 $this->_configs[$key] = $config;
                 return _op_traverse_array($this->_configs[$key], $args);
             }
         } else {
             return _op_traverse_array($this->_configs[$key], $args);
         }
     }
     return false;
 }
Example #2
0
 function op_include_files()
 {
     require_once OP_FUNC . 'widgets.php';
     require_once OP_FUNC . 'options.php';
     require_once OP_FUNC . 'page_options.php';
     require_once OP_FUNC . 'general.php';
     require_once OP_FUNC . 'scripts.php';
     require_once OP_FUNC . 'assets.php';
     require_once OP_FUNC . 'fonts.php';
     require_once OP_FUNC . 'sl_api.php';
     op_textdomain();
     require_once OP_FUNC . 'templates.php';
     _op_assets();
     add_theme_support('automatic-feed-links');
     add_theme_support('post-thumbnails');
     if (is_admin()) {
         require_once OP_FUNC . 'admin.php';
         require_once OP_ADMIN . 'init.php';
     } else {
         op_register_scripts();
         do_action('op_pre_template_include');
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
         /*
          * DAP
          */
         if (is_plugin_active('DAP-WP-LiveLinks/DAP-WP-LiveLinks.php')) {
             add_filter('op_check_page_availability', 'dap_allowed_page');
         }
         /*
          * Fast Member
          */
         if (is_plugin_active('fastmember/fastmember.php')) {
             add_filter('op_check_page_availability', 'fast_member_allowed_page');
         }
         /*
          * iMember
          */
         if (class_exists('infusionWP')) {
             add_filter('op_check_page_availability', 'imember_allowed_page');
         }
         add_filter('template_include', 'op_template_include');
         do_action('op_setup');
         //op_localize_script('front');
     }
 }
Example #3
0
 function theme_config($args = array())
 {
     if (count($args) == 0) {
         return false;
     }
     $found = false;
     $config = array();
     if (is_array($args[0])) {
         $key = array_shift($args[0]);
         if (count($args[0]) == 0) {
             array_shift($args);
         }
     } else {
         $key = array_shift($args);
     }
     if (!isset($this->_configs[$key])) {
         $path = OP_THEMES . $key;
         $theme_url = OP_URL . 'themes/' . $key . '/';
         if (file_exists($path . '/config.php')) {
             op_textdomain(OP_SN . '_' . $key, $path . '/');
             require_once $path . '/config.php';
             $this->_configs[$key] = $config;
             return _op_traverse_array($this->_configs[$key], $args);
         }
     } else {
         return _op_traverse_array($this->_configs[$key], $args);
     }
     return false;
 }
Example #4
0
 function op_include_files()
 {
     require_once OP_FUNC . 'widgets.php';
     require_once OP_FUNC . 'options.php';
     require_once OP_FUNC . 'page_options.php';
     require_once OP_FUNC . 'general.php';
     require_once OP_FUNC . 'scripts.php';
     require_once OP_FUNC . 'assets.php';
     require_once OP_FUNC . 'fonts.php';
     require_once OP_FUNC . 'sl_api.php';
     op_textdomain();
     require_once OP_FUNC . 'templates.php';
     _op_assets();
     add_theme_support('automatic-feed-links');
     add_theme_support('post-thumbnails');
     if (is_admin()) {
         require_once OP_FUNC . 'admin.php';
         require_once OP_ADMIN . 'init.php';
     } else {
         do_action('op_pre_template_include');
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
         /*
          * DAP
          */
         if (is_plugin_active('DAP-WP-LiveLinks/DAP-WP-LiveLinks.php')) {
             add_filter('op_check_page_availability', 'dap_allowed_page');
         }
         /*
          * Fast Member
          */
         if (is_plugin_active('fastmember/fastmember.php')) {
             add_filter('op_check_page_availability', 'fast_member_allowed_page');
         }
         /*
          * iMember
          */
         if (class_exists('infusionWP')) {
             add_filter('op_check_page_availability', 'imember_allowed_page');
         }
         add_filter('template_include', 'op_template_include');
         /*
          * External plugins (WP e-commerce) are skiping the 'template_include' hook
          * and are instead loading theme "index.php" template which shows "Finish blog setup" screen
          * Added a checkbox in Dashboard -- Global settings -- external plugin compatibility
          * This works only if that checkbox is on! to deal with some issues
          */
         $val = op_get_option('op_other_plugins');
         if ('on' === $val) {
             add_filter('index_template', 'op_template_include');
         }
         do_action('op_setup');
         // op_localize_script('front');
     }
 }
Example #5
0
 /**
  * Returns the list of blank marketing templates
  * @return array
  */
 function get_marketing_templates()
 {
     $dirs = op_dir_list(OP_PAGES . 'marketing');
     // we are sorting them
     sort($dirs);
     foreach ($dirs as $key) {
         $path = OP_PAGES . 'marketing/' . $key;
         $theme_url = OP_URL . 'pages/marketing/' . $key . '/';
         if (file_exists($path . '/config.php')) {
             op_textdomain(OP_SN . '_p_' . $key, $path . '/');
             require_once $path . '/config.php';
             $blank_themes[] = array('name' => $config['name'], 'screenshot' => $theme_url . $config['screenshot'], 'screenshot_thumbnail' => $theme_url . $config['screenshot_thumbnail'], 'description' => $config['description'], 'dir' => $key);
         }
     }
     return $blank_themes;
 }
Example #6
0
 function op_include_files()
 {
     require_once OP_FUNC . 'widgets.php';
     require_once OP_FUNC . 'options.php';
     require_once OP_FUNC . 'page_options.php';
     require_once OP_FUNC . 'general.php';
     require_once OP_FUNC . 'scripts.php';
     require_once OP_FUNC . 'assets.php';
     require_once OP_FUNC . 'fonts.php';
     require_once OP_FUNC . 'sl_api.php';
     op_textdomain();
     require_once OP_FUNC . 'templates.php';
     _op_assets();
     add_theme_support('automatic-feed-links');
     add_theme_support('post-thumbnails');
     if (is_admin()) {
         require_once OP_FUNC . 'admin.php';
         require_once OP_ADMIN . 'init.php';
     } else {
         op_register_scripts();
         do_action('op_pre_tempate_include');
         add_filter('template_include', 'op_template_include');
         do_action('op_setup');
     }
 }
Example #7
0
function op_init_page_theme($load_modules = true)
{
    require_once OP_FUNC . 'page.php';
    op_page_file('functions');
    op_page_file('functions', array(), OP_PAGES . 'global/');
    $tpl_type = op_page_option('theme', 'type');
    $tpl_dir = op_page_option('theme', 'dir');
    if ($tpl_dir) {
        define('OP_PAGE_DIR', OP_PAGES . $tpl_type . '/' . $tpl_dir . '/');
        define('OP_PAGE_DIR_REL', '/pages/' . $tpl_type . '/' . $tpl_dir . '/');
        define('OP_PAGE_URL', OP_URL . 'pages/' . $tpl_type . '/' . $tpl_dir . '/');
        define('OP_P_SN', OP_SN . '_p_' . $tpl_dir);
        op_textdomain(OP_P_SN, OP_PAGE_DIR);
        require_once OP_FUNC . 'feature_area.php';
        $class = 'OptimizePress_Page_Feature_Area';
        if (file_exists(OP_PAGE_DIR . 'feature_area.php')) {
            require_once OP_PAGE_DIR . 'feature_area.php';
        } elseif (file_exists(OP_PAGES . 'global/feature_areas/' . $tpl_type . '.php')) {
            require_once OP_PAGES . 'global/feature_areas/' . $tpl_type . '.php';
        } else {
            $class = 'OptimizePress_Page_Feature_Area_Base';
        }
        $GLOBALS['op_feature_area'] = new $class();
    }
    if ($load_modules) {
        if (!(op_page_config('disable', 'functionality') === true)) {
            require_once OP_LIB . 'sections/page/functionality.php';
            $object = new OptimizePress_Sections_Functionality();
            $GLOBALS['functionality_sections'] = $object->sections();
            foreach ($GLOBALS['functionality_sections'] as $name => $section) {
                if (isset($section['module'])) {
                    op_mod($section['module'], op_get_var($section, 'module_type', 'blog'), array('section' => $name));
                }
            }
        }
        do_action('op_page_module_init');
    }
}