예제 #1
0
 static function set_lang_keys()
 {
     self::$lang_keys = array('affiliate_page_description' => __('Provide code for banners or other elements that you want your affiliates to use for promoting your products or services.', OP_SN), 'arrows_description' => __('Use arrows on your site to highlight areas of important information, or to help funnel your visitors eye to a particular area or element of the page', OP_SN), 'audio_player_description' => __('Use the audio player to Include audio on your page. We recommend using MP3 format for your audio files.', OP_SN), 'bullet_block_description' => __('Use bullet blocks or lists to break down bulky information into readable chunks.  Using bullets can help conversions as visitors can quickly scan your bullets for information', OP_SN), 'button_description' => __('Use buttons on your page for calls to action or to aid navigation through your site. Select from our wide range of buttons to suit your page style and purpose', OP_SN), 'calendar_date_description' => __('Use the Calendar Date and Time element to show the time and date of a webinar or other online event', OP_SN), 'content_toggle_description' => __("Use this element to keep lengthly content organised on the page.  Great for FAQ's or similar information where the visitor can view the title and expand for more information.", OP_SN), 'countdown_timer_description' => __('Insert a countdown timer on your pages. Great for creating urgency for conversions', OP_SN), 'countdown_cookie_timer_description' => __('Countdown Timer with Cookie', OP_SN), 'course_description_description' => __('Insert a box showing the title and description of your membership course or product and include an icon', OP_SN), 'delayed_content_description' => __('Use this to delay an element on your page so it appears after a set time.  You can delay text or use the "Add Element" feature to add more items to delay.', OP_SN), 'divider_description' => __('Choose from a range of dividing lines and graphics to insert into your page.', OP_SN), 'dynamic_date_description' => __('Insert the date of the users visit into your page.  This date will always show the date the visitor accessed your page, so gives the impression of updated content', OP_SN), 'feature_block_description' => __('Use this element to highlight particular features of your product or service and include an icon or image to accompany the feature.', OP_SN), 'feature_box_description' => __('Insert a styled content box onto your page.  Choose from a range of styles to suit your page and content and insert text or other elements into the box.', OP_SN), 'feature_box_creator_description' => __('Create your own box style for your content.  Use the Advanced Options section to customize the look and feel of your box before inserting into the page', OP_SN), 'file_download_description' => __('Files download element can be used to upload files and build file lists.', OP_SN), 'guarantee_box_description' => __('Highlight your guarantee policy and terms with these boxes and graphics.', OP_SN), 'headline_description' => __('Choose from a range of different headline styles to highlight features or sections of your page.', OP_SN), 'hyperlink_description' => __('If you want to include a customized text hyperlink you can use this element to insert one into your page. Customize the styling to fit your site.', OP_SN), 'images_description' => __('Insert an image into your page with this element.  Choose from a range of border styles and include a caption and larger image if you want to provide a larger lightbox preview.', OP_SN), 'img_alert_description' => __('Image with javascript alert can be used for a video fakeout or to push people to your optin form', OP_SN), 'img_text_aside_description' => __('An easy way to add an image and vertically align text content next to it. Great for inserting features illustrated with graphics onto your pages', OP_SN), 'javascript_description' => __('Add your custom JavaScript on page', OP_SN), 'live_search_description' => __('Insert a Live Search box which can be used to search your pages or membership content', OP_SN), 'membership_order_button_description' => __('Insert a button which will allow users to order a membership.', OP_SN), 'membership_login_form_description' => __('Insert a login form for your members to login to your membership area', OP_SN), 'membership_download_description' => __('Membership files download can be used to upload and protect files using OptimizePress Member plugin.', OP_SN), 'navigation_description' => __('Help visitors navigate around your site with these navigation blocks. Create a custom menu within the Wordpress interface and choose the menu to assign to your element', OP_SN), 'news_bar_description' => __('Insert a bar which you can use to highlight latest news from your company or product', OP_SN), 'one_time_offer_description' => __('If you are creating a one-time offer page you can use these graphics to help emphasise this and improve conversions', OP_SN), 'optin_box_description' => __('Insert an optin box into your page with this element.  Choose from a range of styles and integrate your autoresponder to build your email list.', OP_SN), 'order_box_description' => __('Use order boxes to highlight your call to action and order buttons.', OP_SN), 'order_step_graphics_description' => __('Use order step graphics to highlight the step of the checkout process your visitor is on. This can help them how close to completing the transaction they are.', OP_SN), 'pricing_element_description' => __('If you want to include a high visibility product price on your page you can use this element.  Customize the text and a white border and shadow will be added.', OP_SN), 'pricing_table_description' => __('Use Pricing Tables to elegantly display the different features or benefits of your product packages in comparison to each other', OP_SN), 'progress_bar_description' => __('Insert a progress bar on your page - great for showing progress through a membership course or free training series', OP_SN), 'qna_elements_description' => __('If you want to include a Q&A section on your page you can use this element to display your questions and answers in an organised style', OP_SN), 'recent_posts_description' => __('Insert a list of the most recent posts from your blog. Perfect for creating a custom home page.', OP_SN), 'social_sharing_description' => __('Insert a block of social sharing icons into your page to help spread your content virally through networks like Facebook, Twitter and Google Plus', OP_SN), 'step_graphics_description' => __('Use Step Graphics as a great way to illustrate numbered steps for a process on your pages', OP_SN), 'tabs_description' => __('Use tabs to separate content but make it easily navigable without the user scrolling down the page.', OP_SN), 'terms_conditions_description' => __('If you would like to require your visitors to agree to a set of terms & conditions before purchasing you can use this element.', OP_SN), 'testimonials_description' => __('Use testimonials as a great way to provide social proof about your product or service.  Choose from a range of styles to fit your page', OP_SN), 'tour_description' => __('These elements are a great way to provide a call to action for your visitors to purchase or get more information about your product or service', OP_SN), 'two_column_block_description' => __('Add two columns of text (each 50% width) to an existing column of your page layout.', OP_SN), 'vertical_spacing_description' => __('Add vertical spacing to a column of your layout.', OP_SN), 'video_player_description' => __('Include a video on your page.  Use your own embed code from sites like YouTube, or select URL to use a video you have hosted with Amazon S3 or a similar service.', OP_SN), 'video_lightbox_description' => __('Insert an image into your page which when clicked will load a video in a lightbox. Great for training pages or to keep feature pages more organised.', OP_SN));
 }
