public static function onAjaxAction()
 {
     $slider = new RevSlider();
     $slide = new RevSlide();
     $operations = new RevOperations();
     $action = self::getPostGetVar("client_action");
     $data = self::getPostGetVar("data");
     //$nonce = self::getPostGetVar("nonce");
     try {
         //verify the nonce
         //				$isVerified = wp_verify_nonce($nonce, "revslider_actions");
         //
         //				if($isVerified == false)
         //					UniteFunctionsRev::throwError("Wrong request");
         switch ($action) {
             //start font
             case 'add_google_fonts':
                 $f = new ThemePunch_Fonts();
                 $result = $f->add_new_font($data);
                 if ($result === true) {
                     self::ajaxResponseSuccessRedirect(__("Font successfully created!", REVSLIDER_TEXTDOMAIN), self::getViewUrl("sliders"));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 break;
             case 'remove_google_fonts':
                 if (!isset($data['handle'])) {
                     self::ajaxResponseError(__('Font not found', REVSLIDER_TEXTDOMAIN), false);
                 }
                 $f = new ThemePunch_Fonts();
                 $result = $f->remove_font_by_handle($data['handle']);
                 if ($result === true) {
                     self::ajaxResponseSuccess(__("Font successfully removed!", REVSLIDER_TEXTDOMAIN), array('data' => $result));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 break;
             case 'edit_google_fonts':
                 if (!isset($data['handle'])) {
                     self::ajaxResponseError(__('No handle given', REVSLIDER_TEXTDOMAIN), false);
                 }
                 if (!isset($data['url'])) {
                     self::ajaxResponseError(__('No parameters given', REVSLIDER_TEXTDOMAIN), false);
                 }
                 $f = new ThemePunch_Fonts();
                 $result = $f->edit_font_by_handle($data);
                 if ($result === true) {
                     self::ajaxResponseSuccess(__("Font successfully changed!", REVSLIDER_TEXTDOMAIN), array('data' => $result));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 break;
                 //end font
             //end font
             case "export_slider":
                 $sliderID = self::getGetVar("sliderid");
                 $dummy = self::getGetVar("dummy");
                 $slider->initByID($sliderID);
                 $slider->exportSlider($dummy);
                 break;
             case "import_slider":
                 $updateAnim = self::getPostGetVar("update_animations");
                 $updateStatic = self::getPostGetVar("update_static_captions");
                 self::importSliderHandle(null, $updateAnim, $updateStatic);
                 break;
             case "import_slider_slidersview":
                 $viewBack = self::getViewUrl(self::VIEW_SLIDERS);
                 $updateAnim = self::getPostGetVar("update_animations");
                 $updateStatic = self::getPostGetVar("update_static_captions");
                 self::importSliderHandle($viewBack, $updateAnim, $updateStatic);
                 break;
             case "create_slider":
                 self::requireSettings("slider_settings");
                 $settingsMain = self::getSettings("slider_main");
                 $settingsParams = self::getSettings("slider_params");
                 $data = $operations->modifyCustomSliderParams($data);
                 //var_dump($settingsMain);
                 $newSliderID = $slider->createSliderFromOptions($data, $settingsMain, $settingsParams);
                 if ($newSliderID > 0) {
                     self::ajaxResponseSuccessRedirect(__("The slider successfully created", REVSLIDER_TEXTDOMAIN), self::getViewUrl("sliders"));
                 }
                 break;
             case "update_slider":
                 self::requireSettings("slider_settings");
                 $settingsMain = self::getSettings("slider_main");
                 $settingsParams = self::getSettings("slider_params");
                 $data = $operations->modifyCustomSliderParams($data);
                 $slider->updateSliderFromOptions($data, $settingsMain, $settingsParams);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("Slider updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "delete_slider":
                 $isDeleted = $slider->deleteSliderFromData($data);
                 if (is_array($isDeleted)) {
                     $isDeleted = implode(', ', $isDeleted);
                     self::ajaxResponseError("Template can't be deleted, it is still being used by the following Sliders: " . $isDeleted);
                 } else {
                     self::ajaxResponseSuccessRedirect(__("The slider deleted", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
                 }
                 break;
             case "duplicate_slider":
                 $slider->duplicateSliderFromData($data);
                 self::ajaxResponseSuccessRedirect(__("The duplicate successfully, refreshing page...", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
                 break;
             case "add_slide":
                 $numSlides = $slider->createSlideFromData($data);
                 $sliderID = $data["sliderid"];
                 if ($numSlides == 1) {
                     $responseText = __("Slide Created", REVSLIDER_TEXTDOMAIN);
                 } else {
                     $responseText = $numSlides . " " . __("Slides Created", REVSLIDER_TEXTDOMAIN);
                 }
                 $urlRedirect = self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}");
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccessRedirect($responseText, $urlRedirect);
                 break;
             case "add_slide_fromslideview":
                 $slideID = $slider->createSlideFromData($data, true);
                 $urlRedirect = self::getViewUrl(self::VIEW_SLIDE, "id={$slideID}");
                 $responseText = __("Slide Created, redirecting...", REVSLIDER_TEXTDOMAIN);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccessRedirect($responseText, $urlRedirect);
                 break;
             case "update_slide":
                 require self::getSettingsFilePath("slide_settings");
                 $slide->updateSlideFromData($data, $slideSettings);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("Slide updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "update_static_slide":
                 $slide->updateStaticSlideFromData($data);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("Static Layers updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "delete_slide":
                 $isPost = $slide->deleteSlideFromData($data);
                 if ($isPost) {
                     $message = __("Post Deleted Successfully", REVSLIDER_TEXTDOMAIN);
                 } else {
                     $message = __("Slide Deleted Successfully", REVSLIDER_TEXTDOMAIN);
                 }
                 $sliderID = UniteFunctionsRev::getVal($data, "sliderID");
                 self::ajaxResponseSuccessRedirect($message, self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "duplicate_slide":
                 $sliderID = $slider->duplicateSlideFromData($data);
                 self::ajaxResponseSuccessRedirect(__("Slide Duplicated Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "copy_move_slide":
                 $sliderID = $slider->copyMoveSlideFromData($data);
                 self::ajaxResponseSuccessRedirect(__("The operation successfully, refreshing page...", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "get_static_css":
                 sdsconfig::getgeneratecssfile();
                 $contentCSS = $operations->getStaticCss();
                 self::ajaxResponseData($contentCSS);
                 break;
             case "get_dynamic_css":
                 sdsconfig::getgeneratecssfile();
                 $contentCSS = $operations->getDynamicCss();
                 self::ajaxResponseData($contentCSS);
                 break;
             case "insert_captions_css":
                 $arrCaptions = $operations->insertCaptionsContentData($data);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "update_captions_css":
                 $arrCaptions = $operations->updateCaptionsContentData($data);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "delete_captions_css":
                 $arrCaptions = $operations->deleteCaptionsContentData($data);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("Style deleted succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "update_static_css":
                 $staticCss = $operations->updateStaticCss($data);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("css" => $staticCss));
                 break;
             case "insert_custom_anim":
                 $arrAnims = $operations->insertCustomAnim($data);
                 //$arrCaptions =
                 self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
                 break;
             case "update_custom_anim":
                 $arrAnims = $operations->updateCustomAnim($data);
                 self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
                 break;
             case "delete_custom_anim":
                 $arrAnims = $operations->deleteCustomAnim($data);
                 self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
                 break;
             case "update_slides_order":
                 $slider->updateSlidesOrderFromData($data);
                 self::ajaxResponseSuccess(__("Order updated successfully", REVSLIDER_TEXTDOMAIN));
                 break;
             case "change_slide_image":
                 $slide->updateSlideImageFromData($data);
                 $sliderID = UniteFunctionsRev::getVal($data, "slider_id");
                 self::ajaxResponseSuccessRedirect(__("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "preview_slide":
                 $operations->putSlidePreviewByData($data);
                 break;
                 // case "preview_slider":
                 // 	$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
                 // 	$operations->previewOutput($sliderID);
                 // break;
             // case "preview_slider":
             // 	$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
             // 	$operations->previewOutput($sliderID);
             // break;
             case "preview_slider":
                 $sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
                 $do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
                 if ($do_markup == 'true') {
                     $operations->previewOutputMarkup($sliderID);
                 } else {
                     $operations->previewOutput($sliderID);
                 }
                 break;
             case "toggle_slide_state":
                 $currentState = $slide->toggleSlideStatFromData($data);
                 self::ajaxResponseData(array("state" => $currentState));
                 break;
             case "slide_lang_operation":
                 $responseData = $slide->doSlideLangOperation($data);
                 self::ajaxResponseData($responseData);
                 break;
             case "update_plugin":
                 self::updatePlugin(self::DEFAULT_VIEW);
                 break;
             case "update_text":
                 self::updateSettingsText();
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("All files successfully updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "update_general_settings":
                 $new_data = array();
                 // print_r($data);
                 foreach ($data as $key => $value) {
                     $new_data[$key] = $value;
                 }
                 $operations->updateGeneralSettings($new_data);
                 // sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("General settings updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "update_posts_sortby":
                 $slider->updatePostsSortbyFromData($data);
                 self::ajaxResponseSuccess(__("Sortby updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "replace_image_urls":
                 $slider->replaceImageUrlsFromData($data);
                 self::ajaxResponseSuccess(__("Image urls replaced", REVSLIDER_TEXTDOMAIN));
                 break;
             case "reset_slide_settings":
                 $slider->resetSlideSettings($data);
                 sdsconfig::getgeneratecssfile();
                 self::ajaxResponseSuccess(__("Settings in all Slides changed", REVSLIDER_TEXTDOMAIN));
                 break;
             case 'delete_uploaded_image':
                 self::delete_uploaded_file($data);
                 break;
             case 'get_uploaded_images':
                 self::get_uploaded_files_json();
                 break;
             case 'add_slider_pos_val':
                 $newdata = array();
                 if (!empty($data)) {
                     $k = array_keys($data);
                     $k = preg_replace_callback('/\\[[0-9]+/', create_function('$match', 'return "";'), $k[0]);
                     foreach ($data as $key => $arr) {
                         $newdata[$k][] = $arr;
                     }
                     $data = $newdata;
                 }
                 sdsconfig::editSetting('revslideropencart', $data);
                 self::ajaxResponseSuccess(__("Slider Position Save SuccessFully", REVSLIDER_TEXTDOMAIN));
                 break;
             default:
                 self::ajaxResponseError("wrong ajax action: {$action} ");
                 break;
         }
     } catch (Exception $e) {
         $message = $e->getMessage();
         if ($action == "preview_slide" || $action == "preview_slider") {
             echo $message;
             exit;
         }
         self::ajaxResponseError($message);
     }
     //it's an ajax action, so exit
     //self::ajaxResponseError("No response output on <b> $action </b> action. please check with the developer.");
     exit;
 }
    public function previewOutputMarkup($sliderID, $output = null)
    {
        if ($sliderID == "empty_output") {
            $this->loadingMessageOutput();
            exit;
        }
        if ($output == null) {
            $output = new RevSliderOutput();
        }
        $slider = new RevSlider();
        $slider->initByID($sliderID);
        $isWpmlExists = UniteWpmlRev::isWpmlExists();
        $useWpml = $slider->getParam("use_wpml", "off");
        $wpmlActive = false;
        if ($isWpmlExists && $useWpml == "on") {
            $wpmlActive = true;
            $arrLanguages = UniteWpmlRev::getArrLanguages(false);
            //set current lang to output
            $currentLang = UniteFunctionsRev::getPostGetVariable("lang");
            if (empty($currentLang)) {
                $currentLang = UniteWpmlRev::getCurrentLang();
            }
            if (empty($currentLang)) {
                $currentLang = $arrLanguages[0];
            }
            $output->setLang($currentLang);
            $selectLangChoose = UniteFunctionsRev::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true);
        }
        $output->setPreviewMode();
        //put the output html
        $urlPlugin = "http://yourpluginpath/";
        $urlPreviewPattern = UniteBaseClassRev::$url_ajax_actions . "&client_action=preview_slider&only_markup=true&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]";
        $nonce = wp_create_nonce("revslider_actions");
        $setBase = is_ssl() ? "https://" : "http://";
        $f = new ThemePunch_Fonts();
        $my_fonts = $f->get_all_fonts();
        ?>
			<html>
			<head>
				<script type='text/javascript' src='<?php 
        echo $setBase;
        ?>
ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
			</head>
			<body style="padding:0px;margin:0px;">
				<?php 
        if ($wpmlActive == true) {
            ?>
					<div style="margin-bottom:10px;text-align:center;">
					<?php 
            _e("Choose language", REVSLIDER_TEXTDOMAIN);
            ?>
: <?php 
            echo $selectLangChoose;
            ?>
					</div>

					<script type="text/javascript">
						var g_previewPattern = '<?php 
            echo $urlPreviewPattern;
            ?>
';
						jQuery("#select_langs").change(function(){
							var lang = this.value;
							var nonce = "<?php 
            echo $nonce;
            ?>
";
							var pattern = g_previewPattern;
							var urlPreview = pattern.replace("[lang]",lang).replace("[nonce]",nonce);
							location.href = urlPreview;
						});

						jQuery('body').on('click', '#rev_replace_images', function(){
							var from = jQuery('input[name="orig_image_path"]').val();
							var to = jQuery('input[name="replace_image_path"]').val();

							jQuery('#rev_script_content').val(jQuery('#rev_script_content').val().replace(from, to));
							jQuery('#rev_the_content').val(jQuery('#rev_the_content').val().replace(from, to));
							jQuery('#rev_style_content').val(jQuery('#rev_style_content').val().replace(from, to));
							jQuery('#rev_head_content').val(jQuery('#rev_head_content').val().replace(from, to));
						});

					</script>
				<?php 
        }
        ?>
			<?php 
        //UniteBaseClassRev::$url_plugin
        ob_start();
        ?>
<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
css/settings.css?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
<?php 
        $http = is_ssl() ? 'https' : 'http';
        if (!empty($my_fonts)) {
            foreach ($my_fonts as $c_font) {
                ?>
<link rel='stylesheet' href="<?php 
                echo $http . '://fonts.googleapis.com/css?family=' . strip_tags($c_font['url']);
                ?>
" type='text/css' /><?php 
                echo "\n";
            }
        }
        ?>
<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.tools.min.js?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
'></script>
<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.revolution.min.js?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
'></script>
<?php 
        $head_content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        ob_start();
        $custom_css = RevOperations::getStaticCss();
        echo $custom_css . "\n\n";
        echo '/*****************' . "\n";
        echo ' ** ' . __('CAPTIONS CSS', REVSLIDER_TEXTDOMAIN) . "\n";
        echo ' ****************/' . "\n\n";
        $db = new UniteDBRev();
        $styles = $db->fetch(GlobalsRevSlider::$table_css);
        echo UniteCssParserRev::parseDbArrayToCss($styles, "\n");
        $style_content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        ob_start();
        $output->putSliderBase($sliderID);
        $content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        $script_content = substr($content, strpos($content, '<script type="text/javascript">'), strpos($content, '</script>') + 9 - strpos($content, '<script type="text/javascript">'));
        $content = htmlentities(str_replace($script_content, '', $content));
        $script_content = str_replace('				', '', $script_content);
        $script_content = str_replace(array('<script type="text/javascript">', '</script>'), '', $script_content);
        ?>
			<style>
				body 	 { font-family:sans-serif; font-size:12px;}
				textarea { background:#f1f1f1; border:#ddd; font-size:10px; line-height:16px; margin-bottom:40px; padding:10px;}
				.rev_cont_title { color:#000; text-decoration:none;font-size:14px; line-height:24px; font-weight:800;background: #D5D5D5;padding: 10px;}
				.rev_cont_title a,
				.rev_cont_title a:visited { margin-left:25px;font-size:12px;line-height:12px;float:right;background-color:#8e44ad; color:#fff; padding:8px 10px;text-decoration:none;}
				.rev_cont_title a:hover	  { background-color:#9b59b6}
			</style>
			<p><?php 
        $dir = wp_upload_dir();
        ?>
				<?php 
        _e('Replace image path:', REVSLIDER_TEXTDOMAIN);
        ?>
 <?php 
        _e('From:', REVSLIDER_TEXTDOMAIN);
        ?>
 <input type="text" name="orig_image_path" value="<?php 
        echo @$dir['baseurl'];
        ?>
" /> <?php 
        _e('To:', REVSLIDER_TEXTDOMAIN);
        ?>
 <input type="text" name="replace_image_path" value="" /> <input id="rev_replace_images" type="button" name="replace_images" value="<?php 
        _e('Replace', REVSLIDER_TEXTDOMAIN);
        ?>
" />
			</p>

			<div class="rev_cont_title"><?php 
        _e('Header', REVSLIDER_TEXTDOMAIN);
        ?>
 <a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_head_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a><div style="clear:both"></div></div>
			<textarea id="rev_head_content" readonly="true" style="width: 100%; height: 100px; color:#3498db"><?php 
        echo $head_content;
        ?>
</textarea>
			<div class="rev_cont_title"><?php 
        _e('CSS', REVSLIDER_TEXTDOMAIN);
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_style_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a></div>
			<textarea id="rev_style_content" readonly="true" style="width: 100%; height: 100px;"><?php 
        echo $style_content;
        ?>
</textarea>
			<div class="rev_cont_title"><?php 
        _e('Body', REVSLIDER_TEXTDOMAIN);
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_the_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a></div>
			<textarea id="rev_the_content" readonly="true" style="width: 100%; height: 100px;"><?php 
        echo $content;
        ?>
</textarea>
			<div class="rev_cont_title"><?php 
        _e('Script', REVSLIDER_TEXTDOMAIN);
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_script_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a></div>
			<textarea id="rev_script_content" readonly="true" style="width: 100%; height: 100px;"><?php 
        echo $script_content;
        ?>
</textarea>

			<script>
				jQuery('body').on('click','.copytoclip',function() {
					jQuery("#"+jQuery(this).data('idt')).select();
				});
			</script>
			</body>
			</html>
			<?php 
        exit;
    }
Ejemplo n.º 3
0
 * @author    ThemePunch <*****@*****.**>
 * @link      http://www.themepunch.com/essential/
 * @copyright 2014 ThemePunch
 */
if (!defined('ABSPATH')) {
    exit;
}
?>
	<h2><?php 
echo esc_html(get_admin_page_title());
?>
</h2>

	<div id="eg-grid-google-font-wrapper">
		<?php 
$fonts = new ThemePunch_Fonts();
$custom_fonts = $fonts->get_all_fonts();
if (!empty($custom_fonts)) {
    foreach ($custom_fonts as $font) {
        $cur_font = $font['url'];
        $cur_font = explode('+', $cur_font);
        $cur_font = implode(' ', $cur_font);
        $cur_font = explode(':', $cur_font);
        $title = $cur_font['0'];
        ?>
				<div class="postbox eg-postbox" style="width:100%;min-width:500px">
					<h3 class="box-closed"><span style="font-weight:400"><?php 
        _e('Font Family:', EG_TEXTDOMAIN);
        ?>
</span><span style="text-transform:uppercase;"><?php 
        echo $title;
Ejemplo n.º 4
0
 public function export_punch_fonts($export_punch_fonts)
 {
     $return_metas = array();
     if ($export_punch_fonts !== false && !empty($export_punch_fonts)) {
         $fonts = new ThemePunch_Fonts();
         $custom_fonts = $fonts->get_all_fonts();
         if (!empty($export_punch_fonts)) {
             foreach ($custom_fonts as $c_font) {
                 foreach ($export_punch_fonts as $font) {
                     if ($c_font['handle'] == $font) {
                         $return_metas[] = $c_font;
                         break;
                     }
                 }
             }
         }
     }
     return $return_metas;
 }
 /**
  * Handle Ajax Requests
  */
 public static function on_ajax_action()
 {
     try {
         $token = self::getPostVar('token', false);
         //verify the token
         $isVerified = wp_verify_nonce($token, 'Essential_Grid_actions');
         $error = false;
         if ($isVerified) {
             $data = self::getPostVar("data", false);
             switch (self::getPostVar("client_action", false)) {
                 case 'add_google_fonts':
                     $f = new ThemePunch_Fonts();
                     $result = $f->add_new_font($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Font successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getFontsUrl()));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'remove_google_fonts':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('Font not found', EG_TEXTDOMAIN), false);
                     }
                     $f = new ThemePunch_Fonts();
                     $result = $f->remove_font_by_handle($data['handle']);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Font successfully removed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'edit_google_fonts':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false);
                     }
                     if (!isset($data['url'])) {
                         Essential_Grid::ajaxResponseError(__('No parameters given', EG_TEXTDOMAIN), false);
                     }
                     $f = new ThemePunch_Fonts();
                     $result = $f->edit_font_by_handle($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Font successfully changed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'add_custom_meta':
                     $m = new Essential_Grid_Meta();
                     $result = $m->add_new_meta($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Meta successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getSubViewUrl(Essential_Grid_Admin::VIEW_SUB_CUSTOM_META_AJAX)));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'remove_custom_meta':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('Meta not found', EG_TEXTDOMAIN), false);
                     }
                     $m = new Essential_Grid_Meta();
                     $result = $m->remove_meta_by_handle($data['handle']);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Meta successfully removed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'edit_custom_meta':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false);
                     }
                     if (!isset($data['name'])) {
                         Essential_Grid::ajaxResponseError(__('No name given', EG_TEXTDOMAIN), false);
                     }
                     $m = new Essential_Grid_Meta();
                     $result = $m->edit_meta_by_handle($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Meta successfully changed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'add_link_meta':
                     $m = new Essential_Grid_Meta_Linking();
                     $result = $m->add_new_link_meta($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Meta successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getSubViewUrl(Essential_Grid_Admin::VIEW_SUB_CUSTOM_META_AJAX)));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'remove_link_meta':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('Meta not found', EG_TEXTDOMAIN), false);
                     }
                     $m = new Essential_Grid_Meta_Linking();
                     $result = $m->remove_link_meta_by_handle($data['handle']);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Meta successfully removed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'edit_link_meta':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false);
                     }
                     if (!isset($data['name'])) {
                         Essential_Grid::ajaxResponseError(__('No name given', EG_TEXTDOMAIN), false);
                     }
                     if (!isset($data['original'])) {
                         Essential_Grid::ajaxResponseError(__('No original given', EG_TEXTDOMAIN), false);
                     }
                     $m = new Essential_Grid_Meta_Linking();
                     $result = $m->edit_link_meta_by_handle($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Meta successfully changed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'add_widget_area':
                     $wa = new Essential_Grid_Widget_Areas();
                     $result = $wa->add_new_sidebar($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Widget Area successfully created!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getSubViewUrl(Essential_Grid_Admin::VIEW_SUB_WIDGET_AREA_AJAX)));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'edit_widget_area':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('No handle given', EG_TEXTDOMAIN), false);
                     }
                     if (!isset($data['name'])) {
                         Essential_Grid::ajaxResponseError(__('No name given', EG_TEXTDOMAIN), false);
                     }
                     $wa = new Essential_Grid_Widget_Areas();
                     $result = $wa->edit_widget_area_by_handle($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Widget Area successfully changed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'remove_widget_area':
                     if (!isset($data['handle'])) {
                         Essential_Grid::ajaxResponseError(__('Widget Area not found', EG_TEXTDOMAIN), false);
                     }
                     $wa = new Essential_Grid_Widget_Areas();
                     $result = $wa->remove_widget_area_by_handle($data['handle']);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Widget Area successfully removed!", EG_TEXTDOMAIN), array('data' => $result));
                     } else {
                         Essential_Grid::ajaxResponseError($result, false);
                     }
                     break;
                 case 'get_preview_html_markup':
                     //add wpml transient
                     $lang_code = '';
                     if (Essential_Grid_Wpml::is_wpml_exists()) {
                         $lang_code = Essential_Grid_Wpml::get_current_lang_code();
                     }
                     if (isset($data['id'])) {
                         delete_transient('ess_grid_trans_query_' . $data['id'] . $lang_code);
                         //delete cache
                     }
                     $result = Essential_Grid_Base::output_demo_skin_html($data);
                     if (isset($result['error'])) {
                         Essential_Grid::ajaxResponseData($result);
                     } else {
                         Essential_Grid::ajaxResponseData(array("data" => array('html' => $result['html'], 'preview' => @$result['preview'])));
                     }
                     break;
                     /* //TP: CHUNK
                     			case 'get_preview_html_markup_chunk': //only for custom grid
                     				$grid = new Essential_Grid();
                     				$grid->init_by_data($data);
                     				
                     				$html = '';
                     				
                     				if($grid->is_custom_grid()){
                     					ob_start();
                     					$grid->output_by_custom('custom', true);
                     					$html = ob_get_contents();
                     					ob_clean();
                     					ob_end_clean();
                     				}
                     				$order_id = self::getPostVar("order_id", false);
                     				
                     				Essential_Grid::ajaxResponseData(array("data"=>array('preview' => $html, 'order_id' => $order_id)));
                     				
                     			break; */
                 /* //TP: CHUNK
                 			case 'get_preview_html_markup_chunk': //only for custom grid
                 				$grid = new Essential_Grid();
                 				$grid->init_by_data($data);
                 				
                 				$html = '';
                 				
                 				if($grid->is_custom_grid()){
                 					ob_start();
                 					$grid->output_by_custom('custom', true);
                 					$html = ob_get_contents();
                 					ob_clean();
                 					ob_end_clean();
                 				}
                 				$order_id = self::getPostVar("order_id", false);
                 				
                 				Essential_Grid::ajaxResponseData(array("data"=>array('preview' => $html, 'order_id' => $order_id)));
                 				
                 			break; */
                 case 'save_search_settings':
                     if (!empty($data)) {
                         update_option('esg-search-settings', $data);
                     }
                     Essential_Grid::ajaxResponseSuccess(__("Search Settings succesfully saved!", EG_TEXTDOMAIN));
                     break;
                 case 'update_general_settings':
                     $result = self::savePluginPermission($data['permission']);
                     $cur_query = get_option('tp_eg_query_type', 'wp_query');
                     update_option('tp_eg_output_protection', @$data['protection']);
                     update_option('tp_eg_tooltips', @$data['tooltips']);
                     update_option('tp_eg_wait_for_fonts', @$data['wait_for_fonts']);
                     update_option('tp_eg_js_to_footer', @$data['js_to_footer']);
                     update_option('tp_eg_use_cache', @$data['use_cache']);
                     update_option('tp_eg_query_type', @$data['query_type']);
                     update_option('tp_eg_enable_log', @$data['enable_log']);
                     update_option('tp_eg_use_lightbox', @$data['use_lightbox']);
                     if (@$data['use_lightbox'] === 'jackbox') {
                         Essential_Grid_Jackbox::enable_jackbox();
                     } else {
                         Essential_Grid_Jackbox::disable_jackbox();
                     }
                     if ($cur_query !== $data['query_type']) {
                         //delete cache
                         $lang = array();
                         if (Essential_Grid_Wpml::is_wpml_exists()) {
                             $lang = icl_get_languages();
                         }
                         $grids = Essential_Grid::get_essential_grids();
                         if (!empty($grids)) {
                             foreach ($grids as $grid) {
                                 if (!empty($lang)) {
                                     foreach ($lang as $code => $val) {
                                         delete_transient('ess_grid_trans_query_' . $grid->id . $val['language_code']);
                                         delete_transient('ess_grid_trans_full_grid_' . $grid->id . $val['language_code']);
                                     }
                                 } else {
                                     delete_transient('ess_grid_trans_query_' . $grid->id);
                                     delete_transient('ess_grid_trans_full_grid_' . $grid->id);
                                 }
                             }
                         }
                     }
                     if ($result !== true) {
                         $error = __("Global Settings did not change!", EG_TEXTDOMAIN);
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Global Settings succesfully saved!", EG_TEXTDOMAIN), $result);
                     }
                     break;
                 case 'update_create_grid':
                     $result = self::update_create_grid($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         $lang = array();
                         if (Essential_Grid_Wpml::is_wpml_exists()) {
                             $lang = icl_get_languages();
                         }
                         if (isset($data['id']) && intval($data['id']) > 0) {
                             if (!empty($lang)) {
                                 foreach ($lang as $code => $val) {
                                     delete_transient('ess_grid_trans_query_' . $data['id'] . $val['language_code']);
                                     //delete cache
                                     delete_transient('ess_grid_trans_full_grid_' . $data['id'] . $val['language_code']);
                                     //delete cache
                                 }
                             } else {
                                 delete_transient('ess_grid_trans_query_' . $data['id']);
                                 //delete cache
                                 delete_transient('ess_grid_trans_full_grid_' . $data['id']);
                                 //delete cache
                             }
                             Essential_Grid::ajaxResponseSuccess(__("Grid successfully saved/changed!", EG_TEXTDOMAIN), $result);
                         } else {
                             Essential_Grid::ajaxResponseSuccess(__("Grid successfully saved/changed!", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl(Essential_Grid_Admin::VIEW_OVERVIEW)));
                         }
                     }
                     break;
                 case 'delete_grid':
                     $result = self::delete_grid_by_id($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Grid deleted", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl(Essential_Grid_Admin::VIEW_OVERVIEW)));
                     }
                     break;
                 case 'duplicate_grid':
                     $result = self::duplicate_grid_by_id($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Grid duplicated", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl(Essential_Grid_Admin::VIEW_OVERVIEW)));
                     }
                     break;
                 case 'update_create_item_skin':
                     $result = Essential_Grid_Item_Skin::update_save_item_skin($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         if (isset($data['id']) && intval($data['id']) > 0) {
                             Essential_Grid::ajaxResponseSuccess(__("Item Skin changed", EG_TEXTDOMAIN), array('data' => $result));
                         } else {
                             Essential_Grid::ajaxResponseSuccess(__("Item Skin created/changed", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_SUB_ITEM_SKIN_OVERVIEW)));
                         }
                     }
                     break;
                 case 'update_custom_css':
                     if (isset($data['global_css'])) {
                         Essential_Grid_Global_Css::set_global_css_styles($data['global_css']);
                         Essential_Grid::ajaxResponseSuccess(__("CSS saved!", EG_TEXTDOMAIN), '');
                     } else {
                         $error = __("No CSS Received", EG_TEXTDOMAIN);
                     }
                     break;
                 case 'delete_item_skin':
                     $result = Essential_Grid_Item_Skin::delete_item_skin_by_id($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Item Skin deleted", EG_TEXTDOMAIN), array('data' => $result));
                     }
                     break;
                 case 'duplicate_item_skin':
                     $result = Essential_Grid_Item_Skin::duplicate_item_skin_by_id($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Item Skin duplicated", EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_SUB_ITEM_SKIN_OVERVIEW)));
                     }
                     break;
                 case 'star_item_skin':
                     $result = Essential_Grid_Item_Skin::star_item_skin_by_id($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Favorite Changed", EG_TEXTDOMAIN), array('data' => $result));
                     }
                     break;
                 case 'update_create_item_element':
                     $result = Essential_Grid_Item_Element::update_create_essential_item_element($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Item Element created/changed", EG_TEXTDOMAIN), array('data' => $result));
                     }
                     break;
                 case 'check_item_element_existence':
                     $result = Essential_Grid_Item_Element::check_existence_by_handle(@$data['name']);
                     if ($result === false) {
                         Essential_Grid::ajaxResponseData(array("data" => array('existence' => 'false')));
                     } elseif ($result === true) {
                         Essential_Grid::ajaxResponseData(array("data" => array('existence' => 'true')));
                     } else {
                         Essential_Grid::ajaxResponseData(array("data" => array('existence' => $result)));
                     }
                     break;
                 case 'get_predefined_elements':
                     $elements = Essential_Grid_Item_Element::getElementsForJavascript();
                     $html_elements = Essential_Grid_Item_Element::prepareDefaultElementsForEditor();
                     $html_elements .= Essential_Grid_Item_Element::prepareTextElementsForEditor();
                     Essential_Grid::ajaxResponseData(array("data" => array('elements' => $elements, 'html' => $html_elements)));
                     break;
                 case 'delete_predefined_elements':
                     $result = Essential_Grid_Item_Element::delete_element_by_handle($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         Essential_Grid::ajaxResponseSuccess(__("Item Element successfully deleted", EG_TEXTDOMAIN), array('data' => $result));
                     }
                     break;
                 case 'update_create_navigation_skin_css':
                     $nav = new Essential_Grid_Navigation();
                     $result = $nav->update_create_navigation_skin_css($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         $base = new Essential_Grid_Base();
                         $skin_css = Essential_Grid_Navigation::output_navigation_skins();
                         $skins = Essential_Grid_Navigation::get_essential_navigation_skins();
                         $select = '';
                         foreach ($skins as $skin) {
                             $select .= '<option value="' . $skin['handle'] . '">' . $skin['name'] . '</option>' . "\n";
                         }
                         if (isset($data['sid']) && intval($data['sid']) > 0) {
                             Essential_Grid::ajaxResponseSuccess(__("Navigation Skin successfully changed!", EG_TEXTDOMAIN), array('css' => $skin_css, 'select' => $select, 'default_skins' => $skins));
                         } else {
                             Essential_Grid::ajaxResponseSuccess(__("Navigation Skin successfully created", EG_TEXTDOMAIN), array('css' => $skin_css, 'select' => $select, 'default_skins' => $skins));
                         }
                     }
                     break;
                 case 'delete_navigation_skin_css':
                     $nav = new Essential_Grid_Navigation();
                     $result = $nav->delete_navigation_skin_css($data);
                     if ($result !== true) {
                         $error = $result;
                     } else {
                         $base = new Essential_Grid_Base();
                         $skin_css = Essential_Grid_Navigation::output_navigation_skins();
                         $skins = Essential_Grid_Navigation::get_essential_navigation_skins();
                         $select = '';
                         foreach ($skins as $skin) {
                             $select .= '<option value="' . $skin['handle'] . '">' . $skin['name'] . '</option>' . "\n";
                         }
                         Essential_Grid::ajaxResponseSuccess(__("Navigation Skin successfully deleted!", EG_TEXTDOMAIN), array('css' => $skin_css, 'select' => $select, 'default_skins' => $skins));
                     }
                     break;
                 case 'get_post_meta_html_for_editor':
                     if (!isset($data['post_id']) || intval($data['post_id']) == 0) {
                         Essential_Grid::ajaxResponseError(__('No Post ID/Wrong Post ID!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     if (!isset($data['grid_id']) || intval($data['grid_id']) == 0) {
                         Essential_Grid::ajaxResponseError(__('Please save the grid first to use this feature!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     $post = get_post($data['post_id']);
                     $disable_advanced = true;
                     //nessecary, so that only normal things can be changed in preview mode
                     if (!empty($post)) {
                         $grid_id = $data['grid_id'];
                         ob_start();
                         require 'views/elements/grid-meta-box.php';
                         $content = ob_get_contents();
                         ob_clean();
                         ob_end_clean();
                         Essential_Grid::ajaxResponseData(array("data" => array('html' => $content)));
                     } else {
                         Essential_Grid::ajaxResponseError(__('Post not found!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     break;
                 case 'update_post_meta_through_editor':
                     if (!isset($data['metas']) || !isset($data['metas']['post_id']) || intval($data['metas']['post_id']) == 0) {
                         Essential_Grid::ajaxResponseError(__('No Post ID/Wrong Post ID!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     if (!isset($data['metas']) || !isset($data['metas']['grid_id']) || intval($data['metas']['grid_id']) == 0) {
                         Essential_Grid::ajaxResponseError(__('Please save the grid first to use this feature!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     //set the cobbles setting to the post
                     $cobbles = json_decode(get_post_meta($data['metas']['post_id'], 'eg_cobbles', true), true);
                     $cobbles[$data['metas']['grid_id']]['cobbles'] = $data['metas']['eg_cobbles_size'];
                     $cobbles = json_encode($cobbles);
                     update_post_meta($data['metas']['post_id'], 'eg_cobbles', $cobbles);
                     //set the use_skin setting to the post
                     $use_skin = json_decode(get_post_meta($data['metas']['post_id'], 'eg_use_skin', true), true);
                     $use_skin[$data['metas']['grid_id']]['use-skin'] = $data['metas']['eg_use_skin'];
                     $use_skin = json_encode($use_skin);
                     update_post_meta($data['metas']['post_id'], 'eg_use_skin', $use_skin);
                     $result = self::custom_meta_box_save($data['metas']['post_id'], $data['metas'], true);
                     self::check_for_transient_deletion($data['metas']['post_id']);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__("Post Meta saved!", EG_TEXTDOMAIN), array());
                     } else {
                         Essential_Grid::ajaxResponseError(__('Post not found!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     break;
                 case 'trigger_post_meta_visibility':
                     if (!isset($data['post_id']) || intval($data['post_id']) == 0) {
                         Essential_Grid::ajaxResponseError(__('No Post ID/Wrong Post ID!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     if (!isset($data['grid_id']) || intval($data['grid_id']) == 0) {
                         Essential_Grid::ajaxResponseError(__('Please save the grid first to use this feature!', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     $visibility = json_decode(get_post_meta($data['post_id'], 'eg_visibility', true), true);
                     $found = false;
                     if (!empty($visibility) && is_array($visibility)) {
                         foreach ($visibility as $grid => $setting) {
                             if ($grid == $data['grid_id']) {
                                 if ($setting == false) {
                                     $visibility[$grid] = true;
                                 } else {
                                     $visibility[$grid] = false;
                                 }
                                 $found = true;
                                 break;
                             }
                         }
                     }
                     if (!$found) {
                         $visibility[$data['grid_id']] = false;
                     }
                     $visibility = json_encode($visibility);
                     update_post_meta($data['post_id'], 'eg_visibility', $visibility);
                     self::check_for_transient_deletion($data['post_id']);
                     Essential_Grid::ajaxResponseSuccess(__("Visibility of Post for this Grid changed!", EG_TEXTDOMAIN), array());
                     break;
                 case 'get_image_by_id':
                     if (!isset($data['img_id']) || intval($data['img_id']) == 0) {
                         $error = __('Wrong Image ID given', EG_TEXTDOMAIN);
                     } else {
                         $img = wp_get_attachment_image_src($data['img_id'], 'full');
                         if ($img !== false) {
                             Essential_Grid::ajaxResponseSuccess('', array('url' => $img[0]));
                         } else {
                             $error = __('Image with given ID does not exist', EG_TEXTDOMAIN);
                         }
                     }
                     break;
                 case 'activate_purchase_code':
                     $result = false;
                     if (!empty($data['username']) && !empty($data['api_key']) && !empty($data['code'])) {
                         $result = Essential_Grid_Admin::check_purchase_verification($data);
                     } else {
                         $error = __('The API key, the Purchase Code and the Username need to be set!', EG_TEXTDOMAIN);
                     }
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__('Purchase Code Successfully Activated', EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_START)));
                     } else {
                         if ($result !== false) {
                             $error = $result;
                         } else {
                             $error = __('Purchase Code is invalid', EG_TEXTDOMAIN);
                         }
                         Essential_Grid::ajaxResponseError($error, false);
                         exit;
                     }
                     break;
                 case 'deactivate_purchase_code':
                     $result = Essential_Grid_Admin::do_purchase_deactivation($data);
                     if ($result === true) {
                         Essential_Grid::ajaxResponseSuccess(__('Successfully removed validation', EG_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_START)));
                     } else {
                         if ($result !== false) {
                             $error = $result;
                         } else {
                             $error = __('Could not remove Validation!', EG_TEXTDOMAIN);
                         }
                         Essential_Grid::ajaxResponseError($error, false);
                         exit;
                     }
                     break;
                 case 'dismiss_notice':
                     update_option('tp_eg_valid-notice', 'false');
                     Essential_Grid::ajaxResponseSuccess('.');
                     break;
                 case 'import_default_post_data':
                     try {
                         require EG_PLUGIN_PATH . 'includes/assets/default-posts.php';
                         require EG_PLUGIN_PATH . 'includes/assets/default-grids-meta-fonts.php';
                         if (isset($json_tax)) {
                             $import_tax = new PunchPost();
                             $import_tax->import_taxonomies($json_tax);
                         }
                         //insert meta, grids & punchfonts
                         $im = new Essential_Grid_Import();
                         if (isset($tp_grid_meta_fonts)) {
                             $tp_grid_meta_fonts = json_decode($tp_grid_meta_fonts, true);
                             $grids = @$tp_grid_meta_fonts['grids'];
                             if (!empty($grids) && is_array($grids)) {
                                 $grids_imported = $im->import_grids($grids);
                             }
                             $custom_metas = @$tp_grid_meta_fonts['custom-meta'];
                             if (!empty($custom_metas) && is_array($custom_metas)) {
                                 $custom_metas_imported = $im->import_custom_meta($custom_metas);
                             }
                             $custom_fonts = @$tp_grid_meta_fonts['punch-fonts'];
                             if (!empty($custom_fonts) && is_array($custom_fonts)) {
                                 $custom_fonts_imported = $im->import_punch_fonts($custom_fonts);
                             }
                         }
                         if (isset($json_posts)) {
                             $import = new PunchPort();
                             $import->set_tp_import_posts($json_posts);
                             $import->import_custom_posts();
                         }
                         Essential_Grid::ajaxResponseSuccess(__('Demo data successfully imported', EG_TEXTDOMAIN), array());
                     } catch (Exception $d) {
                         $error = __('Something went wrong, please contact the developer', EG_TEXTDOMAIN);
                     }
                     break;
                 case 'export_data':
                     $export_grids = self::getPostVar('export-grids-id', false);
                     $export_skins = self::getPostVar('export-skins-id', false);
                     $export_elements = self::getPostVar('export-elements-id', false);
                     $export_navigation_skins = self::getPostVar('export-navigation-skins-id', false);
                     $export_global_styles = self::getPostVar('export-global-styles', false);
                     $export_custom_meta = self::getPostVar('export-custom-meta-handle', false);
                     $export_punch_fonts = self::getPostVar('export-punch-fonts-handle', false);
                     header('Content-Type: text/json');
                     header('Content-Disposition: attachment;filename=ess_grid.json');
                     ob_start();
                     $export = array();
                     $ex = new Essential_Grid_Export();
                     //export Grids
                     if (!empty($export_grids)) {
                         $export['grids'] = $ex->export_grids($export_grids);
                     }
                     //export Skins
                     if (!empty($export_skins)) {
                         $export['skins'] = $ex->export_skins($export_skins);
                     }
                     //export Elements
                     if (!empty($export_elements)) {
                         $export['elements'] = $ex->export_elements($export_elements);
                     }
                     //export Navigation Skins
                     if (!empty($export_navigation_skins)) {
                         $export['navigation-skins'] = $ex->export_navigation_skins($export_navigation_skins);
                     }
                     //export Custom Meta
                     if (!empty($export_custom_meta)) {
                         $export['custom-meta'] = $ex->export_custom_meta($export_custom_meta);
                     }
                     //export Punch Fonts
                     if (!empty($export_punch_fonts)) {
                         $export['punch-fonts'] = $ex->export_punch_fonts($export_punch_fonts);
                     }
                     //export Global Styles
                     if ($export_global_styles == 'on') {
                         $export['global-css'] = $ex->export_global_styles($export_global_styles);
                     }
                     echo json_encode($export);
                     $content = ob_get_contents();
                     ob_clean();
                     ob_end_clean();
                     echo $content;
                     exit;
                     break;
                 case 'import_data':
                     if (!isset($data['imports']) || empty($data['imports'])) {
                         Essential_Grid::ajaxResponseError(__('No data for import selected', EG_TEXTDOMAIN), false);
                         exit;
                     }
                     try {
                         $im = new Essential_Grid_Import();
                         $temp_d = @$data['imports'];
                         unset($temp_d['data-grids']);
                         unset($temp_d['data-skins']);
                         unset($temp_d['data-elements']);
                         unset($temp_d['data-navigation-skins']);
                         unset($temp_d['data-global-css']);
                         $im->set_overwrite_data($temp_d);
                         //set overwrite data global to class
                         $skins = @$data['imports']['data-skins'];
                         if (!empty($skins) && is_array($skins)) {
                             foreach ($skins as $key => $skin) {
                                 $tskin = json_decode(stripslashes($skin), true);
                                 if (empty($tskin)) {
                                     $tskin = json_decode($skin, true);
                                 }
                                 $skins[$key] = $tskin;
                             }
                             if (!empty($skins)) {
                                 $skins_ids = @$data['imports']['import-skins-id'];
                                 $skins_imported = $im->import_skins($skins, $skins_ids);
                             }
                         }
                         $navigation_skins = @$data['imports']['data-navigation-skins'];
                         if (!empty($navigation_skins) && is_array($navigation_skins)) {
                             foreach ($navigation_skins as $key => $navigation_skin) {
                                 $tnavigation_skin = json_decode(stripslashes($navigation_skin), true);
                                 if (empty($tnavigation_skin)) {
                                     $tnavigation_skin = json_decode($navigation_skin, true);
                                 }
                                 $navigation_skins[$key] = $tnavigation_skin;
                             }
                             if (!empty($navigation_skins)) {
                                 $navigation_skins_ids = @$data['imports']['import-navigation-skins-id'];
                                 $navigation_skins_imported = $im->import_navigation_skins(@$navigation_skins, $navigation_skins_ids);
                             }
                         }
                         $grids = @$data['imports']['data-grids'];
                         if (!empty($grids) && is_array($grids)) {
                             foreach ($grids as $key => $grid) {
                                 $tgrid = json_decode(stripslashes($grid), true);
                                 if (empty($tgrid)) {
                                     $tgrid = json_decode($grid, true);
                                 }
                                 $grids[$key] = $tgrid;
                             }
                             if (!empty($grids)) {
                                 $grids_ids = @$data['imports']['import-grids-id'];
                                 $grids_imported = $im->import_grids($grids, $grids_ids);
                             }
                         }
                         $elements = @$data['imports']['data-elements'];
                         if (!empty($elements) && is_array($elements)) {
                             foreach ($elements as $key => $element) {
                                 $telement = json_decode(stripslashes($element), true);
                                 if (empty($telement)) {
                                     $telement = json_decode($element, true);
                                 }
                                 $elements[$key] = $telement;
                             }
                             if (!empty($elements)) {
                                 $elements_ids = @$data['imports']['import-elements-id'];
                                 $elements_imported = $im->import_elements(@$elements, $elements_ids);
                             }
                         }
                         $custom_metas = @$data['imports']['data-custom-meta'];
                         if (!empty($custom_metas) && is_array($custom_metas)) {
                             foreach ($custom_metas as $key => $custom_meta) {
                                 $tcustom_meta = json_decode(stripslashes($custom_meta), true);
                                 if (empty($tcustom_meta)) {
                                     $tcustom_meta = json_decode($custom_meta, true);
                                 }
                                 $custom_metas[$key] = $tcustom_meta;
                             }
                             if (!empty($custom_metas)) {
                                 $custom_metas_handle = @$data['imports']['import-custom-meta-handle'];
                                 $custom_metas_imported = $im->import_custom_meta($custom_metas, $custom_metas_handle);
                             }
                         }
                         $custom_fonts = @$data['imports']['data-punch-fonts'];
                         if (!empty($custom_fonts) && is_array($custom_fonts)) {
                             foreach ($custom_fonts as $key => $custom_font) {
                                 $tcustom_font = json_decode(stripslashes($custom_font), true);
                                 if (empty($tcustom_font)) {
                                     $tcustom_font = json_decode($custom_font, true);
                                 }
                                 $custom_fonts[$key] = $tcustom_font;
                             }
                             if (!empty($custom_fonts)) {
                                 $custom_fonts_handle = @$data['imports']['import-punch-fonts-handle'];
                                 $custom_fonts_imported = $im->import_punch_fonts($custom_fonts, $custom_fonts_handle);
                             }
                         }
                         if (@$data['imports']['import-global-styles'] == 'on') {
                             $global_css = @$data['imports']['data-global-css'];
                             $tglobal_css = stripslashes($global_css);
                             if (empty($tglobal_css)) {
                                 $tglobal_css = $global_css;
                             }
                             $global_styles_imported = $im->import_global_styles($tglobal_css);
                         }
                         Essential_Grid::ajaxResponseSuccess(__('Successfully imported data', EG_TEXTDOMAIN), array('is_redirect' => true, 'redirect_url' => self::getViewUrl("", "", 'essential-' . Essential_Grid_Admin::VIEW_START)));
                     } catch (Exception $d) {
                         $error = __('Something went wrong, please contact the developer', EG_TEXTDOMAIN);
                     }
                     break;
                 case 'delete_full_cache':
                     $lang = array();
                     if (Essential_Grid_Wpml::is_wpml_exists()) {
                         $lang = icl_get_languages();
                     }
                     $grids = Essential_Grid::get_essential_grids();
                     if (!empty($grids)) {
                         foreach ($grids as $grid) {
                             if (!empty($lang)) {
                                 foreach ($lang as $code => $val) {
                                     delete_transient('ess_grid_trans_query_' . $grid->id . $val['language_code']);
                                     delete_transient('ess_grid_trans_full_grid_' . $grid->id . $val['language_code']);
                                 }
                             } else {
                                 delete_transient('ess_grid_trans_query_' . $grid->id);
                                 delete_transient('ess_grid_trans_full_grid_' . $grid->id);
                             }
                         }
                     }
                     Essential_Grid::ajaxResponseSuccess(__('Successfully deleted all cache', EG_TEXTDOMAIN), array());
                     break;
                 case "get_image_url":
                     if (isset($data['imageid']) && intval($data['imageid']) > 0) {
                         $img_atts = wp_get_attachment_image_src($data['imageid']);
                         if ($img_atts !== false) {
                             $img_src = $img_atts[0];
                             Essential_Grid::ajaxResponseSuccess(__("Image URL found", EG_TEXTDOMAIN), array('url' => $img_src, 'imageid' => $data['imageid']));
                         }
                     }
                     $error = __('No correct image ID given', EG_TEXTDOMAIN);
                     break;
                 case "toggle_grid_favorite":
                     if (isset($data['id']) && intval($data['id']) > 0) {
                         $return = self::toggle_favorite_by_id($data['id']);
                         if ($return === true) {
                             Essential_Grid::ajaxResponseSuccess(__("Favorite Set", EG_TEXTDOMAIN));
                         } else {
                             $error = $return;
                         }
                     } else {
                         $error = __('No ID given', EG_TEXTDOMAIN);
                     }
                     break;
                 case "subscribe_to_newsletter":
                     if (isset($data['email']) && !empty($data['email'])) {
                         $return = ThemePunch_Newsletter::subscribe($data['email']);
                         if ($return !== false) {
                             if (!isset($return['status']) || $return['status'] === 'error') {
                                 $error = isset($return['message']) && !empty($return['message']) ? $return['message'] : __('Invalid Email', EG_TEXTDOMAIN);
                             } else {
                                 Essential_Grid::ajaxResponseSuccess(__("Success! Please check your Emails to finish the subscribtion", EG_TEXTDOMAIN), $return);
                             }
                         } else {
                             $error = __('Invalid Email/Could not connect to the Newsletter server', EG_TEXTDOMAIN);
                         }
                     } else {
                         $error = __('No Email given', EG_TEXTDOMAIN);
                     }
                     break;
                 case "unsubscribe_to_newsletter":
                     if (isset($data['email']) && !empty($data['email'])) {
                         $return = ThemePunch_Newsletter::unsubscribe($data['email']);
                         if ($return !== false) {
                             if (!isset($return['status']) || $return['status'] === 'error') {
                                 $error = isset($return['message']) && !empty($return['message']) ? $return['message'] : __('Invalid Email', EG_TEXTDOMAIN);
                             } else {
                                 Essential_Grid::ajaxResponseSuccess(__("Success! Please check your Emails to finish the process", EG_TEXTDOMAIN), $return);
                             }
                         } else {
                             $error = __('Invalid Email/Could not connect to the Newsletter server', EG_TEXTDOMAIN);
                         }
                     } else {
                         $error = __('No Email given', EG_TEXTDOMAIN);
                     }
                     break;
                 default:
                     $error = true;
                     break;
             }
         } else {
             $error = true;
         }
         if ($error !== false) {
             $showError = __("Wrong Request!", EG_TEXTDOMAIN);
             if ($error !== true) {
                 $showError = __("Ajax Error: ", EG_TEXTDOMAIN) . $error;
             }
             Essential_Grid::ajaxResponseError($showError, false);
         }
         exit;
     } catch (Exception $e) {
         exit;
     }
 }
Ejemplo n.º 6
0
<?php

if (!defined('ABSPATH')) {
    exit;
}
//force the js file to be included
wp_enqueue_script('essential-grid-item-editor-script', plugins_url('../../assets/js/grid-editor.js', __FILE__), array('jquery'), Essential_Grid::VERSION);
$base = new Essential_Grid_Base();
$item_elements = new Essential_Grid_Item_Element();
$meta = new Essential_Grid_Meta();
$meta_link = new Essential_Grid_Meta_Linking();
$fonts = new ThemePunch_Fonts();
//check if id exists and get data from database if so.
$skin = false;
$skin_id = false;
$isCreate = $base->getGetVar('create', 'true');
$title = __('Create New Item Skin', EG_TEXTDOMAIN);
$save = __('Save Item Skin', EG_TEXTDOMAIN);
if (intval($isCreate) > 0) {
    //currently editing
    $skin = Essential_Grid_Item_Skin::get_essential_item_skin_by_id(intval($isCreate));
    if (!empty($skin)) {
        $title = __('Change Item Skin', EG_TEXTDOMAIN);
        $save = __('Change Item Skin', EG_TEXTDOMAIN);
        $skin_id = intval($isCreate);
    }
}
$elements = $item_elements->getElementsForJavascript();
$style_attributes = $item_elements->get_existing_elements(true);
$all_attributes = $item_elements->get_existing_elements();
$element_type = $item_elements->getElementsForDropdown();
Ejemplo n.º 7
0
 public function output_grid_javascript($load_lightbox = false, $is_demo = false)
 {
     $base = new Essential_Grid_Base();
     $hide_markup_before_load = $base->getVar($this->grid_params, 'hide-markup-before-load', 'off');
     $layout = $base->getVar($this->grid_params, 'layout', 'even');
     $force_full_width = $base->getVar($this->grid_params, 'force_full_width', 'off');
     $content_push = $base->getVar($this->grid_params, 'content-push', 'off');
     $rows_unlimited = $base->getVar($this->grid_params, 'rows-unlimited', 'on');
     $load_more_type = $base->getVar($this->grid_params, 'load-more', 'on');
     $rows = $base->getVar($this->grid_params, 'rows', 4, 'i');
     $columns = $base->getVar($this->grid_params, 'columns', '');
     $columns = $base->set_basic_colums($columns);
     $columns_advanced = $base->getVar($this->grid_params, 'columns-advanced', 'off');
     if ($columns_advanced == 'on') {
         $columns_width = $base->getVar($this->grid_params, 'columns-width', '');
     } else {
         $columns_width = array();
         //get defaults
     }
     $columns_width = $base->set_basic_colums_width($columns_width);
     $space = $base->getVar($this->grid_params, 'spacings', 0, 'i');
     $page_animation = $base->getVar($this->grid_params, 'grid-animation', 'scale');
     $anim_speed = $base->getVar($this->grid_params, 'grid-animation-speed', 800, 'i');
     $delay_basic = $base->getVar($this->grid_params, 'grid-animation-delay', 1, 'i');
     $delay_hover = $base->getVar($this->grid_params, 'hover-animation-delay', 1, 'i');
     $filter_type = $base->getVar($this->grid_params, 'filter-arrows', 'single');
     $filter_logic = $base->getVar($this->grid_params, 'filter-logic', 'or');
     $filter_show_on = $base->getVar($this->grid_params, 'filter-show-on', 'hover');
     $lightbox_mode = $base->getVar($this->grid_params, 'lightbox-mode', 'single');
     $lightbox_mode = $lightbox_mode == 'content' || $lightbox_mode == 'content-gallery' || $lightbox_mode == 'woocommerce-gallery' ? 'contentgroup' : $lightbox_mode;
     $layout_sizing = $base->getVar($this->grid_params, 'layout-sizing', 'boxed');
     $layout_offset_container = $base->getVar($this->grid_params, 'fullscreen-offset-container', '');
     $aspect_ratio_x = $base->getVar($this->grid_params, 'x-ratio', 4, 'i');
     $aspect_ratio_y = $base->getVar($this->grid_params, 'y-ratio', 3, 'i');
     $lazy_load = $base->getVar($this->grid_params, 'lazy-loading', 'off');
     $lazy_load_color = $base->getVar($this->grid_params, 'lazy-load-color', '#FFFFFF');
     $spinner = $base->getVar($this->grid_params, 'use-spinner', '0');
     $spinner_color = $base->getVar($this->grid_params, 'spinner-color', '#FFFFFF');
     //LIGHTBOX VARIABLES
     $usetwitter = $base->getVar($this->grid_params, 'lightbox-twitter', 'off');
     $usefacebook = $base->getVar($this->grid_params, 'lightbox-facebook', 'off');
     $lightbox_title_type = $base->getVar($this->grid_params, 'lightbox-type', "null");
     $lightbox_position = $base->getVar($this->grid_params, 'lightbox-position', 'bottom');
     $lightbox_effect_open_close = $base->getVar($this->grid_params, 'lightbox-effect-open-close', 'fade');
     $lightbox_effect_next_prev = $base->getVar($this->grid_params, 'lightbox-effect-next-prev', 'fade');
     $lightbox_effect_open_close_speed = $base->getVar($this->grid_params, 'lightbox-effect-open-close-speed', 'normal');
     $lightbox_effect_next_prev_speed = $base->getVar($this->grid_params, 'lightbox-effect-next-prev-speed', 'normal');
     $lightbox_arrows = $base->getVar($this->grid_params, 'lightbox-arrows', 'on');
     $lightbox_thumbs = $base->getVar($this->grid_params, 'lightbox-thumbs', 'off');
     $lightbox_thumbs_w = $base->getVar($this->grid_params, 'lbox-thumb-w', '50');
     $lightbox_thumbs_h = $base->getVar($this->grid_params, 'lbox-thumb-h', '50');
     $linebreak = '\'<br />\'';
     $twitteraddon = '\'<a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="\'+this.href+\'">' . __('Tweet', EG_TEXTDOMAIN) . '</a>\'';
     $facebookaddon = '\'<iframe src="//www.facebook.com/plugins/like.php?href=\'+this.href+\'&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px;" allowTransparency="true"></iframe>\'';
     $lbox_padding = $base->getVar($this->grid_params, 'lbox-padding', array('0', '0', '0', '0'));
     $lbox_inpadding = $base->getVar($this->grid_params, 'lbox-inpadding', array('0', '0', '0', '0'));
     $rtl = $base->getVar($this->grid_params, 'rtl', 'off');
     $wait_for_fonts = get_option('tp_eg_wait_for_fonts', 'true');
     $pagination_numbers = $base->getVar($this->grid_params, 'pagination-numbers', 'smart');
     $pagination_scroll = $base->getVar($this->grid_params, 'pagination-scroll', 'off');
     $pagination_scroll_offset = $base->getVar($this->grid_params, 'pagination-scroll-offset', '0', 'i');
     $ajax_callback = $base->getVar($this->grid_params, 'ajax-callback', '');
     $ajax_css_url = $base->getVar($this->grid_params, 'ajax-css-url', '');
     $ajax_js_url = $base->getVar($this->grid_params, 'ajax-js-url', '');
     $ajax_scroll_onload = $base->getVar($this->grid_params, 'ajax-scroll-onload', 'on');
     $ajax_callback_argument = $base->getVar($this->grid_params, 'ajax-callback-arg', 'on');
     $ajax_content_id = $base->getVar($this->grid_params, 'ajax-container-id', '');
     $ajax_scrollto_offset = $base->getVar($this->grid_params, 'ajax-scrollto-offset', '0');
     $ajax_close_button = $base->getVar($this->grid_params, 'ajax-close-button', 'off');
     $ajax_button_nav = $base->getVar($this->grid_params, 'ajax-nav-button', 'off');
     $ajax_content_sliding = $base->getVar($this->grid_params, 'ajax-content-sliding', 'on');
     $ajax_button_type = $base->getVar($this->grid_params, 'ajax-button-type', 'button');
     if ($ajax_button_type == 'type2') {
         $ajax_button_text = $base->getVar($this->grid_params, 'ajax-button-text', __('Close', EG_TEXTDOMAIN));
     }
     $ajax_button_skin = $base->getVar($this->grid_params, 'ajax-button-skin', 'light');
     $ajax_button_inner = $base->getVar($this->grid_params, 'ajax-button-inner', 'false');
     $ajax_button_h_pos = $base->getVar($this->grid_params, 'ajax-button-h-pos', 'r');
     $ajax_button_v_pos = $base->getVar($this->grid_params, 'ajax-button-v-pos', 't');
     $cobbles_pattern = $base->getVar($this->grid_params, 'cobbles-pattern', array());
     $use_cobbles_pattern = $base->getVar($this->grid_params, 'use-cobbles-pattern', 'off');
     $cookie_time = intval($base->getVar($this->grid_params, 'cookie-save-time', '30'));
     $cookie_search = $base->getVar($this->grid_params, 'cookie-save-search', 'off');
     $cookie_filter = $base->getVar($this->grid_params, 'cookie-save-filter', 'off');
     $cookie_pagination = $base->getVar($this->grid_params, 'cookie-save-pagination', 'off');
     $js_to_footer = get_option('tp_eg_js_to_footer', 'false') == 'true' ? true : false;
     //add inline style into the footer
     if ($js_to_footer && $is_demo == false) {
         ob_start();
     }
     echo '<script type="text/javascript">' . "\n";
     if ($hide_markup_before_load == 'off') {
         echo 'function eggbfc(winw,resultoption) {' . "\n";
         echo '	var lasttop = winw,' . "\n";
         echo '	lastbottom = 0,' . "\n";
         echo '	smallest =9999,' . "\n";
         echo '	largest = 0,' . "\n";
         echo '	samount = 0,' . "\n";
         echo '	lamoung = 0,' . "\n";
         echo '	lastamount = 0,' . "\n";
         echo '	resultid = 0,' . "\n";
         echo '	resultidb = 0,' . "\n";
         echo '	responsiveEntries = [' . "\n";
         echo '						{ width:' . $columns_width['0'] . ',amount:' . $columns['0'] . '},' . "\n";
         echo '						{ width:' . $columns_width['1'] . ',amount:' . $columns['1'] . '},' . "\n";
         echo '						{ width:' . $columns_width['2'] . ',amount:' . $columns['2'] . '},' . "\n";
         echo '						{ width:' . $columns_width['3'] . ',amount:' . $columns['3'] . '},' . "\n";
         echo '						{ width:' . $columns_width['4'] . ',amount:' . $columns['4'] . '},' . "\n";
         echo '						{ width:' . $columns_width['5'] . ',amount:' . $columns['5'] . '},' . "\n";
         echo '						{ width:' . $columns_width['6'] . ',amount:' . $columns['6'] . '}' . "\n";
         echo '						];' . "\n";
         echo '	if (responsiveEntries!=undefined && responsiveEntries.length>0)' . "\n";
         echo '		jQuery.each(responsiveEntries, function(index,obj) {' . "\n";
         echo '			var curw = obj.width != undefined ? obj.width : 0,' . "\n";
         echo '				cura = obj.amount != undefined ? obj.amount : 0;' . "\n";
         echo '			if (smallest>curw) {' . "\n";
         echo '				smallest = curw;' . "\n";
         echo '				samount = cura;' . "\n";
         echo '				resultidb = index;' . "\n";
         echo '			}' . "\n";
         echo '			if (largest<curw) {' . "\n";
         echo '				largest = curw;' . "\n";
         echo '				lamount = cura;' . "\n";
         echo '			}' . "\n";
         echo '			if (curw>lastbottom && curw<=lasttop) {' . "\n";
         echo '				lastbottom = curw;' . "\n";
         echo '				lastamount = cura;' . "\n";
         echo '				resultid = index;' . "\n";
         echo '			}' . "\n";
         echo '		})' . "\n";
         echo '		if (smallest>winw) {' . "\n";
         echo '			lastamount = samount;' . "\n";
         echo '			resultid = resultidb;' . "\n";
         echo '		}' . "\n";
         echo '		var obj = new Object;' . "\n";
         echo '		obj.index = resultid;' . "\n";
         echo '		obj.column = lastamount;' . "\n";
         echo '		if (resultoption=="id")' . "\n";
         echo '			return obj;' . "\n";
         echo '		else' . "\n";
         echo '			return lastamount;' . "\n";
         echo '	}' . "\n";
         echo 'if ("' . $layout . '"=="even") {' . "\n";
         echo '	var coh=0,' . "\n";
         echo '		container = jQuery("#esg-grid-' . $this->grid_div_name . '-' . $this->grid_serial . '");' . "\n";
         if ($layout_sizing == 'fullscreen') {
             echo 'coh = jQuery(window).height();' . "\n";
             if ($layout_offset_container !== '') {
                 echo 'try{' . "\n";
                 echo '	var offcontainers = "' . $layout_offset_container . '".split(",");' . "\n";
                 echo '	jQuery.each(offcontainers,function(index,searchedcont) {' . "\n";
                 echo '		coh = coh - jQuery(searchedcont).outerHeight(true);' . "\n";
                 echo '	})' . "\n";
                 echo '} catch(e) {}' . "\n";
             }
         } else {
             echo '	var	cwidth = container.width(),' . "\n";
             echo '		ar = "' . $aspect_ratio_x . ':' . $aspect_ratio_y . '",' . "\n";
             echo '		gbfc = eggbfc(jQuery(window).width(),"id"),' . "\n";
             if ($rows_unlimited == 'on') {
                 echo '	row = 2;' . "\n";
             } else {
                 echo '	row = ' . $rows . ';' . "\n";
             }
             echo 'ar = ar.split(":");' . "\n";
             echo 'aratio=parseInt(ar[0],0) / parseInt(ar[1],0);' . "\n";
             echo 'coh = cwidth / aratio;' . "\n";
             echo 'coh = coh/gbfc.column*row;' . "\n";
         }
         echo '	var ul = container.find("ul").first();' . "\n";
         echo '	ul.css({display:"block",height:coh+"px"});' . "\n";
         echo '}' . "\n";
     }
     echo 'var essapi_' . $this->grid_api_name . ';' . "\n";
     echo 'jQuery(document).ready(function() {' . "\n";
     echo '	essapi_' . $this->grid_api_name . ' = jQuery("#esg-grid-' . $this->grid_div_name . '-' . $this->grid_serial . '").tpessential({' . "\n";
     echo '        gridID:' . $this->grid_id . ',' . "\n";
     echo '        layout:"' . $layout . '",' . "\n";
     if ($rtl == 'on') {
         echo '        rtl:"on",' . "\n";
     }
     echo '        forceFullWidth:"' . $force_full_width . '",' . "\n";
     echo '        lazyLoad:"' . $lazy_load . '",' . "\n";
     if ($lazy_load == 'on') {
         echo '        lazyLoadColor:"' . $lazy_load_color . '",' . "\n";
     }
     if ($rows_unlimited == 'on') {
         $load_more = $base->getVar($this->grid_params, 'load-more', 'button');
         $load_more_amount = $base->getVar($this->grid_params, 'load-more-amount', 3, 'i');
         $load_more_show_number = $base->getVar($this->grid_params, 'load-more-show-number', 'on');
         if ($load_more !== 'none') {
             $load_more_text = $base->getVar($this->grid_params, 'load-more-text', __('Load More', EG_TEXTDOMAIN));
             echo '        gridID:"' . $this->grid_id . '",' . "\n";
             echo '        loadMoreType:"' . $load_more . '",' . "\n";
             echo '        loadMoreAmount:' . $load_more_amount . ',' . "\n";
             echo '        loadMoreTxt:"' . $load_more_text . '",' . "\n";
             echo '        loadMoreNr:"' . $load_more_show_number . '",' . "\n";
             echo '        loadMoreEndTxt:"' . __('No More Items for the Selected Filter', EG_TEXTDOMAIN) . '",' . "\n";
             echo '        loadMoreItems:';
             $this->output_load_more_list();
             echo ',' . "\n";
         }
         echo '        row:9999,' . "\n";
     } else {
         echo '        row:' . $rows . ',' . "\n";
     }
     $token = wp_create_nonce('Essential_Grid_Front');
     echo '        loadMoreAjaxToken:"' . $token . '",' . "\n";
     echo '        loadMoreAjaxUrl:"' . admin_url('admin-ajax.php') . '",' . "\n";
     echo '        loadMoreAjaxAction:"Essential_Grid_Front_request_ajax",' . "\n";
     echo '        ajaxContentTarget:"' . $ajax_content_id . '",' . "\n";
     echo '        ajaxScrollToOffset:"' . $ajax_scrollto_offset . '",' . "\n";
     echo '        ajaxCloseButton:"' . $ajax_close_button . '",' . "\n";
     echo '        ajaxContentSliding:"' . $ajax_content_sliding . '",' . "\n";
     if ($ajax_callback !== '') {
         echo '        ajaxCallback:"' . stripslashes($ajax_callback) . '",' . "\n";
     }
     if ($ajax_css_url !== '') {
         echo '        ajaxCssUrl:"' . $ajax_css_url . '",' . "\n";
     }
     if ($ajax_js_url !== '') {
         echo '        ajaxJsUrl:"' . $ajax_js_url . '",' . "\n";
     }
     if ($ajax_scroll_onload !== 'off') {
         echo '        ajaxScrollToOnLoad:"on",' . "\n";
     }
     if ($ajax_callback_argument == 'on') {
         echo '        ajaxCallbackArgument:"on",' . "\n";
     }
     echo '        ajaxNavButton:"' . $ajax_button_nav . '",' . "\n";
     echo '        ajaxCloseType:"' . $ajax_button_type . '",' . "\n";
     if ($ajax_button_type == 'type2') {
         echo '        ajaxCloseTxt:"' . $ajax_button_text . '",' . "\n";
     }
     echo '        ajaxCloseInner:"' . $ajax_button_inner . '",' . "\n";
     echo '        ajaxCloseStyle:"' . $ajax_button_skin . '",' . "\n";
     $ajax_button_h_pos = $base->getVar($this->grid_params, 'ajax-button-h-pos', 'r');
     $ajax_button_v_pos = $base->getVar($this->grid_params, 'ajax-button-v-pos', 't');
     if ($ajax_button_h_pos == 'c') {
         echo '        ajaxClosePosition:"' . $ajax_button_v_pos . '",' . "\n";
     } else {
         echo '        ajaxClosePosition:"' . $ajax_button_v_pos . $ajax_button_h_pos . '",' . "\n";
     }
     echo '        space:' . $space . ',' . "\n";
     echo '        pageAnimation:"' . $page_animation . '",' . "\n";
     if ($pagination_numbers == 'full') {
         echo '        smartPagination:"off",' . "\n";
     }
     echo '        paginationScrollToTop:"' . $pagination_scroll . '",' . "\n";
     if ($pagination_scroll == 'on') {
         echo '        paginationScrollToOffset:' . $pagination_scroll_offset . ',' . "\n";
     }
     echo '        spinner:"spinner' . $spinner . '",' . "\n";
     if ($spinner != '0' && $spinner != '5') {
         echo '        spinnerColor:"' . $spinner_color . '",' . "\n";
     }
     if ($layout_sizing == 'fullwidth') {
         echo '        forceFullWidth:"on",' . "\n";
     } elseif ($layout_sizing == 'fullscreen') {
         echo '        forceFullScreen:"on",' . "\n";
         if ($layout_offset_container !== '') {
             echo '        fullScreenOffsetContainer:"' . $layout_offset_container . '",' . "\n";
         }
     }
     if ($layout == 'even') {
         echo '        evenGridMasonrySkinPusher:"' . $content_push . '",' . "\n";
     }
     echo '        lightBoxMode:"' . $lightbox_mode . '",' . "\n";
     if (!empty($cobbles_pattern) && $layout == 'cobbles' && $use_cobbles_pattern == 'on') {
         echo '        cobblesPattern:"' . implode(',', $cobbles_pattern) . '",' . "\n";
     }
     echo '        animSpeed:' . $anim_speed . ',' . "\n";
     echo '        delayBasic:' . $delay_basic . ',' . "\n";
     echo '        mainhoverdelay:' . $delay_hover . ',' . "\n";
     echo '        filterType:"' . $filter_type . '",' . "\n";
     if ($filter_type == 'multi') {
         echo '        filterLogic:"' . $filter_logic . '",' . "\n";
     }
     echo '        showDropFilter:"' . $filter_show_on . '",' . "\n";
     echo '        filterGroupClass:"esg-fgc-' . $this->grid_id . '",' . "\n";
     if ($wait_for_fonts === 'true') {
         $tf_fonts = new ThemePunch_Fonts();
         $fonts = $tf_fonts->get_all_fonts();
         if (!empty($fonts)) {
             $first = true;
             $font_string = '[';
             foreach ($fonts as $font) {
                 if ($first === false) {
                     $font_string .= ',';
                 }
                 $font_string .= "'" . esc_attr($font['url']) . "'";
                 $first = false;
             }
             $font_string .= ']';
             echo '        googleFonts:' . $font_string . ',' . "\n";
         }
     }
     if ($cookie_search === 'on' || $cookie_filter === 'on' || $cookie_pagination === 'on') {
         echo '        cookies: {' . "\n";
         if ($cookie_search == 'on') {
             echo '                search:"' . $cookie_search . '",' . "\n";
         }
         if ($cookie_filter == 'on') {
             echo '                filter:"' . $cookie_filter . '",' . "\n";
         }
         if ($cookie_pagination == 'on') {
             echo '                pagination:"' . $cookie_pagination . '",' . "\n";
         }
         echo '                timetosave:"' . $cookie_time . '"' . "\n";
         echo '        },' . "\n";
     }
     if ($layout != 'masonry') {
         echo '        aspectratio:"' . $aspect_ratio_x . ':' . $aspect_ratio_y . '",' . "\n";
     }
     echo '        responsiveEntries: [' . "\n";
     echo '						{ width:' . $columns_width['0'] . ',amount:' . $columns['0'] . '},' . "\n";
     echo '						{ width:' . $columns_width['1'] . ',amount:' . $columns['1'] . '},' . "\n";
     echo '						{ width:' . $columns_width['2'] . ',amount:' . $columns['2'] . '},' . "\n";
     echo '						{ width:' . $columns_width['3'] . ',amount:' . $columns['3'] . '},' . "\n";
     echo '						{ width:' . $columns_width['4'] . ',amount:' . $columns['4'] . '},' . "\n";
     echo '						{ width:' . $columns_width['5'] . ',amount:' . $columns['5'] . '},' . "\n";
     echo '						{ width:' . $columns_width['6'] . ',amount:' . $columns['6'] . '}' . "\n";
     echo '						]';
     if ($columns_advanced == 'on') {
         $this->output_ratio_list();
     }
     echo "\n";
     echo '	});' . "\n\n";
     //check if lightbox is active
     $opt = get_option('tp_eg_use_lightbox', 'false');
     if ($load_lightbox && !Essential_Grid_Jackbox::is_active() && !Essential_Grid_Social_Gallery::is_active() && $opt !== 'disabled') {
         echo '	try{' . "\n";
         echo '	jQuery("#esg-grid-' . $this->grid_div_name . '-' . $this->grid_serial . ' .esgbox").esgbox({' . "\n";
         echo '		padding : [' . $lbox_padding[0] . ',' . $lbox_padding[1] . ',' . $lbox_padding[2] . ',' . $lbox_padding[3] . '],' . "\n";
         echo '      afterLoad:function() { ' . "\n";
         echo ' 		if (this.element.hasClass("esgboxhtml5")) {' . "\n";
         echo '		   var mp = this.element.data("mp4"),' . "\n";
         echo '		      ogv = this.element.data("ogv"),' . "\n";
         echo '		      webm = this.element.data("webm");' . "\n";
         echo '         this.content =\'<div style="width:100%;height:100%;"><video autoplay="true" loop="" class="rowbgimage" poster="" width="100%" height="auto"><source src="\'+mp+\'" type="video/mp4"><source src="\'+webm+\'" type="video/webm"><source src="\'+ogv+\'" type="video/ogg"></video></div>\';	' . "\n";
         echo '		   var riint = setInterval(function() {jQuery(window).trigger("resize");},100); setTimeout(function() {clearInterval(riint);},2500);' . "\n";
         echo '		   };' . "\n";
         echo '		 },' . "\n";
         /*	echo '		ajax: { type:"post",url:'.admin_url('admin-ajax.php').',dataType:"json",data:{
         		 action: "Essential_Grid_Front_request_ajax",
         	     client_action: "load_more_content",
         	     token: '.$token.',
         	     postid:postid}, success:function(data) { jQuery.esgbox(data.data)} },'."\n";*/
         echo '		beforeShow : function () { ' . "\n";
         echo '			this.title = jQuery(this.element).attr(\'lgtitle\');' . "\n";
         echo '			if (this.title) {' . "\n";
         if ($lightbox_title_type == "null") {
             echo '				this.title="";' . "\n";
         }
         if ($usetwitter == "on" || $usefacebook == "on") {
             echo '				this.title += ' . $linebreak . ';' . "\n";
         }
         if ($usetwitter == "on") {
             echo '				this.title += ' . $twitteraddon . ';' . "\n";
         }
         if ($usefacebook == "on") {
             echo '				this.title += ' . $facebookaddon . ';' . "\n";
         }
         echo '   		this.title =  \'<div style="padding:' . $lbox_inpadding[0] . 'px ' . $lbox_inpadding[1] . 'px ' . $lbox_inpadding[2] . 'px ' . $lbox_inpadding[3] . 'px">\'+this.title+\'</div>\';' . "\n";
         echo '			}' . "\n";
         echo '		},' . "\n";
         echo '		afterShow : function() {' . "\n";
         if ($usetwitter == "on") {
             echo '			twttr.widgets.load();' . "\n";
         }
         echo '		},' . "\n";
         echo '		openEffect : \'' . $lightbox_effect_open_close . '\',' . "\n";
         echo '		closeEffect : \'' . $lightbox_effect_open_close . '\',' . "\n";
         echo '		nextEffect : \'' . $lightbox_effect_next_prev . '\',' . "\n";
         echo '		prevEffect : \'' . $lightbox_effect_next_prev . '\',' . "\n";
         echo '		openSpeed : \'' . $lightbox_effect_open_close_speed . '\',' . "\n";
         echo '		closeSpeed : \'' . $lightbox_effect_open_close_speed . '\',' . "\n";
         echo '		nextSpeed : \'' . $lightbox_effect_next_prev_speed . '\',' . "\n";
         echo '		prevSpeed : \'' . $lightbox_effect_next_prev_speed . '\',' . "\n";
         if ($lightbox_arrows == "off") {
             echo '		arrows : false,' . "\n";
         }
         echo '		helpers : {' . "\n";
         echo '			media : {},' . "\n";
         if ($lightbox_thumbs == "on") {
             echo '			thumbs: {' . "\n";
             echo '				width : ' . $lightbox_thumbs_w . ',' . "\n";
             echo '				height : ' . $lightbox_thumbs_h . "\n";
             echo '			},' . "\n";
         }
         echo '		    title : {' . "\n";
         if ($lightbox_title_type != "null") {
             echo '				type:"' . $lightbox_title_type . '",' . "\n";
         } else {
             echo '				type:""' . "\n";
         }
         if ($lightbox_title_type != "null") {
             echo '				position:"' . $lightbox_position . '",' . "\n";
         }
         echo '			}' . "\n";
         echo '		}' . "\n";
         echo '});' . "\n" . "\n";
         echo ' } catch (e) {}' . "\n" . "\n";
     }
     //output custom javascript if any is set
     $custom_javascript = stripslashes($base->getVar($this->grid_params, 'custom-javascript', ''));
     if ($custom_javascript !== '') {
         echo $custom_javascript;
     }
     echo '});' . "\n";
     echo '</script>' . "\n";
     if ($js_to_footer && $is_demo == false) {
         $js_content = ob_get_contents();
         ob_clean();
         ob_end_clean();
         $this->grid_inline_js = $js_content;
         add_action('wp_footer', array($this, 'add_inline_js'));
     }
 }
Ejemplo n.º 8
0
 /**
  * 
  * onAjax action handler
  */
 public static function onAjaxAction()
 {
     $slider = new RevSlider();
     $slide = new RevSlide();
     $operations = new RevOperations();
     $action = self::getPostGetVar("client_action");
     $data = self::getPostGetVar("data");
     $nonce = self::getPostGetVar("nonce");
     try {
         //verify the nonce
         $isVerified = wp_verify_nonce($nonce, "revslider_actions");
         if ($isVerified == false) {
             UniteFunctionsRev::throwError("Wrong request");
         }
         switch ($action) {
             case 'add_google_fonts':
                 $f = new ThemePunch_Fonts();
                 $result = $f->add_new_font($data);
                 if ($result === true) {
                     self::ajaxResponseSuccess(__("Font successfully created!", REVSLIDER_TEXTDOMAIN), array('data' => $result, 'is_redirect' => true, 'redirect_url' => self::getFontsUrl()));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 break;
             case 'remove_google_fonts':
                 if (!isset($data['handle'])) {
                     self::ajaxResponseError(__('Font not found', REVSLIDER_TEXTDOMAIN), false);
                 }
                 $f = new ThemePunch_Fonts();
                 $result = $f->remove_font_by_handle($data['handle']);
                 if ($result === true) {
                     self::ajaxResponseSuccess(__("Font successfully removed!", REVSLIDER_TEXTDOMAIN), array('data' => $result));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 break;
             case 'edit_google_fonts':
                 if (!isset($data['handle'])) {
                     self::ajaxResponseError(__('No handle given', REVSLIDER_TEXTDOMAIN), false);
                 }
                 if (!isset($data['url'])) {
                     self::ajaxResponseError(__('No parameters given', REVSLIDER_TEXTDOMAIN), false);
                 }
                 $f = new ThemePunch_Fonts();
                 $result = $f->edit_font_by_handle($data);
                 if ($result === true) {
                     self::ajaxResponseSuccess(__("Font successfully changed!", REVSLIDER_TEXTDOMAIN), array('data' => $result));
                 } else {
                     self::ajaxResponseError($result, false);
                 }
                 break;
             case "export_slider":
                 $sliderID = self::getGetVar("sliderid");
                 $dummy = self::getGetVar("dummy");
                 $slider->initByID($sliderID);
                 $slider->exportSlider($dummy);
                 break;
             case "import_slider":
                 $updateAnim = self::getPostGetVar("update_animations");
                 $updateStatic = self::getPostGetVar("update_static_captions");
                 self::importSliderHandle(null, $updateAnim, $updateStatic);
                 break;
             case "import_slider_slidersview":
                 $viewBack = self::getViewUrl(self::VIEW_SLIDERS);
                 $updateAnim = self::getPostGetVar("update_animations");
                 $updateStatic = self::getPostGetVar("update_static_captions");
                 self::importSliderHandle($viewBack, $updateAnim, $updateStatic);
                 break;
             case "create_slider":
                 self::requireSettings("slider_settings");
                 $settingsMain = self::getSettings("slider_main");
                 $settingsParams = self::getSettings("slider_params");
                 $data = $operations->modifyCustomSliderParams($data);
                 $newSliderID = $slider->createSliderFromOptions($data, $settingsMain, $settingsParams);
                 self::ajaxResponseSuccessRedirect(__("The slider successfully created", REVSLIDER_TEXTDOMAIN), self::getViewUrl("sliders"));
                 break;
             case "update_slider":
                 self::requireSettings("slider_settings");
                 $settingsMain = self::getSettings("slider_main");
                 $settingsParams = self::getSettings("slider_params");
                 $data = $operations->modifyCustomSliderParams($data);
                 $slider->updateSliderFromOptions($data, $settingsMain, $settingsParams);
                 self::ajaxResponseSuccess(__("Slider updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "delete_slider":
                 $isDeleted = $slider->deleteSliderFromData($data);
                 if (is_array($isDeleted)) {
                     $isDeleted = implode(', ', $isDeleted);
                     self::ajaxResponseError("Template can't be deleted, it is still being used by the following Sliders: " . $isDeleted);
                 } else {
                     self::ajaxResponseSuccessRedirect(__("The slider deleted", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
                 }
                 break;
             case "duplicate_slider":
                 $slider->duplicateSliderFromData($data);
                 self::ajaxResponseSuccessRedirect(__("The duplicate successfully, refreshing page...", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
                 break;
             case "add_slide":
                 $numSlides = $slider->createSlideFromData($data);
                 $sliderID = $data["sliderid"];
                 if ($numSlides == 1) {
                     $responseText = __("Slide Created", REVSLIDER_TEXTDOMAIN);
                 } else {
                     $responseText = $numSlides . " " . __("Slides Created", REVSLIDER_TEXTDOMAIN);
                 }
                 $urlRedirect = self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}");
                 self::ajaxResponseSuccessRedirect($responseText, $urlRedirect);
                 break;
             case "add_slide_fromslideview":
                 $slideID = $slider->createSlideFromData($data, true);
                 $urlRedirect = self::getViewUrl(self::VIEW_SLIDE, "id={$slideID}");
                 $responseText = __("Slide Created, redirecting...", REVSLIDER_TEXTDOMAIN);
                 self::ajaxResponseSuccessRedirect($responseText, $urlRedirect);
                 break;
             case "update_slide":
                 require self::getSettingsFilePath("slide_settings");
                 $slide->updateSlideFromData($data, $slideSettings);
                 self::ajaxResponseSuccess(__("Slide updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "update_static_slide":
                 $slide->updateStaticSlideFromData($data);
                 self::ajaxResponseSuccess(__("Static Layers updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "delete_slide":
                 $isPost = $slide->deleteSlideFromData($data);
                 if ($isPost) {
                     $message = __("Post Deleted Successfully", REVSLIDER_TEXTDOMAIN);
                 } else {
                     $message = __("Slide Deleted Successfully", REVSLIDER_TEXTDOMAIN);
                 }
                 $sliderID = UniteFunctionsRev::getVal($data, "sliderID");
                 self::ajaxResponseSuccessRedirect($message, self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "duplicate_slide":
                 $sliderID = $slider->duplicateSlideFromData($data);
                 self::ajaxResponseSuccessRedirect(__("Slide Duplicated Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "copy_move_slide":
                 $sliderID = $slider->copyMoveSlideFromData($data);
                 self::ajaxResponseSuccessRedirect(__("The operation successfully, refreshing page...", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "get_static_css":
                 $contentCSS = $operations->getStaticCss();
                 self::ajaxResponseData($contentCSS);
                 break;
             case "get_dynamic_css":
                 $contentCSS = $operations->getDynamicCss();
                 self::ajaxResponseData($contentCSS);
                 break;
             case "insert_captions_css":
                 $arrCaptions = $operations->insertCaptionsContentData($data);
                 self::ajaxResponseSuccess(__("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "update_captions_css":
                 $arrCaptions = $operations->updateCaptionsContentData($data);
                 self::ajaxResponseSuccess(__("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "delete_captions_css":
                 $arrCaptions = $operations->deleteCaptionsContentData($data);
                 self::ajaxResponseSuccess(__("Style deleted succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "update_static_css":
                 $staticCss = $operations->updateStaticCss($data);
                 self::ajaxResponseSuccess(__("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("css" => $staticCss));
                 break;
             case "insert_custom_anim":
                 $arrAnims = $operations->insertCustomAnim($data);
                 //$arrCaptions =
                 self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
                 break;
             case "update_custom_anim":
                 $arrAnims = $operations->updateCustomAnim($data);
                 self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
                 break;
             case "delete_custom_anim":
                 $arrAnims = $operations->deleteCustomAnim($data);
                 self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
                 break;
             case "update_slides_order":
                 $slider->updateSlidesOrderFromData($data);
                 self::ajaxResponseSuccess(__("Order updated successfully", REVSLIDER_TEXTDOMAIN));
                 break;
             case "change_slide_image":
                 $slide->updateSlideImageFromData($data);
                 $sliderID = UniteFunctionsRev::getVal($data, "slider_id");
                 self::ajaxResponseSuccessRedirect(__("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "preview_slide":
                 $operations->putSlidePreviewByData($data);
                 break;
             case "preview_slider":
                 $sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
                 $do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
                 if ($do_markup == 'true') {
                     $operations->previewOutputMarkup($sliderID);
                 } else {
                     $operations->previewOutput($sliderID);
                 }
                 break;
             case "toggle_slide_state":
                 $currentState = $slide->toggleSlideStatFromData($data);
                 self::ajaxResponseData(array("state" => $currentState));
                 break;
             case "slide_lang_operation":
                 $responseData = $slide->doSlideLangOperation($data);
                 self::ajaxResponseData($responseData);
                 break;
             case "update_plugin":
                 self::updatePlugin(self::DEFAULT_VIEW);
                 break;
             case "update_text":
                 self::updateSettingsText();
                 self::ajaxResponseSuccess(__("All files successfully updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "update_general_settings":
                 $operations->updateGeneralSettings($data);
                 self::ajaxResponseSuccess(__("General settings updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "update_posts_sortby":
                 $slider->updatePostsSortbyFromData($data);
                 self::ajaxResponseSuccess(__("Sortby updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "replace_image_urls":
                 $slider->replaceImageUrlsFromData($data);
                 self::ajaxResponseSuccess(__("Image urls replaced", REVSLIDER_TEXTDOMAIN));
                 break;
             case "reset_slide_settings":
                 $slider->resetSlideSettings($data);
                 self::ajaxResponseSuccess(__("Settings in all Slides changed", REVSLIDER_TEXTDOMAIN));
                 break;
             case "activate_purchase_code":
                 $result = false;
                 if (!empty($data['username']) && !empty($data['api_key']) && !empty($data['code'])) {
                     $result = $operations->checkPurchaseVerification($data);
                 } else {
                     UniteFunctionsRev::throwError(__('The API key, the Purchase Code and the Username need to be set!', REVSLIDER_TEXTDOMAIN));
                     exit;
                 }
                 if ($result) {
                     self::ajaxResponseSuccessRedirect(__("Purchase Code Successfully Activated", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
                 } else {
                     UniteFunctionsRev::throwError(__('Purchase Code is invalid', REVSLIDER_TEXTDOMAIN));
                 }
                 break;
             case "deactivate_purchase_code":
                 $result = $operations->doPurchaseDeactivation($data);
                 if ($result) {
                     self::ajaxResponseSuccessRedirect(__("Successfully removed validation", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
                 } else {
                     UniteFunctionsRev::throwError(__('Could not remove Validation!', REVSLIDER_TEXTDOMAIN));
                 }
                 break;
             case "dismiss_notice":
                 update_option('revslider-valid-notice', 'false');
                 self::ajaxResponseSuccess(__(".", REVSLIDER_TEXTDOMAIN));
                 break;
             default:
                 self::ajaxResponseError("wrong ajax action: {$action} ");
                 break;
         }
     } catch (Exception $e) {
         $message = $e->getMessage();
         if ($action == "preview_slide" || $action == "preview_slider") {
             echo $message;
             exit;
         }
         self::ajaxResponseError($message);
     }
     //it's an ajax action, so exit
     self::ajaxResponseError("No response output on <b> {$action} </b> action. please check with the developer.");
     exit;
 }
Ejemplo n.º 9
0
 public function import_punch_fonts($import_punch_fonts, $import_handles = true, $check_append = true)
 {
     $base = new Essential_Grid_Base();
     $fonts = new ThemePunch_Fonts();
     $punch_fonts = $fonts->get_all_fonts();
     foreach ($import_punch_fonts as $i_punch_font) {
         if (!empty($import_handles) && is_array($import_handles)) {
             $found = false;
             foreach ($import_handles as $handle) {
                 if ($i_punch_font['handle'] == $handle) {
                     $found = true;
                     break;
                 }
             }
             if (!$found) {
                 continue;
             }
         } else {
             if ($import_handles !== true) {
                 break;
             }
         }
         $exist = false;
         if (!empty($punch_fonts)) {
             foreach ($punch_fonts as $font) {
                 if ($font['handle'] == $i_punch_font['handle']) {
                     $exist = true;
                     break;
                 }
             }
         }
         if ($import_handles == true) {
             //do not insert if handle exists. This is for the import demo data process
             if ($exist) {
                 continue;
             }
         }
         $append = true;
         if ($exist) {
             //skin exists - append or overwrite
             if ($check_append) {
                 //check in $_POST if append or overwrite
                 $do = $base->getVar($this->overwrite_data, 'punch-fonts-overwrite-' . $i_punch_font['handle'], 'append');
                 $append = $do == 'append' ? true : false;
             }
         }
         if ($import_handles !== true) {
             if ($append) {
                 //append
                 if ($exist) {
                     $orig_handle = $i_punch_font['handle'];
                     $i_punch_font['handle'] = $i_punch_font['handle'] . '-' . date('His');
                 }
                 $fonts->add_new_font($i_punch_font);
             } else {
                 //overwrite
                 $fonts->edit_font_by_handle($i_punch_font);
             }
         } else {
             //create or overwrite
             if ($exist) {
                 $fonts->edit_font_by_handle($i_punch_font);
             } else {
                 $fonts->add_new_font($i_punch_font);
             }
         }
     }
 }
Ejemplo n.º 10
0
 public function hookdisplayHeader()
 {
     $this->context->controller->addCSS($this->_path . 'rs-plugin/css/settings.css');
     $this->context->controller->addCSS($this->_path . 'rs-plugin/css/static-captions.css');
     $this->context->controller->addCSS($this->_path . 'rs-plugin/css/dynamic-captions.css');
     $this->context->controller->addCSS($this->_path . 'css/front.css');
     $this->context->controller->addJS($this->_path . 'rs-plugin/js/jquery.themepunch.tools.min.js');
     $this->context->controller->addJS($this->_path . 'rs-plugin/js/jquery.themepunch.revolution.min.js');
     $pf = new ThemePunch_Fonts();
     $pf->register_fonts();
 }
 public function enqueue_styles()
 {
     $font = new ThemePunch_Fonts();
     $font->register_fonts();
 }
 public function index()
 {
     define('rs_plugin_url', REV_DIR_CONFIG . 'revslider/');
     define('rs_admin_css', rs_plugin_url . 'css/');
     define('rs_admin_js', rs_plugin_url . 'js/');
     define('rs_admin_img', rs_plugin_url . 'images/');
     define('rs_rs_plugin', rs_plugin_url . 'rs-plugin/');
     $this->language->load('module/revslideropencart');
     $this->document->setTitle($this->language->get('heading_title'));
     // start load external file
     $this->config->load('revslider/revslider_admin');
     // end load external file
     // start add font
     $font = new ThemePunch_Fonts();
     $fonts = $font->get_all_fonts();
     if (!empty($fonts)) {
         $http = get_http();
         foreach ($fonts as $font) {
             if ($font !== '') {
                 $url = $http . "fonts.googleapis.com/css?family=" . strip_tags($font['url']);
                 $this->document->addStyle($url);
             }
         }
     }
     // end add font
     // start css file
     $this->document->addStyle(rs_admin_css . 'admin.css');
     $this->document->addStyle(rs_admin_css . 'tipsy.css');
     // $this->document->addStyle(rs_admin_js.'autocomplete/jquery.autocomplete.css');
     $this->document->addStyle(rs_admin_js . 'codemirror/codemirror.css');
     $this->document->addStyle(rs_admin_css . 'edit_layers.css');
     $this->document->addStyle(rs_rs_plugin . 'css/settings.css');
     $this->document->addStyle(rs_rs_plugin . 'css/captions.css');
     $this->document->addStyle(rs_rs_plugin . 'css/static-captions.css');
     // end load media file
     //start revsslider custom code
     self::$wpdb = rev_db_class::rev_db_instance();
     //end revsslider custom code
     if (isset($this->error['warning'])) {
         $data['error_warning'] = $this->error['warning'];
     } else {
         $data['error_warning'] = '';
     }
     if (isset($this->error['dimension'])) {
         $data['error_dimension'] = $this->error['dimension'];
     } else {
         $data['error_dimension'] = array();
     }
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_module'), 'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('module/revslideropencart', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     // start language
     self::$lang_var['help'] = $this->language->get('help');
     self::$lang_var['Revolution_Sliders'] = $this->language->get('Revolution_Sliders');
     self::$lang_var['general_settings'] = $this->language->get('general_settings');
     self::$lang_var['update'] = $this->language->get('update');
     self::$lang_var['Update_Slider_Plugin'] = $this->language->get('Update_Slider_Plugin');
     self::$lang_var['Update_Slider'] = $this->language->get('Update_Slider');
     self::$lang_var['Update_rev_Slider_Plugin'] = $this->language->get('Update_rev_Slider_Plugin');
     self::$lang_var['Update_rev_Slider_Plugin_desc'] = $this->language->get('Update_rev_Slider_Plugin_desc');
     self::$lang_var['File_example'] = $this->language->get('File_example');
     self::$lang_var['Choose_update_file'] = $this->language->get('Choose_update_file');
     self::$lang_var['No_Sliders_Found'] = $this->language->get('No_Sliders_Found');
     self::$lang_var['Revolution_Slider_Temp'] = $this->language->get('Revolution_Slider_Temp');
     self::$lang_var['No_Template_Found'] = $this->language->get('No_Template_Found');
     self::$lang_var['Import_Slider'] = $this->language->get('Import_Slider');
     self::$lang_var['Choose_import_file'] = $this->language->get('Choose_import_file');
     self::$lang_var['CUSTOM_STYLES'] = $this->language->get('CUSTOM_STYLES');
     self::$lang_var['Custom_Animations'] = $this->language->get('Custom_Animations');
     self::$lang_var['overwrite'] = $this->language->get('overwrite');
     self::$lang_var['ID'] = $this->language->get('ID');
     self::$lang_var['Name'] = $this->language->get('Name');
     self::$lang_var['Source'] = $this->language->get('Source');
     self::$lang_var['Display_Hook'] = $this->language->get('Display_Hook');
     self::$lang_var['N_Slides'] = $this->language->get('N_Slides');
     self::$lang_var['Actions'] = $this->language->get('Actions');
     self::$lang_var['Settings'] = $this->language->get('Settings');
     self::$lang_var['HTML'] = $this->language->get('HTML');
     self::$lang_var['Delete'] = $this->language->get('Delete');
     self::$lang_var['Deleting_Slide'] = $this->language->get('Deleting_Slide');
     self::$lang_var['Duplicate'] = $this->language->get('Duplicate');
     self::$lang_var['Preview'] = $this->language->get('Preview');
     self::$lang_var['New_Template_Slider'] = $this->language->get('New_Template_Slider');
     self::$lang_var['New_Slider'] = $this->language->get('New_Slider');
     self::$lang_var['Hook_Name'] = $this->language->get('Hook_Name');
     self::$lang_var['Remove'] = $this->language->get('Remove');
     self::$lang_var['custom_hook_desc'] = $this->language->get('custom_hook_desc');
     self::$lang_var['Add_New_Hook'] = $this->language->get('Add_New_Hook');
     self::$lang_var['Add_Hook'] = $this->language->get('Add_Hook');
     self::$lang_var['CSS_JavaScript'] = $this->language->get('CSS_JavaScript');
     self::$lang_var['Custom_CSS'] = $this->language->get('Custom_CSS');
     self::$lang_var['Custom_JS'] = $this->language->get('Custom_JS');
     self::$lang_var['New_Slider_Temp'] = $this->language->get('New_Slider_Temp');
     self::$lang_var['New_Sldr'] = $this->language->get('New_Sldr');
     self::$lang_var['Main_Slider_Settings'] = $this->language->get('Main_Slider_Settings');
     self::$lang_var['theme_style'] = $this->language->get('theme_style');
     self::$lang_var['BROWSER'] = $this->language->get('BROWSER');
     self::$lang_var['PAGE'] = $this->language->get('PAGE');
     self::$lang_var['SLIDER'] = $this->language->get('SLIDER');
     self::$lang_var['LAYERS_GRID'] = $this->language->get('LAYERS_GRID');
     self::$lang_var['Create_Slider'] = $this->language->get('Create_Slider');
     self::$lang_var['Close'] = $this->language->get('Close');
     self::$lang_var['Slides_List'] = $this->language->get('Slides_List');
     self::$lang_var['Saving_Order'] = $this->language->get('Saving_Order');
     self::$lang_var['No_Slides_Found'] = $this->language->get('No_Slides_Found');
     self::$lang_var['Unpublish_Product'] = $this->language->get('Unpublish_Product');
     self::$lang_var['Publish_Product'] = $this->language->get('Publish_Product');
     self::$lang_var['Edit_Post'] = $this->language->get('Edit_Post');
     self::$lang_var['multiple_sources'] = $this->language->get('multiple_sources');
     self::$lang_var['Sort_by'] = $this->language->get('Sort_by');
     self::$lang_var['Updating_Sorting'] = $this->language->get('Updating_Sorting');
     self::$lang_var['Slider_Settings'] = $this->language->get('Slider_Settings');
     self::$lang_var['Warning_Removing'] = $this->language->get('Warning_Removing');
     self::$lang_var['Select_Slide_Image'] = $this->language->get('Select_Slide_Image');
     self::$lang_var['Punch_Fonts'] = $this->language->get('Punch_Fonts');
     self::$lang_var['Font_Family'] = $this->language->get('Font_Family');
     self::$lang_var['Handle'] = $this->language->get('Handle');
     self::$lang_var['Parameter'] = $this->language->get('Parameter');
     self::$lang_var['Google_Font_desc'] = $this->language->get('Google_Font_desc');
     self::$lang_var['Edit'] = $this->language->get('Edit');
     self::$lang_var['Add_New_Font'] = $this->language->get('Add_New_Font');
     self::$lang_var['Add_Font'] = $this->language->get('Add_Font');
     self::$lang_var['Unique_handle'] = $this->language->get('Unique_handle');
     self::$lang_var['Parameter'] = $this->language->get('Parameter');
     self::$lang_var['Unpublish_Slide'] = $this->language->get('Unpublish_Slide');
     self::$lang_var['Publish_Slide'] = $this->language->get('Publish_Slide');
     self::$lang_var['Preview_Slide'] = $this->language->get('Preview_Slide');
     self::$lang_var['copy_move_dialog'] = $this->language->get('copy_move_dialog');
     self::$lang_var['copy_move_found'] = $this->language->get('copy_move_found');
     self::$lang_var['copy_move'] = $this->language->get('copy_move');
     self::$lang_var['Working'] = $this->language->get('Working');
     self::$lang_var['Edit_Slider_Template'] = $this->language->get('Edit_Slider_Template');
     self::$lang_var['Edit_Slider'] = $this->language->get('Edit_Slider');
     self::$lang_var['Save_Settings'] = $this->language->get('Save_Settings');
     self::$lang_var['Delete_Slider'] = $this->language->get('Delete_Slider');
     self::$lang_var['Preview_Slider'] = $this->language->get('Preview_Slider');
     self::$lang_var['Preview'] = $this->language->get('Preview');
     self::$lang_var['API_Functions'] = $this->language->get('API_Functions');
     self::$lang_var['API_Methods'] = $this->language->get('API_Methods');
     self::$lang_var['copy_paste_js'] = $this->language->get('copy_paste_js');
     self::$lang_var['Pause_Slider'] = $this->language->get('Pause_Slider');
     self::$lang_var['Resume_Slider'] = $this->language->get('Resume_Slider');
     self::$lang_var['Previous_Slide'] = $this->language->get('Previous_Slide');
     self::$lang_var['Next_Slide'] = $this->language->get('Next_Slide');
     self::$lang_var['Go_To_Slide'] = $this->language->get('Go_To_Slide');
     self::$lang_var['Num_Slides'] = $this->language->get('Num_Slides');
     self::$lang_var['Slide_Number'] = $this->language->get('Slide_Number');
     self::$lang_var['Playing_Slide'] = $this->language->get('Playing_Slide');
     self::$lang_var['External_Scroll'] = $this->language->get('External_Scroll');
     self::$lang_var['Redraw_Slider'] = $this->language->get('Redraw_Slider');
     self::$lang_var['API_Events'] = $this->language->get('API_Events');
     self::$lang_var['jQuery_Functions'] = $this->language->get('jQuery_Functions');
     self::$lang_var['Slider_l'] = $this->language->get('Slider_l');
     self::$lang_var['Edit_Template_Slide'] = $this->language->get('Edit_Template_Slide');
     self::$lang_var['Edit_Slide'] = $this->language->get('Edit_Slide');
     self::$lang_var['Title'] = $this->language->get('Title');
     self::$lang_var['Static_Layers'] = $this->language->get('Static_Layers');
     self::$lang_var['Static_Layers_lbl'] = $this->language->get('Static_Layers_lbl');
     self::$lang_var['Add_Slide'] = $this->language->get('Add_Slide');
     self::$lang_var['slide_language'] = $this->language->get('slide_language');
     self::$lang_var['language_related'] = $this->language->get('language_related');
     self::$lang_var['slides_view'] = $this->language->get('slides_view');
     self::$lang_var['General_Slide_Settings'] = $this->language->get('General_Slide_Settings');
     self::$lang_var['Warning_jq_ui'] = $this->language->get('Warning_jq_ui');
     self::$lang_var['Update_Slide'] = $this->language->get('Update_Slide');
     self::$lang_var['Update_Static_Layers'] = $this->language->get('Update_Static_Layers');
     self::$lang_var['updating'] = $this->language->get('updating');
     self::$lang_var['To_List'] = $this->language->get('To_List');
     self::$lang_var['Delete_Slide'] = $this->language->get('Delete_Slide');
     self::$lang_var['Delete_this_Slide'] = $this->language->get('Delete_this_Slide');
     self::$lang_var['Import_Export'] = $this->language->get('Import_Export');
     self::$lang_var['Import_Slider'] = $this->language->get('Import_Slider');
     self::$lang_var['note_styles'] = $this->language->get('note_styles');
     self::$lang_var['Custom_Animations'] = $this->language->get('Custom_Animations');
     self::$lang_var['overwrite'] = $this->language->get('overwrite');
     self::$lang_var['append'] = $this->language->get('append');
     self::$lang_var['Static_Styles'] = $this->language->get('Static_Styles');
     self::$lang_var['api-desc'] = $this->language->get('api-desc');
     self::$lang_var['Export_Slider'] = $this->language->get('Export_Slider');
     self::$lang_var['Export_Slider_Dummy'] = $this->language->get('Export_Slider_Dummy');
     self::$lang_var['Replace_Image_Url'] = $this->language->get('Replace_Image_Url');
     self::$lang_var['Replace_api_desc'] = $this->language->get('Replace_api_desc');
     self::$lang_var['Replace_From'] = $this->language->get('Replace_From');
     self::$lang_var['Replace_to'] = $this->language->get('Replace_to');
     self::$lang_var['Replace'] = $this->language->get('Replace');
     self::$lang_var['Replacing'] = $this->language->get('Replacing');
     self::$lang_var['Edit_Slides'] = $this->language->get('Edit_Slides');
     self::$lang_var['New_Slide'] = $this->language->get('New_Slide');
     self::$lang_var['New_Transparent'] = $this->language->get('New_Transparent');
     self::$lang_var['Adding_Slide'] = $this->language->get('Adding_Slide');
     self::$lang_var['Select_image'] = $this->language->get('Select_image');
     self::$lang_var['Static_Global'] = $this->language->get('Static_Global');
     self::$lang_var['To_Settings'] = $this->language->get('To_Settings');
     self::$lang_var['Do_It'] = $this->language->get('Do_It');
     self::$lang_var['Copy_move_slide'] = $this->language->get('Copy_move_slide');
     self::$lang_var['Choose_Slider'] = $this->language->get('Choose_Slider');
     self::$lang_var['Choose_Operation'] = $this->language->get('Choose_Operation');
     self::$lang_var['Copy'] = $this->language->get('Copy');
     self::$lang_var['Move'] = $this->language->get('Move');
     self::$lang_var['Add_Video_Layout'] = $this->language->get('Add_Video_Layout');
     self::$lang_var['Choose_video_type'] = $this->language->get('Choose_video_type');
     self::$lang_var['Youtube'] = $this->language->get('Youtube');
     self::$lang_var['Vimeo'] = $this->language->get('Vimeo');
     self::$lang_var['HTML5'] = $this->language->get('HTML5');
     self::$lang_var['Vimeo_ID_URL'] = $this->language->get('Vimeo_ID_URL');
     self::$lang_var['example_30300114'] = $this->language->get('example_30300114');
     self::$lang_var['Youtube_ID_URL'] = $this->language->get('Youtube_ID_URL');
     self::$lang_var['example'] = $this->language->get('example');
     self::$lang_var['Poster_Image_Url'] = $this->language->get('Poster_Image_Url');
     self::$lang_var['Video_MP4_Url'] = $this->language->get('Video_MP4_Url');
     self::$lang_var['Video_WEBM_Url'] = $this->language->get('Video_WEBM_Url');
     self::$lang_var['Video_OGV_Url'] = $this->language->get('Video_OGV_Url');
     self::$lang_var['Video_Size'] = $this->language->get('Video_Size');
     self::$lang_var['Full_Width'] = $this->language->get('Full_Width');
     self::$lang_var['Width'] = $this->language->get('Width');
     self::$lang_var['Height'] = $this->language->get('Height');
     self::$lang_var['Cover'] = $this->language->get('Cover');
     self::$lang_var['Dotted_Overlay'] = $this->language->get('Dotted_Overlay');
     self::$lang_var['none'] = $this->language->get('none');
     self::$lang_var['2_2_Black'] = $this->language->get('2_2_Black');
     self::$lang_var['2_2_White'] = $this->language->get('2_2_White');
     self::$lang_var['3_3_Black'] = $this->language->get('3_3_Black');
     self::$lang_var['3_3_White'] = $this->language->get('3_3_White');
     self::$lang_var['Aspect_Ratio'] = $this->language->get('Aspect_Ratio');
     self::$lang_var['16_9'] = $this->language->get('16_9');
     self::$lang_var['4_3'] = $this->language->get('4_3');
     self::$lang_var['Video_Settings'] = $this->language->get('Video_Settings');
     self::$lang_var['Loop_Video'] = $this->language->get('Loop_Video');
     self::$lang_var['Autoplay'] = $this->language->get('Autoplay');
     self::$lang_var['Only_1st_Time'] = $this->language->get('Only_1st_Time');
     self::$lang_var['Next_Slide_End'] = $this->language->get('Next_Slide_End');
     self::$lang_var['Force_Rewind'] = $this->language->get('Force_Rewind');
     self::$lang_var['Hide_Controls'] = $this->language->get('Hide_Controls');
     self::$lang_var['Mute'] = $this->language->get('Mute');
     self::$lang_var['Preview_Image'] = $this->language->get('Preview_Image');
     self::$lang_var['Set'] = $this->language->get('Set');
     self::$lang_var['Arguments'] = $this->language->get('Arguments');
     self::$lang_var['Add_This_Video'] = $this->language->get('Add_This_Video');
     self::$lang_var['Update_Video'] = $this->language->get('Update_Video');
     self::$lang_var['Slider_Main_Image_bg'] = $this->language->get('Slider_Main_Image_bg');
     self::$lang_var['Background_Source'] = $this->language->get('Background_Source');
     self::$lang_var['Image_BG'] = $this->language->get('Image_BG');
     self::$lang_var['Change_Image'] = $this->language->get('Change_Image');
     self::$lang_var['External_URL'] = $this->language->get('External_URL');
     self::$lang_var['Get_External'] = $this->language->get('Get_External');
     self::$lang_var['Transparent'] = $this->language->get('Transparent');
     self::$lang_var['Solid_Colored'] = $this->language->get('Solid_Colored');
     self::$lang_var['Background_Settings'] = $this->language->get('Background_Settings');
     self::$lang_var['Background_Fit'] = $this->language->get('Background_Fit');
     self::$lang_var['contain'] = $this->language->get('contain');
     self::$lang_var['normal'] = $this->language->get('normal');
     self::$lang_var['Background_Repeat'] = $this->language->get('Background_Repeat');
     self::$lang_var['Background_Position'] = $this->language->get('Background_Position');
     self::$lang_var['center_top'] = $this->language->get('center_top');
     self::$lang_var['center_right'] = $this->language->get('center_right');
     self::$lang_var['center_bottom'] = $this->language->get('center_bottom');
     self::$lang_var['center_center'] = $this->language->get('center_center');
     self::$lang_var['left_top'] = $this->language->get('left_top');
     self::$lang_var['left_center'] = $this->language->get('left_center');
     self::$lang_var['left_bottom'] = $this->language->get('left_bottom');
     self::$lang_var['right_top'] = $this->language->get('right_top');
     self::$lang_var['right_center'] = $this->language->get('right_center');
     self::$lang_var['right_bottom'] = $this->language->get('right_bottom');
     self::$lang_var['Pan_Zoom_Settings'] = $this->language->get('Pan_Zoom_Settings');
     self::$lang_var['On'] = $this->language->get('On');
     self::$lang_var['Background'] = $this->language->get('Background');
     self::$lang_var['Start_Position'] = $this->language->get('Start_Position');
     self::$lang_var['Start_Fit'] = $this->language->get('Start_Fit');
     self::$lang_var['End_Position'] = $this->language->get('End_Position');
     self::$lang_var['End_Fit'] = $this->language->get('End_Fit');
     self::$lang_var['Duration'] = $this->language->get('Duration');
     self::$lang_var['Slide'] = $this->language->get('Slide');
     self::$lang_var['Helper_Grid'] = $this->language->get('Helper_Grid');
     self::$lang_var['Disabled'] = $this->language->get('Disabled');
     self::$lang_var['Snap_to'] = $this->language->get('Snap_to');
     self::$lang_var['Help_Lines'] = $this->language->get('Help_Lines');
     self::$lang_var['Layers'] = $this->language->get('Layers');
     self::$lang_var['Show_Layers_from_Slide'] = $this->language->get('Show_Layers_from_Slide');
     self::$lang_var['Add_Layer'] = $this->language->get('Add_Layer');
     self::$lang_var['Add_Layer_Image'] = $this->language->get('Add_Layer_Image');
     self::$lang_var['Add_Layer_Video'] = $this->language->get('Add_Layer_Video');
     self::$lang_var['Duplicate_Layer'] = $this->language->get('Duplicate_Layer');
     self::$lang_var['Delete_Layer'] = $this->language->get('Delete_Layer');
     self::$lang_var['Delete_All_Layers'] = $this->language->get('Delete_All_Layers');
     self::$lang_var['Layers_Timing_Sorting'] = $this->language->get('Layers_Timing_Sorting');
     self::$lang_var['z_Index'] = $this->language->get('z_Index');
     self::$lang_var['Hide_All_Layers'] = $this->language->get('Hide_All_Layers');
     self::$lang_var['Lock_All_Layers'] = $this->language->get('Lock_All_Layers');
     self::$lang_var['Snap_to_Slide'] = $this->language->get('Snap_to_Slide');
     self::$lang_var['Timing'] = $this->language->get('Timing');
     self::$lang_var['sh_Timer_Settings'] = $this->language->get('sh_Timer_Settings');
     self::$lang_var['Start'] = $this->language->get('Start');
     self::$lang_var['End'] = $this->language->get('End');
     self::$lang_var['Static_Options'] = $this->language->get('Static_Options');
     self::$lang_var['Static_Options_desc'] = $this->language->get('Static_Options_desc');
     self::$lang_var['Start_on_Slide'] = $this->language->get('Start_on_Slide');
     self::$lang_var['End_on_Slide'] = $this->language->get('End_on_Slide');
     self::$lang_var['Layer_General_Parameters'] = $this->language->get('Layer_General_Parameters');
     self::$lang_var['Layer_Content'] = $this->language->get('Layer_Content');
     self::$lang_var['Position_Styling'] = $this->language->get('Position_Styling');
     self::$lang_var['Image_Scale'] = $this->language->get('Image_Scale');
     self::$lang_var['Reset_Size'] = $this->language->get('Reset_Size');
     self::$lang_var['Final_Rotation'] = $this->language->get('Final_Rotation');
     self::$lang_var['Parallax_Setting'] = $this->language->get('Parallax_Setting');
     self::$lang_var['Layer_Animation'] = $this->language->get('Layer_Animation');
     self::$lang_var['Preview_Transition'] = $this->language->get('Preview_Transition');
     self::$lang_var['LAYER_EXAMPLE'] = $this->language->get('LAYER_EXAMPLE');
     self::$lang_var['Start_Transition'] = $this->language->get('Start_Transition');
     self::$lang_var['Custom_Animation'] = $this->language->get('Custom_Animation');
     self::$lang_var['End_Transition_opt'] = $this->language->get('End_Transition_opt');
     self::$lang_var['Loop_Animation'] = $this->language->get('Loop_Animation');
     self::$lang_var['Anim_Settings_Panel'] = $this->language->get('Anim_Settings_Panel');
     self::$lang_var['Randomize'] = $this->language->get('Randomize');
     self::$lang_var['Transition'] = $this->language->get('Transition');
     self::$lang_var['Rotation'] = $this->language->get('Rotation');
     self::$lang_var['Scale'] = $this->language->get('Scale');
     self::$lang_var['Skew'] = $this->language->get('Skew');
     self::$lang_var['Opacity'] = $this->language->get('Opacity');
     self::$lang_var['Perspective'] = $this->language->get('Perspective');
     self::$lang_var['Origin'] = $this->language->get('Origin');
     self::$lang_var['Test_Parameters'] = $this->language->get('Test_Parameters');
     self::$lang_var['Test_Parameters_desc'] = $this->language->get('Test_Parameters_desc');
     self::$lang_var['Speed'] = $this->language->get('Speed');
     self::$lang_var['Transition_Direction'] = $this->language->get('Transition_Direction');
     self::$lang_var['Overwrite_Animation'] = $this->language->get('Overwrite_Animation');
     self::$lang_var['new_Animation'] = $this->language->get('new_Animation');
     self::$lang_var['Save_Animation'] = $this->language->get('Save_Animation');
     self::$lang_var['Advanced_Params'] = $this->language->get('Advanced_Params');
     self::$lang_var['Links_optional'] = $this->language->get('Links_optional');
     self::$lang_var['Caption_Sharp'] = $this->language->get('Caption_Sharp');
     self::$lang_var['Responsive_Settings'] = $this->language->get('Responsive_Settings');
     self::$lang_var['Attributes_opt'] = $this->language->get('Attributes_opt');
     self::$lang_var['Template_Insertions'] = $this->language->get('Template_Insertions');
     self::$lang_var['Post_Placeholders'] = $this->language->get('Post_Placeholders');
     self::$lang_var['Any_custom_Tag'] = $this->language->get('Any_custom_Tag');
     self::$lang_var['Product_Name'] = $this->language->get('Product_Name');
     self::$lang_var['Product_Price'] = $this->language->get('Product_Price');
     self::$lang_var['Product_Srt_Desc'] = $this->language->get('Product_Srt_Desc');
     self::$lang_var['Product_Description'] = $this->language->get('Product_Description');
     self::$lang_var['link_Product'] = $this->language->get('link_Product');
     self::$lang_var['link_Product_Cart'] = $this->language->get('link_Product_Cart');
     self::$lang_var['Product_Cat_Default'] = $this->language->get('Product_Cat_Default');
     self::$lang_var['Date_created'] = $this->language->get('Date_created');
     self::$lang_var['Date_modified'] = $this->language->get('Date_modified');
     self::$lang_var['Specials_CountDown'] = $this->language->get('Specials_CountDown');
     self::$lang_var['Custom_Placeholders'] = $this->language->get('Custom_Placeholders');
     self::$lang_var['Example'] = $this->language->get('Example');
     self::$lang_var['cover'] = $this->language->get('cover');
     self::$lang_var['None'] = $this->language->get('None');
     self::$lang_var['Position'] = $this->language->get('Position');
     self::$lang_var['Appearance'] = $this->language->get('Appearance');
     self::$lang_var['Navigation'] = $this->language->get('Navigation');
     self::$lang_var['Thumbnails'] = $this->language->get('Thumbnails');
     self::$lang_var['Mobile_Visibility'] = $this->language->get('Mobile_Visibility');
     self::$lang_var['Alternative_First'] = $this->language->get('Alternative_First');
     self::$lang_var['Troubleshooting'] = $this->language->get('Troubleshooting');
     self::$lang_var['Delay'] = $this->language->get('Delay');
     self::$lang_var['slide_stays'] = $this->language->get('slide_stays');
     self::$lang_var['Shuffle_Mode'] = $this->language->get('Shuffle_Mode');
     self::$lang_var['Turn_Shuffle'] = $this->language->get('Turn_Shuffle');
     self::$lang_var['Lazy_Load'] = $this->language->get('Lazy_Load');
     self::$lang_var['lazy_load_desc'] = $this->language->get('lazy_load_desc');
     self::$lang_var['Load_Google_Font'] = $this->language->get('Load_Google_Font');
     self::$lang_var['yes_Google_Font'] = $this->language->get('yes_Google_Font');
     self::$lang_var['Google_Font'] = $this->language->get('Google_Font');
     self::$lang_var['google_font_family'] = $this->language->get('google_font_family');
     self::$lang_var['more_google'] = $this->language->get('more_google');
     self::$lang_var['Stop_Slider'] = $this->language->get('Stop_Slider');
     self::$lang_var['On_Off_loops'] = $this->language->get('On_Off_loops');
     self::$lang_var['Stop_After_Loops'] = $this->language->get('Stop_After_Loops');
     self::$lang_var['certain_amount_loops'] = $this->language->get('certain_amount_loops');
     self::$lang_var['Stop_At_Slide'] = $this->language->get('Stop_At_Slide');
     self::$lang_var['given_slide'] = $this->language->get('given_slide');
     self::$lang_var['Position_page'] = $this->language->get('Position_page');
     self::$lang_var['Position_slider'] = $this->language->get('Position_slider');
     self::$lang_var['Left'] = $this->language->get('Left');
     self::$lang_var['Center'] = $this->language->get('Center');
     self::$lang_var['Right'] = $this->language->get('Right');
     self::$lang_var['Margin_Top'] = $this->language->get('Margin_Top');
     self::$lang_var['top_wrapper'] = $this->language->get('top_wrapper');
     self::$lang_var['px'] = $this->language->get('px');
     self::$lang_var['Margin_Bottom'] = $this->language->get('Margin_Bottom');
     self::$lang_var['bottom_wrapper'] = $this->language->get('bottom_wrapper');
     self::$lang_var['Margin_left'] = $this->language->get('Margin_left');
     self::$lang_var['left_margin_wrapper'] = $this->language->get('left_margin_wrapper');
     self::$lang_var['Margin_wrapper_div'] = $this->language->get('Margin_wrapper_div');
     self::$lang_var['right_wrapper'] = $this->language->get('right_wrapper');
     self::$lang_var['Shadow_Type'] = $this->language->get('Shadow_Type');
     self::$lang_var['slider_shadow'] = $this->language->get('slider_shadow');
     self::$lang_var['No_Shadow'] = $this->language->get('No_Shadow');
     self::$lang_var['1'] = $this->language->get('1');
     self::$lang_var['2'] = $this->language->get('2');
     self::$lang_var['3'] = $this->language->get('3');
     self::$lang_var['Show_Timer_Show'] = $this->language->get('Show_Timer_Show');
     self::$lang_var['running_timer_line'] = $this->language->get('running_timer_line');
     self::$lang_var['Top'] = $this->language->get('Top');
     self::$lang_var['Bottom'] = $this->language->get('Bottom');
     self::$lang_var['Hide'] = $this->language->get('Hide');
     self::$lang_var['Background_color'] = $this->language->get('Background_color');
     self::$lang_var['transparent_slider'] = $this->language->get('transparent_slider');
     self::$lang_var['Padding_border'] = $this->language->get('Padding_border');
     self::$lang_var['border_around_slider'] = $this->language->get('border_around_slider');
     self::$lang_var['Show_Background_Image'] = $this->language->get('Show_Background_Image');
     self::$lang_var['main_slider_wrapper'] = $this->language->get('main_slider_wrapper');
     self::$lang_var['Background_Image_Url'] = $this->language->get('Background_Image_Url');
     self::$lang_var['slider_preloading'] = $this->language->get('slider_preloading');
     self::$lang_var['Touch_Enabled'] = $this->language->get('Touch_Enabled');
     self::$lang_var['Function_touch_devices'] = $this->language->get('Function_touch_devices');
     self::$lang_var['Stop_On_Hover'] = $this->language->get('Stop_On_Hover');
     self::$lang_var['hovering_Navigation'] = $this->language->get('hovering_Navigation');
     self::$lang_var['Navigation_Type'] = $this->language->get('Navigation_Type');
     self::$lang_var['navigation_bar'] = $this->language->get('navigation_bar');
     self::$lang_var['None'] = $this->language->get('None');
     self::$lang_var['Bullet'] = $this->language->get('Bullet');
     self::$lang_var['Thumb'] = $this->language->get('Thumb');
     self::$lang_var['Both'] = $this->language->get('Both');
     self::$lang_var['Navigation_Arrows'] = $this->language->get('Navigation_Arrows');
     self::$lang_var['navigation_Thumb_arrows'] = $this->language->get('navigation_Thumb_arrows');
     self::$lang_var['With_Bullets'] = $this->language->get('With_Bullets');
     self::$lang_var['Solo'] = $this->language->get('Solo');
     self::$lang_var['Navigation_Style'] = $this->language->get('Navigation_Style');
     self::$lang_var['Navigation_nexttobullets'] = $this->language->get('Navigation_nexttobullets');
     self::$lang_var['Round'] = $this->language->get('Round');
     self::$lang_var['Navbar'] = $this->language->get('Navbar');
     self::$lang_var['Old_Round'] = $this->language->get('Old_Round');
     self::$lang_var['Old_Square'] = $this->language->get('Old_Square');
     self::$lang_var['Old_Navbar'] = $this->language->get('Old_Navbar');
     self::$lang_var['Always_Show_Navigation'] = $this->language->get('Always_Show_Navigation');
     self::$lang_var['show_navigation_thumbnails'] = $this->language->get('show_navigation_thumbnails');
     self::$lang_var['Hide_Navitagion_After'] = $this->language->get('Hide_Navitagion_After');
     self::$lang_var['Time_Navigatio_hidden'] = $this->language->get('Time_Navigatio_hidden');
     self::$lang_var['ms'] = $this->language->get('ms');
     self::$lang_var['Navigation_Horizontal_Align'] = $this->language->get('Navigation_Horizontal_Align');
     self::$lang_var['Horizontal_Align_Bullets'] = $this->language->get('Horizontal_Align_Bullets');
     self::$lang_var['Navigation_Vertical_Align'] = $this->language->get('Navigation_Vertical_Align');
     self::$lang_var['Vertical_Align_Bullets'] = $this->language->get('Vertical_Align_Bullets');
     self::$lang_var['Navigation_Horizontal_Offset'] = $this->language->get('Navigation_Horizontal_Offset');
     self::$lang_var['Horizontal_position_Bullets'] = $this->language->get('Horizontal_position_Bullets');
     self::$lang_var['Navigation_Vertical_Offset'] = $this->language->get('Navigation_Vertical_Offset');
     self::$lang_var['current_Vertical_position'] = $this->language->get('current_Vertical_position');
     self::$lang_var['Left_Arrow_Horizontal'] = $this->language->get('Left_Arrow_Horizontal');
     self::$lang_var['Horizontal_Align_left'] = $this->language->get('Horizontal_Align_left');
     self::$lang_var['Left_Arrow_Vertical'] = $this->language->get('Left_Arrow_Vertical');
     self::$lang_var['Vertical_Align_left'] = $this->language->get('Vertical_Align_left');
     self::$lang_var['Left_Arrow_Offset'] = $this->language->get('Left_Arrow_Offset');
     self::$lang_var['Offset_Horizontal_position'] = $this->language->get('Offset_Horizontal_position');
     self::$lang_var['Vertical_Offset'] = $this->language->get('Vertical_Offset');
     self::$lang_var['Offset_Vertical_position'] = $this->language->get('Offset_Vertical_position');
     self::$lang_var['Right_Arrow_Horizontal'] = $this->language->get('Right_Arrow_Horizontal');
     self::$lang_var['Horizontal_Align'] = $this->language->get('Horizontal_Align');
     self::$lang_var['Right_Arrow_Align'] = $this->language->get('Right_Arrow_Align');
     self::$lang_var['Vertical_right_Arrow'] = $this->language->get('Vertical_right_Arrow');
     self::$lang_var['Right_Horizontal'] = $this->language->get('Right_Horizontal');
     self::$lang_var['current_Horizontal_position'] = $this->language->get('current_Horizontal_position');
     self::$lang_var['Right_Offset'] = $this->language->get('Right_Offset');
     self::$lang_var['position_negative_direction'] = $this->language->get('position_negative_direction');
     self::$lang_var['Thumb_Width'] = $this->language->get('Thumb_Width');
     self::$lang_var['thumb_selected'] = $this->language->get('thumb_selected');
     self::$lang_var['Thumb_Height'] = $this->language->get('Thumb_Height');
     self::$lang_var['Thumbnail_selected'] = $this->language->get('Thumbnail_selected');
     self::$lang_var['Thumb_Amount'] = $this->language->get('Thumb_Amount');
     self::$lang_var['Thumbs_visible_selected'] = $this->language->get('Thumbs_visible_selected');
     self::$lang_var['Hide_Under_Width'] = $this->language->get('Hide_Under_Width');
     self::$lang_var['Hide_slider_width'] = $this->language->get('Hide_slider_width');
     self::$lang_var['Hide_Layers_Under'] = $this->language->get('Hide_Layers_Under');
     self::$lang_var['Hide_layer_properties'] = $this->language->get('Hide_layer_properties');
     self::$lang_var['Hide_Layers_Under'] = $this->language->get('Hide_Layers_Under');
     self::$lang_var['layers_some_width'] = $this->language->get('layers_some_width');
     self::$lang_var['Start_With_Slide'] = $this->language->get('Start_With_Slide');
     self::$lang_var['Change_want_start'] = $this->language->get('Change_want_start');
     self::$lang_var['First_Transition_Active'] = $this->language->get('First_Transition_Active');
     self::$lang_var['overwrite_first_slide'] = $this->language->get('overwrite_first_slide');
     self::$lang_var['First_Transition_Type'] = $this->language->get('First_Transition_Type');
     self::$lang_var['First_slide_transition'] = $this->language->get('First_slide_transition');
     self::$lang_var['Replace_me'] = $this->language->get('Replace_me');
     self::$lang_var['First_Transition_Duration'] = $this->language->get('First_Transition_Duration');
     self::$lang_var['First_slide_duration'] = $this->language->get('First_slide_duration');
     self::$lang_var['First_Transition_Slot'] = $this->language->get('First_Transition_Slot');
     self::$lang_var['slide_divided'] = $this->language->get('slide_divided');
     self::$lang_var['JQuery_No_Conflict'] = $this->language->get('JQuery_No_Conflict');
     self::$lang_var['jquery_mode'] = $this->language->get('jquery_mode');
     self::$lang_var['JS_Includes_Body'] = $this->language->get('JS_Includes_Body');
     self::$lang_var['Putting_javascript_conflicts'] = $this->language->get('Putting_javascript_conflicts');
     self::$lang_var['True'] = $this->language->get('True');
     self::$lang_var['False'] = $this->language->get('False');
     self::$lang_var['Output_Filters_Protection'] = $this->language->get('Output_Filters_Protection');
     self::$lang_var['protection_against_wordpress'] = $this->language->get('protection_against_wordpress');
     self::$lang_var['Compressing_Output'] = $this->language->get('Compressing_Output');
     self::$lang_var['Echo_Output'] = $this->language->get('Echo_Output');
     self::$lang_var['Gallery'] = $this->language->get('Gallery');
     self::$lang_var['Posts'] = $this->language->get('Posts');
     self::$lang_var['Delete_Slide'] = $this->language->get('Delete_Slide');
     self::$lang_var['Edit_Slide'] = $this->language->get('Edit_Slide');
     self::$lang_var['Preview_Slide'] = $this->language->get('Preview_Slide');
     self::$lang_var['New_Post'] = $this->language->get('New_Post');
     self::$lang_var['To_Admin'] = $this->language->get('To_Admin');
     self::$lang_var['Editor_Admin'] = $this->language->get('Editor_Admin');
     self::$lang_var['Author_Editor_Admin'] = $this->language->get('Author_Editor_Admin');
     self::$lang_var['edit_plugin'] = $this->language->get('edit_plugin');
     self::$lang_var['off'] = $this->language->get('off');
     self::$lang_var['RevSlider_libraries'] = $this->language->get('RevSlider_libraries');
     self::$lang_var['shortcode_exists'] = $this->language->get('shortcode_exists');
     self::$lang_var['Pages_RevSlider'] = $this->language->get('Pages_RevSlider');
     self::$lang_var['Specify_homepage'] = $this->language->get('Specify_homepage');
     self::$lang_var['JS_Includes'] = $this->language->get('JS_Includes');
     self::$lang_var['fixing_javascript'] = $this->language->get('fixing_javascript');
     self::$lang_var['Export_option'] = $this->language->get('Export_option');
     self::$lang_var['export_Slider'] = $this->language->get('export_Slider');
     self::$lang_var['Enable_Logs'] = $this->language->get('Enable_Logs');
     self::$lang_var['Enable_console '] = $this->language->get('Enable_console');
     self::$lang_var['Slider_Title'] = $this->language->get('Slider_Title');
     self::$lang_var['title_slider'] = $this->language->get('title_slider');
     self::$lang_var['Slider_Alias'] = $this->language->get('Slider_Alias');
     self::$lang_var['alias_slider'] = $this->language->get('alias_slider');
     self::$lang_var['Display_Hook'] = $this->language->get('Title');
     self::$lang_var['Products'] = $this->language->get('Products');
     self::$lang_var['Specific_Products'] = $this->language->get('Specific_Products');
     self::$lang_var['Source_Type'] = $this->language->get('Source_Type');
     self::$lang_var['Types'] = $this->language->get('Types');
     self::$lang_var['Product_Categories'] = $this->language->get('Product_Categories');
     self::$lang_var['Sort_Posts'] = $this->language->get('Sort_Posts');
     self::$lang_var['Product_Image_Width'] = $this->language->get('Product_Image_Width');
     self::$lang_var['Product_Image_Height'] = $this->language->get('Product_Image_Height');
     self::$lang_var['Sort_Direction'] = $this->language->get('Sort_Direction');
     self::$lang_var['Max_Posts'] = $this->language->get('Max_Posts');
     self::$lang_var['Limit_Excerpt'] = $this->language->get('Limit_Excerpt');
     self::$lang_var['Template_Slider'] = $this->language->get('Template_Slider');
     self::$lang_var['Type_post'] = $this->language->get('Type_post');
     self::$lang_var['Specific_Posts'] = $this->language->get('Specific_Posts');
     self::$lang_var['Fixed'] = $this->language->get('Fixed');
     self::$lang_var['Custom'] = $this->language->get('Custom');
     self::$lang_var['Auto_Responsive'] = $this->language->get('Auto_Responsive');
     self::$lang_var['Full_Screen'] = $this->language->get('Full_Screen');
     self::$lang_var['Slider_Layout'] = $this->language->get('Slider_Layout');
     self::$lang_var['height_screen'] = $this->language->get('height_screen');
     self::$lang_var['Offset_Containers'] = $this->language->get('Offset_Containers');
     self::$lang_var['Defines_Offset'] = $this->language->get('Defines_Offset');
     self::$lang_var['Offset_Size'] = $this->language->get('Offset_Size');
     self::$lang_var['Fullscreen_Height'] = $this->language->get('Fullscreen_Height');
     self::$lang_var['FullScreen_Align'] = $this->language->get('FullScreen_Align');
     self::$lang_var['Unlimited_Height'] = $this->language->get('Unlimited_Height');
     self::$lang_var['Force_Full_Width'] = $this->language->get('Force_Full_Width');
     self::$lang_var['Min_Height'] = $this->language->get('Min_Height');
     self::$lang_var['Layers_Grid'] = $this->language->get('Layers_Grid');
     self::$lang_var['Responsive_Sizes'] = $this->language->get('Responsive_Sizes');
     self::$lang_var['shown_slides_list'] = $this->language->get('shown_slides_list');
     self::$lang_var['Slide_Title'] = $this->language->get('Slide_Title');
     self::$lang_var['excluded_slider'] = $this->language->get('excluded_slider');
     self::$lang_var['Published'] = $this->language->get('Published');
     self::$lang_var['Unpublished'] = $this->language->get('Unpublished');
     self::$lang_var['State'] = $this->language->get('State');
     self::$lang_var['language_slide'] = $this->language->get('language_slide');
     self::$lang_var['Language'] = $this->language->get('Language');
     self::$lang_var['slide_visible'] = $this->language->get('slide_visible');
     self::$lang_var['Visible_from'] = $this->language->get('Visible_from');
     self::$lang_var['slide_visible_reached'] = $this->language->get('slide_visible_reached');
     self::$lang_var['Visible_until'] = $this->language->get('Visible_until');
     self::$lang_var['appearance_transitions_slide'] = $this->language->get('appearance_transitions_slide');
     self::$lang_var['Transitions'] = $this->language->get('Transitions');
     self::$lang_var['slide_divided'] = $this->language->get('slide_dividedz');
     self::$lang_var['Slot_Amount'] = $this->language->get('Slot_Amount');
     self::$lang_var['Simple_Transitions'] = $this->language->get('Simple_Transitions');
     self::$lang_var['duration_transition'] = $this->language->get('duration_transition');
     self::$lang_var['Transition_Duration'] = $this->language->get('Transition_Duration');
     self::$lang_var['start_delay_value'] = $this->language->get('start_delay_value');
     self::$lang_var['end_delay_value'] = $this->language->get('end_delay_value');
     self::$lang_var['Delay'] = $this->language->get('Delay');
     self::$lang_var['Save_Performance'] = $this->language->get('Save_Performance');
     self::$lang_var['Enable_Link'] = $this->language->get('Enable_Link');
     self::$lang_var['Enable'] = $this->language->get('Enable');
     self::$lang_var['Disable'] = $this->language->get('Disable');
     self::$lang_var['Regular'] = $this->language->get('Regular');
     self::$lang_var['Link_Type'] = $this->language->get('Link_Type');
     self::$lang_var['To_Slide'] = $this->language->get('To_Slide');
     self::$lang_var['template_sliders_link'] = $this->language->get('template_sliders_link');
     self::$lang_var['Slide_Link'] = $this->language->get('Slide_Link');
     self::$lang_var['Target_slide_link'] = $this->language->get('Target_slide_link');
     self::$lang_var['Same_Window'] = $this->language->get('Same_Window');
     self::$lang_var['New_Window'] = $this->language->get('New_Window');
     self::$lang_var['Link_Open'] = $this->language->get('Link_Open');
     self::$lang_var['Not_Chosen'] = $this->language->get('Not_Chosen');
     self::$lang_var['Next_Slide'] = $this->language->get('Next_Slide');
     self::$lang_var['Previous_Slide'] = $this->language->get('Previous_Slide');
     self::$lang_var['Scroll_Below_Slider'] = $this->language->get('Scroll_Below_Slider');
     self::$lang_var['Slide_Thumbnail_Image'] = $this->language->get('Slide_Thumbnail_Image');
     self::$lang_var['Thumbnail'] = $this->language->get('Thumbnail');
     self::$lang_var['Background_Type'] = $this->language->get('Background_Type');
     self::$lang_var['rev_special_class'] = $this->language->get('rev_special_class');
     self::$lang_var['Class'] = $this->language->get('Class');
     self::$lang_var['rev_special_id'] = $this->language->get('rev_special_id');
     self::$lang_var['rev_special_attr'] = $this->language->get('rev_special_attr');
     self::$lang_var['Attribute'] = $this->language->get('Attribute');
     self::$lang_var['Attributes_data_custom'] = $this->language->get('Attributes_data_custom');
     self::$lang_var['Custom_Fields'] = $this->language->get('Custom_Fields');
     self::$lang_var['Layer_Params'] = $this->language->get('Layer_Params');
     self::$lang_var['layer_params'] = $this->language->get('layer_params');
     self::$lang_var['caption_green'] = $this->language->get('caption_green');
     self::$lang_var['Style'] = $this->language->get('Style');
     self::$lang_var['Text_Html'] = $this->language->get('Text_Html');
     self::$lang_var['Image_Link'] = $this->language->get('Image_Link');
     self::$lang_var['Same_Window'] = $this->language->get('Same_Window');
     self::$lang_var['New_Window'] = $this->language->get('New_Window');
     self::$lang_var['Link_Open_In'] = $this->language->get('Link_Open_In');
     self::$lang_var['Start_Animation'] = $this->language->get('Start_Animation');
     self::$lang_var['Start_Easing'] = $this->language->get('Start_Easing');
     self::$lang_var['ms_keep_low'] = $this->language->get('ms_keep_low');
     self::$lang_var['Split_Text_per'] = $this->language->get('Split_Text_per');
     self::$lang_var['Hide_Under_Width'] = $this->language->get('Hide_Under_Width');
     self::$lang_var['Link_ID'] = $this->language->get('Link_ID');
     self::$lang_var['Link_Classes'] = $this->language->get('Link_Classes');
     self::$lang_var['Link_Title'] = $this->language->get('Link_Title');
     self::$lang_var['Link_Rel'] = $this->language->get('Link_Rel');
     self::$lang_var['Width_Height'] = $this->language->get('Width_Height');
     self::$lang_var['Scale_Proportional'] = $this->language->get('Scale_Proportional');
     self::$lang_var['No_Movement'] = $this->language->get('No_Movement');
     self::$lang_var['4'] = $this->language->get('4');
     self::$lang_var['5'] = $this->language->get('5');
     self::$lang_var['6'] = $this->language->get('6');
     self::$lang_var['7'] = $this->language->get('7');
     self::$lang_var['8'] = $this->language->get('8');
     self::$lang_var['9'] = $this->language->get('9');
     self::$lang_var['10'] = $this->language->get('10');
     self::$lang_var['Level'] = $this->language->get('Level');
     self::$lang_var['OffsetX'] = $this->language->get('OffsetX');
     self::$lang_var['X'] = $this->language->get('X');
     self::$lang_var['OffsetY'] = $this->language->get('OffsetY');
     self::$lang_var['Y'] = $this->language->get('Y');
     self::$lang_var['Hor_Align'] = $this->language->get('Hor_Align');
     self::$lang_var['Vert_Align'] = $this->language->get('Vert_Align');
     self::$lang_var['nbsp_auto'] = $this->language->get('nbsp_auto');
     self::$lang_var['Max_Width'] = $this->language->get('Max_Width');
     self::$lang_var['Max_Height'] = $this->language->get('Max_Height');
     self::$lang_var['2D_Rotation'] = $this->language->get('2D_Rotation');
     self::$lang_var['Rotation_Origin_X'] = $this->language->get('Rotation_Origin_X');
     self::$lang_var['Rotation_Origin_Y'] = $this->language->get('Rotation_Origin_Y');
     self::$lang_var['Normal'] = $this->language->get('Normal');
     self::$lang_var['Pre'] = $this->language->get('Pre');
     self::$lang_var['No_Wrap'] = $this->language->get('No_Wrap');
     self::$lang_var['Pre_Wrap'] = $this->language->get('Pre_Wrap');
     self::$lang_var['Pre_Line'] = $this->language->get('Pre_Line');
     self::$lang_var['White_Space'] = $this->language->get('White_Space');
     self::$lang_var['Link_To_Slide'] = $this->language->get('Link_To_Slide');
     self::$lang_var['Scroll_Under_Slider'] = $this->language->get('Scroll_Under_Slider');
     self::$lang_var['Change_Image_Source'] = $this->language->get('Change_Image_Source');
     self::$lang_var['Edit_Video'] = $this->language->get('Edit_Video');
     self::$lang_var['End_Time'] = $this->language->get('End_Time');
     self::$lang_var['End_Duration'] = $this->language->get('End_Duration');
     self::$lang_var['End_Animation'] = $this->language->get('End_Animation');
     self::$lang_var['End_Easing'] = $this->language->get('End_Easing');
     self::$lang_var['No_Corner'] = $this->language->get('No_Corner');
     self::$lang_var['Sharp'] = $this->language->get('Sharp');
     self::$lang_var['Sharp_Reversed'] = $this->language->get('Sharp_Reversed');
     self::$lang_var['Left_Corner'] = $this->language->get('Left_Corner');
     self::$lang_var['Right_Corner'] = $this->language->get('Right_Corner');
     self::$lang_var['Responsive_Levels'] = $this->language->get('Responsive_Levels');
     self::$lang_var['Classes'] = $this->language->get('Classes');
     self::$lang_var['Rel'] = $this->language->get('Rel');
     self::$lang_var['Pendulum'] = $this->language->get('Pendulum');
     self::$lang_var['Slideloop'] = $this->language->get('Slideloop');
     self::$lang_var['Pulse'] = $this->language->get('Pulse');
     self::$lang_var['Wave'] = $this->language->get('Wave');
     self::$lang_var['Animation'] = $this->language->get('Animation');
     self::$lang_var['Speed'] = $this->language->get('Speed');
     self::$lang_var['nbsp'] = $this->language->get('nbsp');
     self::$lang_var['Start_Degree'] = $this->language->get('Start_Degree');
     self::$lang_var['End_Degree'] = $this->language->get('End_Degree');
     self::$lang_var['&nbsp'] = $this->language->get('&nbsp');
     self::$lang_var['x_Origin'] = $this->language->get('x_Origin');
     self::$lang_var['%'] = $this->language->get('%');
     self::$lang_var['y_Origin'] = $this->language->get('y_Origin');
     self::$lang_var['%_250'] = $this->language->get('%_250');
     self::$lang_var['x_Start_Pos'] = $this->language->get('x_Start_Pos');
     self::$lang_var['x_End_Pos'] = $this->language->get('x_End_Pos');
     self::$lang_var['2000px_2000px)'] = $this->language->get('2000px_2000px');
     self::$lang_var['y_Start_Pos'] = $this->language->get('y_Start_Pos');
     self::$lang_var['y_End_Pos'] = $this->language->get('y_End_Pos');
     self::$lang_var['px_2000px'] = $this->language->get('px_2000px');
     self::$lang_var['Start_Zoom'] = $this->language->get('Start_Zoom');
     self::$lang_var['End_Zoom'] = $this->language->get('End_Zoom');
     self::$lang_var['nbsp_20'] = $this->language->get('nbsp_20');
     self::$lang_var['Angle'] = $this->language->get('Angle');
     self::$lang_var['0°_360°'] = $this->language->get('0°_360°');
     self::$lang_var['Radius'] = $this->language->get('Radius');
     self::$lang_var['0px_2000px'] = $this->language->get('0px_2000px');
     self::$lang_var['Easing'] = $this->language->get('Easing');
     self::$lang_var['LAYERS_GRID_desc'] = $this->language->get('LAYERS_GRID_desc');
     self::$lang_var['Add_Static_Image'] = $this->language->get('Add_Static_Image');
     self::$lang_var['Add_Static_Video'] = $this->language->get('Add_Static_Video');
     self::$lang_var['Setup_Slider_Position'] = $this->language->get('Setup_Slider_Position');
     self::$lang_var['sds_Layout'] = $this->language->get('sds_Layout');
     self::$lang_var['sds_Status'] = $this->language->get('sds_Status');
     self::$lang_var['sds_Short_Order'] = $this->language->get('sds_Short_Order');
     self::$lang_var['sds_Enabled'] = $this->language->get('sds_Enabled');
     self::$lang_var['sds_Save_Position'] = $this->language->get('sds_Save_Position');
     self::$lang_var['sds_Add_New'] = $this->language->get('sds_Add_New');
     self::$lang_var['sds_Content_Top'] = $this->language->get('sds_Content_Top');
     self::$lang_var['sds_Content_Bottom'] = $this->language->get('sds_Content_Bottom');
     self::$lang_var['sds_Content_Left'] = $this->language->get('sds_Content_Left');
     self::$lang_var['sds_Content_Right'] = $this->language->get('sds_Content_Right');
     self::$lang_var['li_container'] = $this->language->get('li_container');
     self::$lang_var['jQuery_object'] = $this->language->get('jQuery_object');
     self::$lang_var['Position_Setting'] = $this->language->get('Position_Setting');
     self::$lang_var['Fonts_Setting'] = $this->language->get('Fonts_Setting');
     self::$lang_var['Off'] = $this->language->get('Off');
     self::$lang_var['Enable_console'] = $this->language->get('Enable_console');
     self::$lang_var['Specific_Post'] = $this->language->get('Specific_Post');
     self::$lang_var['settings'] = $this->language->get('settings');
     self::$lang_var['2000px_2000px'] = $this->language->get('2000px_2000px');
     self::$lang_var['Use_Multi_Language'] = $this->language->get('Use_Multi_Language');
     self::$lang_var['Use_Multi_Language_desc'] = $this->language->get('Use_Multi_Language_desc');
     self::$lang_var['Enable_Static_Layers'] = $this->language->get('Enable_Static_Layers');
     self::$lang_var['Enable_Static_Layers_desc'] = $this->language->get('Enable_Static_Layers_desc');
     self::$lang_var['Next_Slide_on_Focus'] = $this->language->get('Next_Slide_on_Focus');
     self::$lang_var['Simplify_IOS4_IE8'] = $this->language->get('Simplify_IOS4_IE8');
     self::$lang_var['Simplyfies'] = $this->language->get('Simplyfies');
     self::$lang_var['Loop_Progress'] = $this->language->get('Loop_Progress');
     self::$lang_var['Stop_Slider'] = $this->language->get('Stop_Slider');
     self::$lang_var['Show_Progressbar'] = $this->language->get('Show_Progressbar');
     self::$lang_var['Show_running_progressbar'] = $this->language->get('Show_running_progressbar');
     self::$lang_var['Loop_Single_Slide'] = $this->language->get('Loop_Single_Slide');
     self::$lang_var['ILoop_Single_Slidef'] = $this->language->get('ILoop_Single_Slidef');
     self::$lang_var['underneath_banner'] = $this->language->get('underneath_banner');
     self::$lang_var['Background_transparent_slides'] = $this->language->get('Background_transparent_slides');
     self::$lang_var['Dotted_Overlay_Size'] = $this->language->get('Dotted_Overlay_Size');
     self::$lang_var['dotted_overlay'] = $this->language->get('dotted_overlay');
     self::$lang_var['background_fitted'] = $this->language->get('background_fitted');
     self::$lang_var['background_repeated_into'] = $this->language->get('background_repeated_into');
     self::$lang_var['background_positioned_Slider'] = $this->language->get('background_positioned_Slider');
     self::$lang_var['Keyboard_Navigation'] = $this->language->get('Keyboard_Navigation');
     self::$lang_var['navigate_keyboard'] = $this->language->get('navigate_keyboard');
     self::$lang_var['Bullet_Type'] = $this->language->get('Bullet_Type');
     self::$lang_var['Bullets_Thumbnail_Position'] = $this->language->get('Bullets_Thumbnail_Position');
     self::$lang_var['Select_Spinner_Slider'] = $this->language->get('Select_Spinner_Slider');
     self::$lang_var['Color_Spinner_shown'] = $this->language->get('Color_Spinner_shown');
     self::$lang_var['Spinner_Color'] = $this->language->get('Spinner_Color');
     self::$lang_var['Spinner'] = $this->language->get('Spinner');
     self::$lang_var['Parallax'] = $this->language->get('Parallax');
     self::$lang_var['Enable_Parallax'] = $this->language->get('Enable_Parallax');
     self::$lang_var['parallax_effect'] = $this->language->get('parallax_effect');
     self::$lang_var['Disable_on_Mobile'] = $this->language->get('Disable_on_Mobile');
     self::$lang_var['parallax_effect_desc'] = $this->language->get('parallax_effect_desc');
     self::$lang_var['parallax_effect_react'] = $this->language->get('parallax_effect_react');
     self::$lang_var['Mouse_Position'] = $this->language->get('Mouse_Position');
     self::$lang_var['Scroll_Position'] = $this->language->get('Scroll_Position');
     self::$lang_var['Mouse_and_Scroll'] = $this->language->get('Mouse_and_Scroll');
     self::$lang_var['BG_Freeze'] = $this->language->get('BG_Freeze');
     self::$lang_var['freeze_background'] = $this->language->get('freeze_background');
     self::$lang_var['Level_Depth_1'] = $this->language->get('Level_Depth_1');
     self::$lang_var['Level_Depth_desc'] = $this->language->get('Level_Depth_desc');
     self::$lang_var['Level_Depth_2'] = $this->language->get('Level_Depth_2');
     self::$lang_var['Level_Depth_3'] = $this->language->get('Level_Depth_3');
     self::$lang_var['Level_Depth_4'] = $this->language->get('Level_Depth_4');
     self::$lang_var['Level_Depth_5'] = $this->language->get('Level_Depth_5');
     self::$lang_var['Level_Depth_6'] = $this->language->get('Level_Depth_6');
     self::$lang_var['Level_Depth_7'] = $this->language->get('Level_Depth_7');
     self::$lang_var['Level_Depth_8'] = $this->language->get('Level_Depth_8');
     self::$lang_var['Level_Depth_9'] = $this->language->get('Level_Depth_9');
     self::$lang_var['Level_Depth_10'] = $this->language->get('Level_Depth_10');
     self::$lang_var['Mobile_Touch'] = $this->language->get('Mobile_Touch');
     self::$lang_var['Swipe_Treshhold'] = $this->language->get('Swipe_Treshhold');
     self::$lang_var['sensibility_gestures'] = $this->language->get('sensibility_gestures');
     self::$lang_var['Swipe_Min_Finger'] = $this->language->get('Swipe_Min_Finger');
     self::$lang_var['Swipe_Min_Finger_desc'] = $this->language->get('Swipe_Min_Finger_desc');
     self::$lang_var['Drag_Block_Vertical'] = $this->language->get('Drag_Block_Vertical');
     self::$lang_var['Drag_Block_Vertical_desc'] = $this->language->get('Drag_Block_Vertical_desc');
     self::$lang_var['Disable_Slider_Mobile'] = $this->language->get('Disable_Slider_Mobile');
     self::$lang_var['Disable_Slider_Mobile_desc'] = $this->language->get('Disable_Slider_Mobile_desc');
     self::$lang_var['Disable_KenBurn_Mobile'] = $this->language->get('Disable_KenBurn_Mobile');
     self::$lang_var['Disable_KenBurn_Mobile_desc'] = $this->language->get('Disable_KenBurn_Mobile_desc');
     self::$lang_var['Hide_Arrows_Mobile'] = $this->language->get('Hide_Arrows_Mobile');
     self::$lang_var['Bullet_Type_desc'] = $this->language->get('Bullet_Type_desc');
     self::$lang_var['Hide_Bullets_Mobile'] = $this->language->get('Hide_Bullets_Mobile');
     self::$lang_var['ShowHideNavigationBullets'] = $this->language->get('ShowHideNavigationBullets');
     self::$lang_var['Hide_Thumbnails_Mobile'] = $this->language->get('Hide_Thumbnails_Mobile');
     self::$lang_var['ShowHideThumbnailsBullets'] = $this->language->get('ShowHideThumbnailsBullets');
     self::$lang_var['Hide_Thumbs_Under_Width'] = $this->language->get('Hide_Thumbs_Under_Width');
     self::$lang_var['Thumbnails_Mobile_Devices'] = $this->language->get('Thumbnails_Mobile_Devices');
     self::$lang_var['Hide_Mobile_After'] = $this->language->get('Hide_Mobile_After');
     self::$lang_var['Hide_Mobile_After_desc'] = $this->language->get('Hide_Mobile_After_desc');
     self::$lang_var['Alternative_First_Slide'] = $this->language->get('Alternative_First_Slide');
     self::$lang_var['Global_Overwrites'] = $this->language->get('Global_Overwrites');
     self::$lang_var['Reset_Transitions'] = $this->language->get('Reset_Transitions');
     self::$lang_var['Reset_Transitions_desc'] = $this->language->get('Reset_Transitions_desc');
     self::$lang_var['Choose_operate'] = $this->language->get('Choose_operate');
     self::$lang_var['Random_Flat'] = $this->language->get('Random_Flat');
     self::$lang_var['Random_Premium'] = $this->language->get('Random_Premium');
     self::$lang_var['Random_Flat_Premium'] = $this->language->get('Random_Flat_Premium');
     self::$lang_var['Slide_To_Top'] = $this->language->get('Slide_To_Top');
     self::$lang_var['Slide_To_Bottom'] = $this->language->get('Slide_To_Bottom');
     self::$lang_var['Slide_To_Right'] = $this->language->get('Slide_To_Right');
     self::$lang_var['Slide_To_Left'] = $this->language->get('Slide_To_Left');
     self::$lang_var['Slide_Horizontal'] = $this->language->get('Slide_Horizontal');
     self::$lang_var['Slide_Vertical'] = $this->language->get('Slide_Vertical');
     self::$lang_var['Slide_Boxes'] = $this->language->get('Slide_Boxes');
     self::$lang_var['Slide_Slots_Horizontal'] = $this->language->get('Slide_Slots_Horizontal');
     self::$lang_var['Slide_Slots_Verticall'] = $this->language->get('Slide_Slots_Verticall');
     self::$lang_var['No_Transition'] = $this->language->get('No_Transition');
     self::$lang_var['Fade'] = $this->language->get('Fade');
     self::$lang_var['Fade_Boxes'] = $this->language->get('Fade_Boxes');
     self::$lang_var['Fade_Slots_Horizontal'] = $this->language->get('Fade_Slots_Horizontal');
     self::$lang_var['Fade_Slots_Vertical'] = $this->language->get('Fade_Slots_Vertical');
     self::$lang_var['Fade_Slide_Right'] = $this->language->get('Fade_Slide_Right');
     self::$lang_var['Fade_Slide_Left'] = $this->language->get('Fade_Slide_Left');
     self::$lang_var['Fade_Slide_Top'] = $this->language->get('Fade_Slide_Top');
     self::$lang_var['Fade_Slide_Bottom'] = $this->language->get('Fade_Slide_Bottom');
     self::$lang_var['Fade_To_Left'] = $this->language->get('Fade_To_Left');
     self::$lang_var['Fade_To_Right'] = $this->language->get('Fade_To_Right');
     self::$lang_var['Fade_To_Top'] = $this->language->get('Fade_To_Top');
     self::$lang_var['Fade_To_Bottom'] = $this->language->get('Fade_To_Bottom');
     self::$lang_var['Parallax_Right'] = $this->language->get('Parallax_Right');
     self::$lang_var['Parallax_Left'] = $this->language->get('Parallax_Left');
     self::$lang_var['Parallax_Top'] = $this->language->get('Parallax_Top');
     self::$lang_var['Parallax_Bottom'] = $this->language->get('Parallax_Bottom');
     self::$lang_var['Zoom_Out'] = $this->language->get('Zoom_Out');
     self::$lang_var['Zoom_OutLeft'] = $this->language->get('Zoom_OutLeft');
     self::$lang_var['Zoom_OutTop'] = $this->language->get('Zoom_OutTop');
     self::$lang_var['Zoom_OutBottom'] = $this->language->get('Zoom_OutBottom');
     self::$lang_var['Zoom_Slots_Vertical'] = $this->language->get('Zoom_Slots_Vertical');
     self::$lang_var['Curtain_Left'] = $this->language->get('Curtain_Left');
     self::$lang_var['Curtain_Middle'] = $this->language->get('Curtain_Middle');
     self::$lang_var['Curtain_Right'] = $this->language->get('Curtain_Right');
     self::$lang_var['Curtain_Horizontal'] = $this->language->get('Curtain_Horizontal');
     self::$lang_var['Curtain_Vertical'] = $this->language->get('Curtain_Vertical');
     self::$lang_var['Cube_Vertical'] = $this->language->get('Cube_Vertical');
     self::$lang_var['Cube_Horizontal'] = $this->language->get('Cube_Horizontal');
     self::$lang_var['In_Cube_Vertical'] = $this->language->get('In_Cube_Vertical');
     self::$lang_var['In_Cube_Horizontal'] = $this->language->get('In_Cube_Horizontal');
     self::$lang_var['TurnOff_Horizontal'] = $this->language->get('TurnOff_Horizontal');
     self::$lang_var['TurnOff_Vertical'] = $this->language->get('TurnOff_Vertical');
     self::$lang_var['Paper_Cut'] = $this->language->get('Paper_Cut');
     self::$lang_var['Fly_In'] = $this->language->get('Fly_In');
     self::$lang_var['Reset_Transition_Duration'] = $this->language->get('Reset_Transition_Duration');
     self::$lang_var['Troubleshooting'] = $this->language->get('Troubleshooting');
     self::$lang_var['Reset_all_Duration'] = $this->language->get('Reset_all_Duration');
     self::$lang_var['Troubleshooting'] = $this->language->get('Troubleshooting');
     self::$lang_var['JQuery_Conflict_Mode'] = $this->language->get('JQuery_Conflict_Mode');
     self::$lang_var['JQuery_Conflict_desc'] = $this->language->get('JQuery_Conflict_desc');
     self::$lang_var['Put_JS_Body'] = $this->language->get('Put_JS_Body');
     self::$lang_var['Put_JS_Body_desc'] = $this->language->get('Put_JS_Body_desc');
     self::$lang_var['Output_Filters_Protection'] = $this->language->get('Output_Filters_Protection');
     self::$lang_var['Output_Filters_desc'] = $this->language->get('Output_Filters_desc');
     self::$lang_var['By_Compressing_Output'] = $this->language->get('By_Compressing_Output');
     self::$lang_var['By_Echo_Output'] = $this->language->get('By_Echo_Output');
     self::$lang_var['Google_Font_Settings'] = $this->language->get('Google_Font_Settings');
     self::$lang_var['Google_Font_Settings_desc'] = $this->language->get('Google_Font_Settings_desc');
     self::$lang_var['Load_Google_Font'] = $this->language->get('Load_Google_Font');
     self::$lang_var['Load_Google_desc'] = $this->language->get('Load_Google_desc');
     self::$lang_var['google_families_load'] = $this->language->get('google_families_load');
     self::$lang_var['Choose_Spinner'] = $this->language->get('Choose_Spinner');
     self::$lang_var['Type'] = $this->language->get('Type');
     self::$lang_var['Next_Slide_Focus'] = $this->language->get('Next_Slide_Focus');
     // end language
     $data['heading_title'] = $this->language->get('heading_title');
     $data['button_save'] = $this->language->get('button_save');
     $data['button_cancel'] = $this->language->get('button_cancel');
     $data['action'] = $this->url->link('module/revslideropencart', 'token=' . $this->session->data['token'], 'SSL');
     $data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
     $data['modules'] = array();
     if (isset($this->request->post['revslideropencart_module'])) {
         $data['modules'] = $this->request->post['revslideropencart_module'];
     } elseif ($this->config->get('revslideropencart_module')) {
         $data['modules'] = $this->config->get('revslideropencart_module');
     }
     $this->load->model('design/layout');
     $data['layouts'] = $this->model_design_layout->getLayouts();
     $this->load->model('design/banner');
     $data['banners'] = $this->model_design_banner->getBanners();
     $this->template = 'module/revslideropencart.tpl';
     $this->children = array('common/header', 'common/footer');
     //start revsslider custom code
     ob_start();
     $productAdmin = new RevSliderAdmin(ABSPATH);
     $data['rev_content'] = ob_get_contents();
     ob_end_clean();
     //end revsslider custom code
     $data['header'] = $this->load->controller('common/header');
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['footer'] = $this->load->controller('common/footer');
     $this->response->setOutput($this->load->view('module/revslideropencart.tpl', $data));
 }
Ejemplo n.º 13
0
 public function export_essential_grid()
 {
     require_once ABSPATH . 'wp-content/plugins/essential-grid/essential-grid.php';
     $c_grid = new Essential_Grid();
     $export_grids = array();
     $grids = $c_grid->get_essential_grids();
     foreach ($grids as $grid) {
         $export_grids[] = $grid->id;
     }
     $export_skins = array();
     $item_skin = new Essential_Grid_Item_Skin();
     $skins = $item_skin->get_essential_item_skins('all', false);
     foreach ($skins as $skin) {
         $export_grids[] = $skin['id'];
     }
     $export_elements = array();
     $c_elements = new Essential_Grid_Item_Element();
     $elements = $c_elements->get_essential_item_elements();
     foreach ($elements as $element) {
         $export_elements[] = $element['id'];
     }
     $export_navigation_skins = array();
     $c_nav_skins = new Essential_Grid_Navigation();
     $nav_skins = $c_nav_skins->get_essential_navigation_skins();
     foreach ($nav_skins as $nav_skin) {
         $export_navigation_skins[] = $nav_skin['id'];
     }
     $export_custom_meta = array();
     $metas = new Essential_Grid_Meta();
     $custom_metas = $metas->get_all_meta();
     foreach ($custom_metas as $custom_meta) {
         $export_custom_meta[] = $custom_meta['handle'];
     }
     $export_punch_fonts = array();
     $fonts = new ThemePunch_Fonts();
     $custom_fonts = $fonts->get_all_fonts();
     foreach ($custom_fonts as $custom_font) {
         $export_punch_fonts[] = $custom_font['handle'];
     }
     $export = array();
     $ex = new Essential_Grid_Export();
     //export Grids
     if (!empty($export_grids)) {
         $export['grids'] = $ex->export_grids($export_grids);
     }
     //export Skins
     if (!empty($export_skins)) {
         $export['skins'] = $ex->export_skins($export_skins);
     }
     //export Elements
     if (!empty($export_elements)) {
         $export['elements'] = $ex->export_elements($export_elements);
     }
     //export Navigation Skins
     if (!empty($export_navigation_skins)) {
         $export['navigation-skins'] = $ex->export_navigation_skins($export_navigation_skins);
     }
     //export Custom Meta
     if (!empty($export_custom_meta)) {
         $export['custom-meta'] = $ex->export_custom_meta($export_custom_meta);
     }
     //export Punch Fonts
     if (!empty($export_punch_fonts)) {
         $export['punch-fonts'] = $ex->export_punch_fonts($export_punch_fonts);
     }
     //export Global Styles
     $export['global-css'] = $ex->export_global_styles('on');
     $this->save_as_txt_file('essential_grid.txt', json_encode($export));
 }
 function installSampleData()
 {
     error_reporting(E_ALL);
     ob_start();
     ob_clean();
     $this->code = 0;
     $this->buffer = null;
     $dataImport = array();
     if (array_key_exists('code', $_POST)) {
         $this->code = (int) $_POST['code'];
     }
     if (array_key_exists('buffer', $_POST)) {
         $this->buffer = stripslashes($_POST['buffer']);
     }
     if (array_key_exists('data_import', $_POST)) {
         $dataImport = (array) $_POST['data_import'];
     }
     if (count($dataImport) == 0) {
         $this->createResponse(__('Please select at least one option of data which need to be imported.', PLUGIN_THEME_INSTALLER_DOMAIN), true);
     }
     global $ti_data;
     if (!ini_get('safe_mode')) {
         set_time_limit(0);
         ini_set('memory_limit', '512M');
     }
     if (in_array(1, $dataImport)) {
         /***/
         if (array_key_exists('plugin_timetable', $ti_data)) {
             if ($this->checkCode(10000)) {
                 global $wpdb;
                 $wpdb->query($ti_data['plugin_timetable']['sql']);
                 $this->createResponse(null, false, 10001);
             }
         }
         /***/
         if (array_key_exists('plugin_revslider', $ti_data)) {
             if (class_exists('ThemePunch_Fonts')) {
                 if (array_key_exists('font', $ti_data['plugin_revslider'])) {
                     if ($this->checkCode(10001)) {
                         $Font = new ThemePunch_Fonts();
                         foreach ($ti_data['plugin_revslider']['font'] as $fontValue) {
                             $Font->add_new_font($fontValue);
                         }
                         $this->createResponse(null, false, 10002);
                     }
                 }
             }
             if (class_exists('RevSlider')) {
                 if (array_key_exists('path', $ti_data['plugin_revslider'])) {
                     if ($this->checkCode(10002)) {
                         $Slider = new RevSlider();
                         $Slider->importSliderFromPost(true, true, $ti_data['plugin_revslider']['path']);
                         $this->createResponse(null, false, 10003);
                     }
                 }
             }
         }
         /***/
         if (!defined('WP_LOAD_IMPORTERS')) {
             define('WP_LOAD_IMPORTERS', true);
         }
         TIInclude::includeFile(ABSPATH . 'wp-admin/includes/import.php');
         $includeClass = array(array('class' => 'WP_Importer', 'path' => ABSPATH . 'wp-admin/includes/class-wp-importer.php'), array('class' => 'WP_Import', 'path' => PLUGIN_THEME_INSTALLER_LIBRARY_PATH . 'wordpress-importer.php'));
         foreach ($includeClass as $value) {
             $r = TIInclude::includeClass($value['path'], array($value['class']));
             if ($r !== true) {
                 break;
             }
         }
         if ($r === false) {
             $this->createResponse(__('Auto import feature couldn\'t be loaded. Please make import manually. You can find import dummy files in folder dummy_content.', PLUGIN_THEME_INSTALLER_DOMAIN));
         }
         foreach ($ti_data['value']['dummy_content_file'] as $index => $value) {
             if ($this->checkCode(20000 + $index)) {
                 $Import = new WP_Import();
                 $Import->fetch_attachments = true;
                 $Import->import($value['path']);
                 $this->createResponse(null, false, 20000 + $index + 1);
             }
         }
         /***/
         if ($this->checkCode(30000)) {
             if (array_key_exists('meta', $ti_data)) {
                 foreach ($ti_data['meta'] as $aIndex => $aValue) {
                     switch ($aIndex) {
                         case 'post_menu':
                             $post = get_page_by_title($aValue['post_title'], 'OBJECT', $aValue['post_type']);
                             if (is_null($post)) {
                                 break;
                             }
                             $menu = get_term_by('name', $aValue['menu_title'], 'nav_menu');
                             if ($menu === false) {
                                 break;
                             }
                             $meta = get_post_meta($post->ID, THEME_OPTION_PREFIX, true);
                             if ($meta === false) {
                                 $meta = array();
                             }
                             $meta[$aValue['meta_name']] = $menu->term_id;
                             update_post_meta($post->ID, THEME_OPTION_PREFIX, $meta);
                             break;
                     }
                 }
             }
             $this->createResponse(null, false, 40000);
         }
     }
     /**********************************************************************/
     if ($this->checkCode(40000)) {
         if (in_array(2, $dataImport)) {
             if (array_key_exists('widget_settings_file', $ti_data['value'])) {
                 foreach ($ti_data['value']['widget_settings_file'] as $file) {
                     $json_data = json_decode(file_get_contents($file['path']), true);
                     $widget_data = $json_data[1];
                     $sidebars_data = $json_data[0];
                     $current_sidebars = get_option('sidebars_widgets');
                     $current_sidebars['wp_inactive_widgets'] = array();
                     update_option('sidebars_widgets', $current_sidebars);
                     $new_widgets = array();
                     foreach ($sidebars_data as $import_sidebar => $import_widgets) {
                         foreach ($import_widgets as $import_widget) {
                             $title = trim(substr($import_widget, 0, strrpos($import_widget, '-')));
                             $index = trim(substr($import_widget, strrpos($import_widget, '-') + 1));
                             $current_widget_data = get_option('widget_' . $title);
                             $new_widget_name = $this->getNewWidgetName($title, $index);
                             $new_index = trim(substr($new_widget_name, strrpos($new_widget_name, '-') + 1));
                             if (!empty($new_widgets[$title]) && is_array($new_widgets[$title])) {
                                 while (array_key_exists($new_index, $new_widgets[$title])) {
                                     $new_index++;
                                 }
                             }
                             $current_sidebars[$import_sidebar][] = $title . '-' . $new_index;
                             if (array_key_exists($title, $new_widgets)) {
                                 $new_widgets[$title][$new_index] = $widget_data[$title][$index];
                                 $multiwidget = $new_widgets[$title]['_multiwidget'];
                                 unset($new_widgets[$title]['_multiwidget']);
                                 $new_widgets[$title]['_multiwidget'] = $multiwidget;
                             } else {
                                 $current_widget_data[$new_index] = $widget_data[$title][$index];
                                 $current_multiwidget = null;
                                 if (array_key_exists('_multiwidget', $current_widget_data)) {
                                     $current_multiwidget = $current_widget_data['_multiwidget'];
                                 }
                                 $new_multiwidget = $widget_data[$title]['_multiwidget'];
                                 $multiwidget = $current_multiwidget != $new_multiwidget ? $current_multiwidget : 1;
                                 unset($current_widget_data['_multiwidget']);
                                 $current_widget_data['_multiwidget'] = $multiwidget;
                                 $new_widgets[$title] = $current_widget_data;
                             }
                         }
                     }
                     if (isset($new_widgets) && isset($current_sidebars)) {
                         update_option('sidebars_widgets', $current_sidebars);
                         foreach ($new_widgets as $title => $content) {
                             update_option('widget_' . $title, $content);
                         }
                     }
                 }
                 $menu = get_terms('nav_menu');
                 foreach ($menu as $menuValue) {
                     $option = get_option('widget_nav_menu');
                     if (is_array($option)) {
                         foreach ($option as $optionIndex => $optionValue) {
                             if ($optionValue['title'] == $menuValue->name) {
                                 $option[$optionIndex]['nav_menu'] = $menuValue->term_id;
                                 update_option('widget_nav_menu', $option);
                                 break;
                             }
                         }
                     }
                 }
             }
         }
         $this->createResponse(null, false, 50000);
     }
     /**********************************************************************/
     if ($this->checkCode(50000)) {
         if (in_array(3, $dataImport)) {
             $option = array();
             foreach ($ti_data as $aIndex => $aValue) {
                 foreach ($aValue as $bIndex => $bValue) {
                     $result = null;
                     switch ($aIndex) {
                         case 'path':
                             if (array_key_exists('title', $bValue)) {
                                 $result = get_page_by_title($bValue['title'], 'OBJECT', $bValue['postType']);
                             }
                             if (is_null($result)) {
                                 break;
                             }
                             list($result) = wp_get_attachment_image_src($result->ID, 'full');
                             break;
                         case 'post_id':
                             if (array_key_exists('title', $bValue)) {
                                 $result = get_page_by_title($bValue['title'], 'OBJECT', $bValue['postType']);
                             }
                             if (is_null($result)) {
                                 break;
                             }
                             $result = $result->ID;
                             break;
                         case 'term_id':
                             if (array_key_exists('title', $bValue)) {
                                 $result = get_term_by('name', $bValue['title'], $bValue['taxonomy']);
                             }
                             if ($result === false) {
                                 $result = null;
                                 break;
                             }
                             $result = $result->term_id;
                             break;
                         case 'value':
                             if (array_key_exists('value', $bValue)) {
                                 $result = $bValue['value'];
                             }
                             break;
                         case 'option':
                             if ($bIndex == 'permalink_structure') {
                                 global $wp_rewrite;
                                 $wp_rewrite->set_permalink_structure($bValue);
                                 $result = null;
                             } else {
                                 $result = $bValue;
                             }
                             break;
                     }
                     if (!is_null($result)) {
                         if (preg_match('/^' . THEME_OPTION_PREFIX . '_/', $bIndex)) {
                             $key = mb_substr($bIndex, mb_strlen(THEME_OPTION_PREFIX) + 1);
                             $option[THEME_OPTION_PREFIX][$key] = $result;
                         } else {
                             $option['option'][$bIndex] = $result;
                         }
                     }
                 }
             }
             foreach ($option as $aIndex => $aValue) {
                 switch ($aIndex) {
                     case 'option':
                         foreach ($aValue as $bIndex => $bValue) {
                             update_option($bIndex, $bValue);
                         }
                         break;
                     case THEME_OPTION_PREFIX:
                         if (class_exists('ThemeOption')) {
                             ThemeOption::updateOption($option[THEME_OPTION_PREFIX]);
                         }
                         break;
                 }
             }
         }
     }
     /**********************************************************************/
     $page = get_page_by_title('Sample page', 'OBJECT', 'page');
     if (!is_null($page)) {
         wp_delete_post($page->ID);
     }
     $post = get_page_by_title('Hello world!', 'OBJECT', 'post');
     if (!is_null($post)) {
         wp_delete_post($post->ID);
     }
     /**********************************************************************/
     flush_rewrite_rules();
     /**********************************************************************/
     $this->createResponse(__('Seems, that demo data has been imported. To make sure if this process has been sucessfully completed, please check below content of buffer returned by external applications.', PLUGIN_THEME_INSTALLER_DOMAIN), false);
 }
 protected function index($setting)
 {
     $this->language->load('module/revslideropencart');
     if (!defined('rs_plugin_url')) {
         define('rs_plugin_url', REV_DIR_CONFIG . 'revslider/');
     }
     if (!defined('rs_admin_css')) {
         define('rs_admin_css', rs_plugin_url . 'css/');
     }
     if (!defined('rs_admin_js')) {
         define('rs_admin_js', rs_plugin_url . 'js/');
     }
     if (!defined('rs_admin_img')) {
         define('rs_admin_img', rs_plugin_url . 'images/');
     }
     if (!defined('rs_rs_plugin')) {
         define('rs_rs_plugin', rs_plugin_url . 'rs-plugin/');
     }
     static $module = 0;
     // start load external file
     // $this->config->load('revslider/revslider_front');
     // end load external file
     // start add font
     $font = new ThemePunch_Fonts();
     $fonts = $font->get_all_fonts();
     if (!empty($fonts)) {
         $http = get_http();
         foreach ($fonts as $font) {
             if ($font !== '') {
                 $url = $http . "fonts.googleapis.com/css?family=" . strip_tags($font['url']);
                 $this->document->addStyle($url);
             }
         }
     }
     // end add font
     // start load media file
     $this->document->addScript(rs_rs_plugin . 'js/jquery.themepunch.tools.min.js');
     $this->document->addScript(rs_rs_plugin . 'js/jquery.themepunch.revolution.min.js');
     $this->document->addStyle(rs_rs_plugin . 'css/settings.css');
     $this->document->addStyle(rs_rs_plugin . 'css/static-captions.css');
     $this->document->addStyle(rs_rs_plugin . 'css/dynamic-captions.css');
     $this->document->addStyle(rs_rs_plugin . 'css/captions.css');
     // end load media file
     // start revsliderfront setting
     $sliders = $this->hookCommonCb($setting['slider_id']);
     $content = '';
     $g_fonts = '';
     if (!empty($sliders)) {
         ob_start();
         foreach ($sliders as $slider) {
             $slider = (object) $slider;
             $params = json_decode($slider->params);
             $params->jquery_noconflict = 'off';
             if (isset($params->google_font) && is_array($params->google_font)) {
                 foreach ($params->google_font as $google_font) {
                     $g_fonts .= html_entity_decode($google_font);
                 }
             }
             RevSliderOutput::putSlider($setting['slider_id'], '');
         }
         $content = ob_get_contents();
         ob_end_clean();
     }
     $content .= $g_fonts;
     $this->data['rev_content'] = $content;
     // end revsliderfront setting
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/revslideropencart.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/module/revslideropencart.tpl';
     } else {
         $this->template = 'default/template/module/revslideropencart.tpl';
     }
     $this->render();
 }