function page_template($post) { $id = 'op_page_tpl_'; $cur_tpl = get_post_meta($post->ID, '_op_page_template', true); wp_nonce_field('op_page_template', 'op_page_template'); if ($cur_tpl == '') { $cur_tpl = op_default_attr('column_layout', 'option'); } $previews = array(); foreach ($this->tpls as $name => $tpl) { $li_class = $input_attr = $image = ''; $width = 152; $height = 115; if (is_array($tpl)) { extract($tpl); } if ($cur_tpl == $name) { $li_class = 'img-radio-selected'; $input_attr = ' checked="checked"'; } $preview = array('width' => $width, 'height' => $height, 'li_class' => $li_class, 'input' => '<input type="radio" id="op_page_tpl_file_' . $name . '" name="op_page_tpl_file" value="' . $name . '"' . $input_attr . ' />', 'image' => empty($image) ? OP_IMG . $name . '.jpg' : $image); $previews[] = $preview; } echo ' <div id="op-meta-page-template"> <h4>' . __('Page Template Options', OP_SN) . '</h4><p class="op-micro-copy">' . __('Select the template style for your page/post', OP_SN) . op_tpl('generic/img_radio_selector', array('previews' => $previews)) . ' </div>'; }
/** * Show support page with its sectinos * * Load "support/index" template * @return void */ public function displayPage() { $tabs = $tabContent = array(); foreach ($this->sections as $key => $section) { $tabs[$key] = array('title' => $section['title'], 'prefix' => '', 'li_class' => op_has_section_error($key) ? 'has-error' : ''); $tabContent[$key] = op_tpl('support/step', array('section_type' => $key, 'sections' => $section['object']->sections())); } $data = array('tabs' => $tabs, 'tab_content' => $tabContent, 'module_name' => 'support', 'error' => $this->error, 'notification' => $this->notification); echo op_tpl('support/index', array('content' => op_tpl('generic/tabbed_module', $data))); }
function install_screen() { //If we can't get the API key we must inform the user if (false === op_sl_get_key()) { $this->error = __('API key missing or invalid', OP_SN); } //Set the data array for the template $data = array('error' => $this->error, 'notification' => $this->notification); //Load the template echo op_tpl('install/index', $data); }
function dashboard() { //Create an image $img = op_img('', true); //Init the tabs and content arrays $tabs = array(); $tab_content = array(); //Loop through each section foreach ($this->sections as $name => $section) { //Init tab info such as title of the tab $tabs[$name] = array('title' => $section['title'], 'prefix' => ''); //Get tab content $tab_content[$name] = op_tpl('dashboard/step', array('section_type' => $name, 'sections' => $section['object']->sections())); //Set the li class if the section has an error $tabs[$name]['li_class'] = op_has_section_error($name) ? 'has-error' : ''; } //Create the data array for use in template $data = array('tabs' => $tabs, 'tab_content' => $tab_content, 'module_name' => 'dashboard', 'error' => $this->error, 'notification' => $this->notification); //Echo out the template echo op_tpl('dashboard/index', array('content' => op_tpl('generic/tabbed_module', $data))); }
<?php global $post; ?> <div id="op-le-editor-separator" class="cf"></div> <div class="op-hidden"><?php echo $content_layouts_dialog . $presets_dialog . op_tpl('live_editor/row_select') . op_tpl('live_editor/row_options') . op_tpl('live_editor/advanced_element') . op_tpl('live_editor/split_column') . op_tpl('live_editor/membership') . op_tpl('live_editor/typography') . op_tpl('live_editor/settings') . op_tpl('live_editor/help') . op_tpl('live_editor/elements') . op_tpl('live_editor/colours') . op_tpl('live_editor/headers') . $GLOBALS['op_feature_area_dialogs']; ?> </div> <?php echo op_tpl('live_editor/epicbox'); ?> <!-- LiveEditor Header Toolbar--> <div id="op-le-settings-toolbar" class="op-le-settings-toolbar--sidebar"> <div id="op-le-settings-toolbar-container" class="op-le-settings-toolbar-container"> <div class="container"> <img src="<?php echo OP_IMG; ?> logo-liveeditor.png" alt="LiveEditor" class="op-logo animated flipInY" /> <div class="links"><ul> <li onmouseover="this.getElementsByTagName('img')[0].src='<?php echo OP_IMG; ?> live_editor/le_layouts_icon.png'" onmouseout="this.getElementsByTagName('img')[0].src='<?php echo OP_IMG; ?> live_editor/le_layouts_bg.png'" ><a href="#le-headers-dialog"><img src="<?php echo OP_IMG; ?> live_editor/le_layouts_bg.png" alt="<?php
function op_load_section($tpl, $data = array(), $type = 'blog') { if (is_string($data) && $type == 'blog') { $type = $data; $data = array(); } return op_tpl('sections/' . $type . '/' . $tpl, $data); }
function step_4() { op_tpl_assign('nav_menus', wp_get_nav_menus()); $img = op_img('', true); $tabs = array(); $tab_content = array(); if (is_array($this->sections) || is_object($this->sections)) { foreach ($this->sections as $name => $section) { $tabs[$name] = array('title' => $section['title']); $tab_content[$name] = op_tpl('page_builder/step', array('section_type' => $name, 'sections' => $name == 'functionality' ? $GLOBALS['functionality_sections'] : $section['object']->sections(), 'title' => $section['title'], 'description' => $section['description'])); if (op_has_section_error($name)) { $tabs[$name]['li_class'] = 'has-error'; } } } $data = array('tabs' => $tabs, 'tab_content' => $tab_content, 'module_name' => 'page_builder', 'error' => $this->error, 'notification' => $this->notification); return op_tpl('page_builder/step4', array('content' => op_tpl('generic/tabbed_module', $data))); }
function load_content_layouts_preset_dialogs() { $data = array(); $data['content_layouts'] = $this->load_content_layouts(); $cats = $this->_get_content_layout_category_drop(); $data['content_layout_category_count'] = $cats[0]; $data['content_layout_category_select'] = '<select name="export_layout_category" id="export_layout_category">' . $cats[1] . '</select>'; $presets = $this->_get_presets_drop(); $data['preset_select'] = '<select name="preset_save" id="preset_save">' . $presets . '</select>'; return array(op_tpl('live_editor/layouts', $data), op_tpl('live_editor/presets', $data)); }
?> </a></li> </ul> </div> <div class="op-info-box"> <div class="op-hiddens" id="upload_new_layout_container"> <iframe class="op-iframe-full" src="<?php menu_page_url(OP_SN . '-page-builder'); ?> &section=content_upload&info_box=yes" width="700" height="160"></iframe> </div> </div> <?php echo op_tpl('create_new_page/content_templates', $data); ?> <a class="op-back-to-top" id="op-js-back-to-top" href="#">Back to Top</a> </div> <!-- end .op-bsw-main-content --> <div class="op-bsw-grey-panel-fixed"> <?php if (isset($content)) { echo $content; } ?> </div> </div>
function create_new_page_ajax() { $data = $this->get_content_templates_data(); // Echo out the template echo op_tpl('create_new_page/content_templates', $data); die; }
function _op_ajax_get_page_revisions() { global $revisions_page_id; if ($_POST['page_id'] != '') { $revisions_page_id = $_POST['page_id']; } echo op_tpl('live_editor/revisions'); exit; }
</p> <a href="#op-revisions-dialog" id="op-revisions-button" data-post_id="<?php echo $post->ID; ?> "><?php _e('Launch Now', OP_SN); ?> </a> </div> </li> </ul> <?php global $post; global $revisions_page_id; $revisions_page_id = $post->ID; echo op_tpl('live_editor/revisions'); ?> </div> </div> </div> <?php } else { ?> <div id="op-settings-container" class="meta-box-sortables" style="display:none"> <div class="postbox" id="op-post-settings-tab"> <h3 class="hndle"><span><?php echo __('OptimizePress Settings', OP_SN); ?> </span></h3> <div class="inside"> <?php
function _page_section($type, $title, $data) { $content = op_tpl('generic/tabbed_module', $data); $data = array('content' => $content, 'title' => $title, 'page_type' => $type); return op_tpl('launch_suite/pages/section', $data); }
<div class="op-hidden" id="upload_new_layout_container"> <a href="#load" id="view_layouts"><?php _e('View Uploaded Templates', 'optimizepress'); ?> </a> <div class="op-info-box"> <iframe src="<?php menu_page_url(OP_SN . '-page-builder', true); ?> &section=content_upload&info_box=yes" width="700" height="170"></iframe> </div> </div> <div id="content_layout_container"> <a href="#upload" id="upload_new_layout"><?php _e('Upload Content Template', 'optimizepress'); ?> </a> <div id="content_layout_container_list"> <?php if (isset($content_layouts)) { echo $content_layouts; } ?> </div> <?php echo defined('OP_PAGEBUILDER_ID') ? op_tpl('live_editor/layouts/keep_options') : ''; ?> </div> </div> <?php echo $this->load_tpl('page_builder/footer');
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)); }
function hub_page() { echo op_tpl('hub/index'); }
function step() { return op_tpl('wizard/step', array('sections' => $this->sections->sections())); }
<div class="op-bsw-grey-panel-content op-bsw-grey-panel-no-sidebar cf" id="op_page_content_layout_layouts"> <h3><?php _e('Choose from our pre-made content layouts', OP_SN); ?> </h3> <p class="op-micro-copy"><?php _e('Select from the content layouts below for your main page content. These pre-made layouts help you display your content effectively - just replace our sample content, images and video with your own content', OP_SN); ?> </p> <?php if (isset($previews)) { echo op_tpl('generic/img_radio_selector', array('classextra' => 'content-layouts')); } else { echo '<h2>' . __('No content layouts found') . '</h2>'; } /* if(isset($layout_list)){ echo ' <ul class="layout-list">'.$layout_list.'</ul>'; } else { echo '<h2>'.__('No content layouts found').'</h2>'; }*/ //echo $this->load_tpl('generic/img_radio_selector',array('previews'=>$previews, 'classextra'=>'content_layout')); $checked = ' checked="checked"'; if ($has_layout) { $checked = ''; ?> <p class="blank-info"><?php _e('Keep your current layout', OP_SN); ?> </p>
</div> <div class="op-bsw-main-content op-pb-footer"> <div class="op-pb-fixed-width"> <fieldset class="form-actions cf"> <div class="form-actions-content"> <input type="hidden" name="<?php echo OP_SN; ?> _page_builder" value="save" /> <?php wp_nonce_field('op_page_builder', '_wpnonce', false); ?> <input type="submit" class="op-pb-button green" value="<?php _e($setup_wizard_submit_text, OP_SN); ?> " /> </div> </fieldset> </div> </div> </form> <script type="text/javascript" src="<?php echo is_ssl() ? 'https' : 'http'; ?> ://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('webfont','1'); </script> <?php echo op_tpl('admin_footer');
function load_tpl($tpl, $data = array(), $mod_tpl = true) { op_tpl_assign($this->shortname . '_object', $this); return op_tpl($tpl, $data, $mod_tpl ? $this->path . 'tpl/' : null); }
function dialog_output() { echo op_tpl('assets/dialog'); }
<form id="le-layouts-dialog"> <h1><?php _e('Content Templates', OP_SN); ?> </h1> <div class="op-lightbox-content"> <div class="op-actual-lightbox-content cf"> <?php $tabs = array('module_name' => 'content_layouts', 'tabs' => array('predefined' => array('title' => __('Predefined Templates', OP_SN), 'li_class' => 'op-bsw-grey-panel-tabs-selected'), 'upload' => __('Upload Template', OP_SN), 'export' => __('Export Template', OP_SN)), 'tab_content' => array('predefined' => $content_layouts . ($content_layout_category_count > 0 ? op_tpl('live_editor/layouts/keep_options') : ''), 'upload' => '<iframe src="' . menu_page_url(OP_SN . '-page-builder', false) . '&section=content_upload" width="700" height="400"></iframe>', 'export' => op_tpl('live_editor/layouts/export'))); echo op_tpl('generic/tabbed_module', $tabs); ?> </div> </div> <div class="op-insert-button cf"> <button type="submit" class="editor-button"><span><?php _e('Update', OP_SN); ?> </span></button> </div> </form>
<?php $le = new OptimizePress_LiveEditor(); $sections = $le->getSections(true); ?> <?php op_tpl_assign('nav_menus', wp_get_nav_menus()); $img = op_img('', true); $tabs = array(); $tab_content = array(); if (is_array($sections) || is_object($sections)) { foreach ($sections as $name => $section) { $tabs[$name] = array('title' => $section['title']); $tab_content[$name] = op_tpl('live_editor/helper', array('section_type' => $name, 'sections' => $name == 'functionality' ? $GLOBALS['functionality_sections'] : $section['object'], 'title' => $section['title'], 'description' => $section['description'])); if (op_has_section_error($name)) { $tabs[$name]['li_class'] = 'has-error'; } } } $data = array('tabs' => $tabs, 'tab_content' => $tab_content, 'module_name' => 'live_editor', 'error' => '', 'notification' => ''); echo op_tpl('live_editor/headers_layout', $data); ?> </div> </div> </div> <div class="op-insert-button cf"> <button type="submit" class="editor-button"><span><?php _e('Update', 'optimizepress'); ?> </span></button> </div> </form>
<?php echo op_tpl('admin_header'); ?> <form action="<?php echo menu_page_url(OP_SN . '-page-builder', false) . (isset($pagebuilder_postid) ? '&page_id=' . $pagebuilder_postid : '') . '&step=' . $cur_step; ?> " method="post" enctype="multipart/form-data" class="form-step-<?php echo $cur_step; ?> "> <div class="op-bsw-wizard"> <div class="op-bsw-content cf"> <div class="op-pb-header cf"> <div class="op-pb-fixed-width"> <h1 class="op-logo"><img src="<?php echo OP_IMG; ?> logo-pagebuilder.png" alt="OptimizePress" class="animated flipInY" width="245" height="50"></h1> <div class="op-pb-steps"> <ul class="steps-breadcrumb cf"> <?php $cur_step_array = array(); $steps = array(array('step_text' => __('Create Page', 'optimizepress'), 'step_desc' => __('Create your new page and choose a page name', 'optimizepress')), array('step_text' => __('Page Type', 'optimizepress'), 'step_desc' => __('Choose a page type for your page', 'optimizepress')), array('step_text' => __('Template', 'optimizepress'), 'step_desc' => __('Choose a template for your page', 'optimizepress')), array('step_text' => __('Settings', 'optimizepress'), 'step_desc' => __('Customize the settings for your chosen template', 'optimizepress')), array('step_text' => '', 'step desc' => '')); foreach ($steps as $step => $text) { $num = $step + 1; if ($num == 3 && (isset($page_type) && $page_type == 'membership')) { $text['step_text'] = __('Membership', 'optimizepress'); $text['step_desc'] = __('Choose your membership options', 'optimizepress'); } $selected = false;
function output($section_name, $config, $options, $return = false) { $styles = $this->_get_styles($section_name, $config); $type = op_get_var($options, 'type'); $before = op_get_var($config, 'before'); $after = op_get_var($config, 'after'); if (!empty($type) && isset($styles[$type]) && isset($options[$type])) { $style = $styles[$type]; if (isset($style['config'])) { extract($style['config']); } $options = $options[$type]; $content_done = $button_done = false; $content_options = array(); array_push($section_name, $type); $feature_content = array(); $used_content = $used_button = ''; foreach ($style['options'] as $option_name => $option) { $tmp_content = ''; if (isset($option['display_action'])) { $tmp_content = call_user_func_array($option['display_action'], array($section_name, $config)); } elseif (isset($option['module'])) { $mod_config = op_get_var($option, 'mod_options', array()); $mod_options = op_get_var($options, $option_name, array()); if (isset($option['use_content']) && isset($style['options'][$option['use_content']])) { $used_content = $option['use_content']; $content_config = op_get_var($style['options'][$option['use_content']], 'mod_options', array()); $content_opts = op_get_var($options, $option['use_content'], array()); $content_options = op_mod('content_fields')->output(array($section_name, $option['use_content']), $content_config, $content_opts, true); $mod_config['content_fields'] = op_get_var($content_config, 'fields', array()); if (isset($mod_config['disable'])) { $mod_config['disable'] = str_replace('content', '', $mod_config['disable']); } $content_done = true; $mod_options['content'] = $content_options; } if (isset($option['use_button']) && isset($style['options'][$option['use_button']])) { $used_button = $option['use_button']; $button_opts = op_get_var($options, $used_button, array()); $button_done = true; $mod_options['submit_button'] = op_mod('submit_button')->output(array($section_name, $used_button), array(), $button_opts, true); } if (!($option_name == $used_content && $content_done === true) && !($option_name == $used_button && $button_done === true)) { $tmp_content = op_mod($option['module'])->output(array($section_name, $option_name), $mod_config, $mod_options, true); $content = ''; if (is_array($tmp_content)) { if (count($tmp_content) > 0) { if ($option['module'] == 'content_fields') { $tmp_content = array('content' => $tmp_content); } if (isset($option['template'])) { if (is_array($option['template'])) { if (is_object($option['template'][0])) { if (is_callable($option['template'])) { $content = call_user_func_array($option['template'], array($tmp_content)); } } else { $content = op_tpl($option['template'][0], $tmp_content, $option['template'][1]); } } else { if (is_callable($option['template'])) { $content = call_user_func_array($option['template'], array($tmp_content)); } else { $content = $this->load_tpl('output/' . $option['template'], $tmp_content); } } } else { $content = $this->load_tpl('output/' . $option['module'], $tmp_content); } } } else { $content = $tmp_content; } $feature_content[] = $content; } } } $out = $before . implode('', $feature_content) . $after; if ($return) { return $out; } echo $out; } }
$on_off = $no_content = false; $options = array(); if (is_array($section)) { if (isset($section['template'])) { if (is_array($section['template'])) { $content = op_tpl($section['template']['tpl'], array(), $section['template']['path']); } else { $content = op_tpl($section['template']); } } else { $content = op_tpl('launch_suite/settings/' . $name); } $title = op_get_var($section, 'title'); } else { $title = $section; $content = op_tpl('launch_suite/settings/' . $name); } if (empty($content)) { $no_content = true; } $on_off = op_get_var($section, 'on_off', true); $class = $name; if (op_has_group_error('launch_suite_settings_' . $name)) { $class .= ' has-error'; op_section_error($section_type); } ?> <div class="op-bsw-grey-panel section-<?php echo $class . ($no_content ? ' op-bsw-grey-panel-no-content' : ''); ?> ">