function theme_tab()
 {
     if (($dirs = op_dir_list(OP_THEMES)) === false) {
         return op_show_error(__('No themes were found. Please check the themes directory is present and contains themes.', 'optimizepress'));
     }
     $themes = array();
     foreach ($dirs as $d) {
         if (($conf = op_load_theme_config($d)) !== false) {
             $themes[] = array('name' => $conf['name'], 'screenshot' => $conf['screenshot'], 'screenshot_thumbnail' => $conf['screenshot_thumbnail'], 'description' => $conf['description'], 'dir' => $d);
         }
     }
     usort($themes, 'op_sort_theme_array');
     return op_tpl('theme_settings/themes', array('themes' => $themes));
 }
Beispiel #2
0
 function step_3()
 {
     $presets = $preset_options = array();
     $this->js['product_message'] = __('Please provide a name for your product', OP_SN);
     $type = op_page_option('theme', 'type');
     $membership = $type == 'membership';
     op_tpl_assign('page_type', $type);
     if (($dirs = op_dir_list(OP_PAGES . $type)) === false) {
         return op_show_error(__('No themes were found. Please check the themes directory is present and contains themes.', OP_SN));
     }
     $themes = $js_options = $landing_themes = array();
     foreach ($dirs as $d) {
         if (($conf = op_load_page_config($d)) !== false) {
             $themes[] = array('name' => $conf['name'], 'screenshot' => $conf['screenshot'], 'screenshot_thumbnail' => $conf['screenshot_thumbnail'], 'description' => $conf['description'], 'dir' => $d);
             if ($membership) {
                 $js_options[$d] = isset($conf['membership_type']) ? $conf['membership_type'] : 'content';
             } elseif ($type == 'landing') {
                 if (isset($conf['feature_areas'])) {
                     $landing_themes[$d] = $conf['feature_areas'];
                 }
             }
         }
     }
     usort($themes, 'op_sort_theme_array');
     if ($membership) {
         $presets = array('blank' => __('Blank Page', OP_SN), 'sidebar' => __('Page with sidebar', OP_SN), 'module_listing' => __('Module listings', OP_SN));
         $product_id = $category_id = $subcategory_id = 0;
         if ($product = op_page_option('membership')) {
             $product_id = op_get_var($product, 'product_id', 0);
             $category_id = op_get_var($product, 'category_id', 0);
             $subcategory_id = op_get_var($product, 'subcategory_id', 0);
         }
         op_tpl_assign(array('product_select' => $this->_select_html('product', $product_id), 'category_select' => $this->_select_html('category', 0, $product_id), 'subcategory_select' => $this->_select_html('subcategory', 0, $category_id)));
         $this->js['membership_types'] = $js_options;
         $blankimg = 'pb_page_blank.png';
         $selected = 'blank';
         $preset_options = array();
         $default = array('width' => 206, 'height' => 147);
         foreach ($presets as $name => $title) {
             $li_class = $input_attr = '';
             if ($selected == $name) {
                 $input_attr = ' checked="checked"';
                 $li_class = 'img-radio-selected';
             }
             $preset_options[] = array_merge($default, array('input' => '<input type="radio" name="op[page][preset_option]" value="' . $name . '"' . $input_attr . ' />', 'image' => OP_IMG . 'page_types/' . $blankimg, 'preview_content' => $title, 'li_class' => $li_class));
         }
     }
     return op_tpl('page_builder/step3', array('themes' => $themes, 'landing_themes' => $landing_themes, 'presets' => $presets, 'preset_options' => $preset_options));
 }
 /**
  * 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;
 }