예제 #2
0
function _op_font_item($font = '')
{
    if ($font_face = op_default_fonts($font)) {
        return array('default', $font, $font_face);
    } elseif (($varient = op_google_fonts($font)) !== false) {
        /*
         * Adding on demand font loading for LE
         */
        if (defined('OP_LIVEEDITOR')) {
            OptimizePress_Default_Assets::_set_font(array('google', $font, $varient));
        }
        return array('google', $font, $varient);
    }
    return false;
}
예제 #3
0
 function parse_shortcode()
 {
     $this->check_nonce();
     $this->init_page();
     // added for some plugins to make LE a page
     global $wp_query;
     $wp_query->is_page = true;
     // end
     define('OP_AJAX_SHORTCODE', true);
     $GLOBALS['OP_LIVEEDITOR_DEPTH'] = isset($_POST['depth']) && $_POST['depth'] == 1 ? 1 : 0;
     $GLOBALS['OP_ADD_ELEMENT_ROWS'] = false;
     $GLOBALS['OP_LIVEEDITOR_FONT_STR'] = array();
     $GLOBALS['OP_LIVEEDITOR_DISABLE_NEW'] = false;
     //$GLOBALS['OP_DONE_TOP_LEVEL'] = false;
     require_once OP_ASSETS . 'live_editor.php';
     $sc = isset($_POST['shortcode']) ? $_POST['shortcode'] : $_GET['shortcode'];
     $sc = op_fix_embed_url_shortcodes(stripslashes($sc));
     // Popup needs to be handled differently
     $op_popup_present = false;
     // removing new line before shortcode entered in content
     $sc = str_replace(array("\n[", "\r[", "\r\n[", "\n\r["), array("[", "[", "[", "["), $sc);
     if (strpos($sc, '[op_popup ') !== false || strpos($sc, '[op_popup_elements]') !== false) {
         $op_popup_present = true;
     }
     // if ( strpos($sc, '[op_popup_button]') !== false && strpos($sc, '[op_popup ') === false) {
     //     if ( strpos($sc, '[op_popup_elements]') === false ) {
     //         $op_popup_present = true;
     //     } else {
     //         $sc = str_replace('[op_popup_elements]', '', $sc);
     //         $sc = str_replace('[/op_popup_elements]', '', $sc);
     //     }
     // } else {
     //     $sc = str_replace('[op_popup_elements]', '', $sc);
     //     $sc = str_replace('[/op_popup_elements]', '', $sc);
     // }
     if (preg_match('/' . op_shortcode_regex('op_liveeditor_elements') . '/s', $sc, $matches) || $op_popup_present) {
         if ($GLOBALS['OP_LIVEEDITOR_DEPTH'] === 1) {
             // EDIT ELEMENT
             $GLOBALS['OP_ADD_ELEMENT_ROWS'] = true;
             if (!$op_popup_present) {
                 $processed = op_process_content_filter($sc, true);
             }
             if ($op_popup_present) {
                 // [op_popup_elements] shortcode is present here
                 $new_popup_elements = '';
                 preg_match_all('/\\[op_popup_content_element[ d|\\]].*?\\[\\/op_popup_content_element\\]/is', $sc, $popup_elements);
                 foreach ($popup_elements[0] as $popup_element) {
                     $popup_element_sc = $popup_element;
                     $popup_element = str_replace('[op_popup_content_element]', '[op_liveeditor_element][op_popup_content_element]', $popup_element);
                     $popup_element = str_replace('[/op_popup_content_element]', '[/op_popup_content_element][/op_liveeditor_element]', $popup_element);
                     $popup_element = op_process_content_filter('[op_liveeditor_elements]' . $popup_element . '[/op_liveeditor_elements]', true);
                     $popup_element = str_replace('###OP_POPUP_CONTENT_CHILDREN###', $popup_element_sc, $popup_element);
                     $popup_element = str_replace('[op_popup_content_element]', '', $popup_element);
                     $popup_element = str_replace('[/op_popup_content_element]', '', $popup_element);
                     $new_popup_elements .= $popup_element;
                 }
                 $new_popup_elements = str_replace('$', '\\$', $new_popup_elements);
                 $processed = preg_replace('/\\[op_popup_elements[ d|\\]].*?\\[\\/op_popup_elements\\]/is', $new_popup_elements, $sc);
                 // $processed = str_replace('[op_popup_button]', '<div class="op-popup-button ' . $popup_button_class . '">', $processed);
                 // $processed = str_replace('[/op_popup_button]', '</div>', $processed);
                 $processed .= op_process_content_filter('[op_liveeditor_elements][/op_liveeditor_elements]', true);
             }
             $processed = '<h1>' . __('Content LiveEditor', OP_SN) . '</h1><div class="epicbox-actual-content">' . $processed . '<a href="#add_element" class="add-new-element"><img src="' . OP_IMG . '/live_editor/add_new.png" alt="' . esc_attr__('Add Element', OP_SN) . '"><span>' . __('Add Element', OP_SN) . '</span></a></div><div class="op-insert-button cf"><button type="submit" class="editor-button"><span>' . __('Update', OP_SN) . '</span></button></div>';
             if ($op_popup_present) {
                 $processed .= '<div class="op-hidden op_popup_element_present"><textarea class="op-le-child-shortcode" name="shortcode[]">' . $sc . '</textarea></div>';
             }
         } else {
             // UPDATE ELEMENT
             $GLOBALS['OP_LIVEEDITOR_DISABLE_NEW'] = true;
             $child_data = op_page_parse_child_elements($matches[0]);
             $processed = do_shortcode(str_replace($matches[0], '#OP_CHILD_ELEMENTS#', $sc));
             $GLOBALS['OP_LIVEEDITOR_DEPTH'] = 1;
             $child_html = '';
             $child_element_nr = 0;
             preg_match_all('/(<div class="row.*>)(.*)\\[\\/op_liveeditor_element\\]/isU', $child_data['liveeditorElements'], $child_rows_result);
             foreach ($child_rows_result[2] as $result_row) {
                 $result_row = $result_row . '[/op_liveeditor_element]';
                 $child_html .= $child_rows_result[1][$child_element_nr] . op_process_content_filter($result_row, true) . '</div>';
                 $child_element_nr += 1;
             }
             // preg_match_all('/(<div class="row.*>)(.*)<\/div>/isU', $child_data['liveeditorElements'], $child_rows_result);
             // foreach($child_rows_result[2] as $result_row) {
             //     $child_html .= $child_rows_result[1][$child_element_nr] . op_process_content_filter($result_row) . '</div>';
             //     $child_element_nr += 1;
             // }
             /**
              * At the end of child elements "add element" button must
              * be inserted, which is done by parsing [op_liveeditor_elements] shortcode
              */
             $child_html .= op_process_content_filter('[op_liveeditor_elements][/op_liveeditor_elements]', true);
             $child_html = op_process_asset_content($child_html) . '<div class="op-hidden"><textarea class="op-le-child-shortcode" name="shortcode[]">' . op_attr(shortcode_unautop($matches[0])) . '</textarea></div>';
             /*
              * $ needs to be escaped
              */
             $child_html = str_replace('$', '\\$', $child_html);
             $processed = preg_replace(array('{<p[^>]*>\\s*#OP_CHILD_ELEMENTS#\\s*<\\/p>}i', '{#OP_CHILD_ELEMENTS#}i'), $child_html, $processed);
             if ($op_popup_present) {
                 $new_popup_elements = '';
                 $new_popup_elements_sc = '';
                 // Parse op_popup_content
                 preg_match_all('/\\[op_popup_content_element[ d|\\]].*?\\[\\/op_popup_content_element\\]/is', $sc, $popup_elements);
                 foreach ($popup_elements[0] as $popup_element) {
                     $new_popup_elements_sc .= $popup_element;
                     $popup_element = str_replace('[op_popup_content_element]', '[op_liveeditor_element]', $popup_element);
                     $popup_element = str_replace('[/op_popup_content_element]', '[/op_liveeditor_element]', $popup_element);
                     $popup_element = op_process_content_filter($popup_element, true);
                     $new_popup_elements .= $popup_element;
                 }
                 $new_popup_elements = '<div class="op-popup-content">' . $new_popup_elements . '</div>';
                 $new_popup_elements .= op_process_content_filter('[op_liveeditor_elements][/op_liveeditor_elements]', true);
                 $new_popup_elements = str_replace('$', '\\$', $new_popup_elements);
                 $processed = preg_replace('/\\[op_popup_content[ d|\\]].*?\\[\\/op_popup_content\\]/is', $new_popup_elements, $sc);
                 // Parse op_popup_button
                 preg_match_all('/\\[op_popup_button\\].*?\\[\\/op_popup_button\\]/is', str_replace('$', '\\$', $sc), $new_popup_button);
                 $new_popup_button = $new_popup_button[0][0];
                 $new_popup_button = str_replace('[op_popup_button]', '', $new_popup_button);
                 $new_popup_button = str_replace('[/op_popup_button]', '', $new_popup_button);
                 $new_popup_button = op_process_content_filter($new_popup_button, true);
                 $new_popup_button = '<div class="op-popup-button ' . $popup_button_class . '">' . $new_popup_button . '</div>';
                 $processed = op_process_content_filter($processed, true);
                 $new_popup_button = str_replace('$', '\\$', $new_popup_button);
                 $processed = preg_replace('/\\[op_popup_button\\].*?\\[\\/op_popup_button\\]/is', $new_popup_button, $processed);
                 // $processed = str_replace('[op_popup_button]', '<div class="op-popup-button ' . $popup_button_class . '">', $processed);
                 // $processed = str_replace('[/op_popup_button]', '</div>', $processed);
                 $processed .= '<div class="op-hidden op_popup_element_present"><textarea class="op-le-child-shortcode" name="shortcode[]">' . op_attr(shortcode_unautop('[op_popup_elements]' . $new_popup_elements_sc . '[/op_popup_elements]')) . '</textarea></div>';
             }
         }
     } else {
         // $processed = apply_filters('the_content', $sc);
         $processed = op_process_content_filter($sc, true);
     }
     $output = array('output' => $processed, 'js' => OptimizePress_Default_Assets::_print_front_scripts(true), 'check' => OptimizePress_Default_Assets::_check_function(), 'font' => OptimizePress_Default_Assets::_get_font());
     if (isset($GLOBALS['OP_PARSED_SHORTCODE']) && !empty($GLOBALS['OP_PARSED_SHORTCODE'])) {
         $output['shortcode'] = $GLOBALS['OP_PARSED_SHORTCODE'];
     }
     echo json_encode($output);
     exit;
 }
예제 #4
0
    function parse_shortcode()
    {
        $this->check_nonce();
        $this->init_page();
        define('OP_AJAX_SHORTCODE', true);
        $GLOBALS['OP_LIVEEDITOR_DEPTH'] = isset($_POST['depth']) && $_POST['depth'] == 1 ? 1 : 0;
        $GLOBALS['OP_ADD_ELEMENT_ROWS'] = false;
        $GLOBALS['OP_LIVEEDITOR_FONT_STR'] = array();
        $GLOBALS['OP_LIVEEDITOR_DISABLE_NEW'] = false;
        //$GLOBALS['OP_DONE_TOP_LEVEL'] = false;
        require_once OP_ASSETS . 'live_editor.php';
        $sc = isset($_POST['shortcode']) ? $_POST['shortcode'] : $_GET['shortcode'];
        $sc = op_fix_embed_url_shortcodes(stripslashes($sc));
        if (preg_match('/' . op_shortcode_regex('op_liveeditor_elements') . '/s', $sc, $matches)) {
            if ($GLOBALS['OP_LIVEEDITOR_DEPTH'] === 1) {
                $GLOBALS['OP_ADD_ELEMENT_ROWS'] = true;
                $processed = apply_filters('the_content', $sc);
                $processed = '<h1>' . __('Content LiveEditor', OP_SN) . '</h1><div class="epicbox-actual-content">' . $processed . '<a href="#add_element" class="add-new-element"><img src="' . OP_IMG . '/live_editor/add_new.png" alt="' . __('Add Element', OP_SN) . '"><span>' . __('Add Element', OP_SN) . '</span></a></div>
			<div class="op-insert-button cf">
            	<button type="submit" class="editor-button"><span>' . __('Update', OP_SN) . '</span></button>
            </div>';
            } else {
                $GLOBALS['OP_LIVEEDITOR_DISABLE_NEW'] = true;
                $processed = do_shortcode(str_replace($matches[0], '#OP_CHILD_ELEMENTS#', $sc));
                $GLOBALS['OP_LIVEEDITOR_DEPTH'] = 1;
                $child_html = op_process_asset_content(apply_filters('the_content', $matches[0])) . '<div class="op-hidden"><textarea class="op-le-child-shortcode" name="shortcode[]">' . op_attr(shortcode_unautop($matches[0])) . '</textarea></div>';
                $child_html = str_replace('$', '&#36;', $child_html);
                $processed = preg_replace(array('{<p[^>]*>\\s*#OP_CHILD_ELEMENTS#\\s*<\\/p>}i', '{#OP_CHILD_ELEMENTS#}i'), $child_html, $processed);
                //die($processed);
            }
        } else {
            $processed = apply_filters('the_content', $sc);
        }
        $output = array('output' => $processed, 'js' => OptimizePress_Default_Assets::_print_front_scripts(true), 'check' => OptimizePress_Default_Assets::_check_function());
        if (isset($GLOBALS['OP_PARSED_SHORTCODE']) && !empty($GLOBALS['OP_PARSED_SHORTCODE'])) {
            $output['shortcode'] = $GLOBALS['OP_PARSED_SHORTCODE'];
        }
        echo json_encode($output);
        exit;
    }