Ejemplo n.º 1
0
/**
 * 
 * get revolution slider captions css
 */
function putRevCssCaptions()
{
    $tableCss = "#__" . GlobalsRevSlider::TABLE_CSS_NAME;
    $db = new UniteDBRev();
    $arrStyles = $db->fetch($tableCss);
    $cssStyles = UniteCssParserRev::parseDbArrayToCss($arrStyles, "\n");
    header('Content-type: text/css');
    echo $cssStyles;
    exit;
}
Ejemplo n.º 2
0
 /**
  * 
  * a must function. you can not use it, but the function must stay there!.
  *   
  */
 public static function onAddScripts()
 {
     $operations = new RevOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
     $includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
     $strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
     $isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
     //put the includes only on pages with active widget or shortcode
     // if the put in match, then include them always (ignore this if)
     if ($isPutIn == false && $includesGlobally == "off") {
         $isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
         $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
         if ($isWidgetActive == false && $hasShortcode == false) {
             return false;
         }
     }
     self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
     //check if dynamic-captions.css exists. If not, include captions.php
     if (file_exists(self::$path_plugin . "rs-plugin/css/dynamic-captions.css") == false) {
         self::addDynamicStyle("captions", "rs-plugin-captions", "rs-plugin/css");
     } else {
         $db = new UniteDBRev();
         $styles = $db->fetch(GlobalsRevSlider::$table_css);
         $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
         wp_add_inline_style('rs-plugin-settings', $styles);
         //self::addStyle("dynamic-captions","rs-captions","rs-plugin/css");
     }
     $custom_css = RevOperations::getStaticCss();
     wp_add_inline_style('rs-plugin-settings', $custom_css);
     //self::addStyle("static-captions","rs-plugin-static","rs-plugin/css");
     $setBase = is_ssl() ? "https://" : "http://";
     $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
     self::addScriptAbsoluteUrl($url_jquery, "jquery");
     if ($includesFooter == "off") {
         self::addScriptWaitFor("jquery.themepunch.plugins.min", "rs-plugin/js", 'themepunchtools', 'jquery');
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'jquery');
     } else {
         //put javascript to footer
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
Ejemplo n.º 3
0
 /**
  * 
  * @throws Exception
  */
 public function initProcess()
 {
     //        $loadTemplate = true;
     $revAction = Tools::getValue('revControllerAction');
     //        if(!empty($revAction))
     $loadTemplate = false;
     $productAdmin = new RevSliderAdmin(_PS_MODULE_DIR_ . 'revsliderprestashop', $loadTemplate);
     switch ($revAction) {
         case 'uploadimage':
             $this->rev_uploader();
             break;
         case 'captions':
             $db = new UniteDBRev();
             $styles = $db->fetch(GlobalsRevSlider::$table_css);
             header("Content-Type: text/css; charset=utf-8");
             echo UniteCssParserRev::parseDbArrayToCss($styles, "\n");
             break;
         default:
             break;
     }
     die;
 }
    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.º 5
0
 /**
  * 
  * a must function. adds scripts on the page
  * add all page scripts and styles here.
  * pelase don't remove this function
  * common scripts even if the plugin not load, use this function only if no choise.
  */
 public static function onAddScripts()
 {
     self::addStyle("edit_layers", "edit_layers");
     //add google font
     //$urlGoogleFont = "http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700";
     //self::addStyleAbsoluteUrl($urlGoogleFont,"google-font-pt-sans-narrow");
     self::addScriptCommon("edit_layers", "unite_layers");
     self::addScriptCommon("css_editor", "unite_css_editor");
     self::addScript("rev_admin");
     self::addScript("jquery.themepunch.plugins.min", "rs-plugin/js", 'themepunchtools');
     //include all media upload scripts
     self::addMediaUploadIncludes();
     //add rs css:
     self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
     $db = new UniteDBRev();
     $styles = $db->fetch(GlobalsRevSlider::$table_css);
     $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
     $styles = UniteCssParserRev::compress_css($styles);
     wp_add_inline_style('rs-plugin-settings', $styles);
     $custom_css = RevOperations::getStaticCss();
     $custom_css = UniteCssParserRev::compress_css($custom_css);
     wp_add_inline_style('rs-plugin-settings', $custom_css);
     //self::addStyle("static-captions","rs-plugin-static","rs-plugin/css");
 }
 /**
  * 
  * get contents of the css table
  */
 public function getCaptionsContent()
 {
     $result = $this->db->fetch(GlobalsRevSlider::$table_css);
     $contentCSS = UniteCssParserRev::parseDbArrayToCss($result);
     return $contentCSS;
 }
Ejemplo n.º 7
0
 /**
  * Output Dynamic Inline Styles
  */
 public function add_inline_styles()
 {
     //echo '<div class="revsliderstyles">';
     echo '<style scoped>';
     $db = new UniteDBRev();
     $styles = $db->fetch(GlobalsRevSlider::$table_css);
     foreach ($styles as $key => $style) {
         $handle = str_replace('.tp-caption', '', $style['handle']);
         if (!isset($this->class_include[$handle])) {
             unset($styles[$key]);
         }
     }
     $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
     $styles = UniteCssParserRev::compress_css($styles);
     echo $styles;
     echo '</style>' . "\n";
     //echo '</div>';
 }
Ejemplo n.º 8
0
 /**
  * Output Dynamic Inline Styles
  */
 public function add_inline_styles()
 {
     echo '<div class="revsliderstyles">';
     echo '<style type="text/css">';
     $db = new UniteDBRev();
     $styles = $db->fetch(GlobalsRevSlider::$table_css);
     foreach ($styles as $key => $style) {
         $handle = str_replace('.tp-caption', '', $style['handle']);
         if (!isset($this->class_include[$handle])) {
             unset($styles[$key]);
         }
     }
     $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
     $styles = UniteCssParserRev::compress_css($styles);
     echo $styles;
     // KRISZTIAN MODIFICATION FOR INNERLAYERS
     $stylesinnerlayers = str_replace('.tp-caption', '', $styles);
     echo $stylesinnerlayers;
     // END MODIFICATION
     echo '</style>' . "\n";
     echo '</div>';
 }
 /**
  * onAjax action handler
  */
 public static function onFrontAjaxAction()
 {
     $db = new UniteDBRev();
     $slider = new RevSlider();
     $slide = new RevSlide();
     $operations = new RevOperations();
     $token = self::getPostVar("token", false);
     //verify the token
     $isVerified = wp_verify_nonce($token, 'RevSlider_Front');
     $error = false;
     if ($isVerified) {
         $data = self::getPostVar('data', false);
         switch (self::getPostVar('client_action', false)) {
             case 'get_slider_html':
                 $id = intval(self::getPostVar('id', 0));
                 if ($id > 0) {
                     $html = '';
                     add_filter('revslider_add_js_delay', array('RevSliderAdmin', 'rev_set_js_delay'));
                     ob_start();
                     $slider_class = RevSliderOutput::putSlider($id);
                     $html = ob_get_contents();
                     //add styling
                     $custom_css = RevOperations::getStaticCss();
                     $custom_css = UniteCssParserRev::compress_css($custom_css);
                     $styles = $db->fetch(GlobalsRevSlider::$table_css);
                     $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
                     $styles = UniteCssParserRev::compress_css($styles);
                     $html .= '<style type="text/css">' . $custom_css . '</style>';
                     $html .= '<style type="text/css">' . $styles . '</style>';
                     ob_clean();
                     ob_end_clean();
                     $result = !empty($slider_class) && $html !== '' ? true : false;
                     if (!$result) {
                         $error = __('Slider not found', REVSLIDER_TEXTDOMAIN);
                     } else {
                         if ($html !== false) {
                             self::ajaxResponseData($html);
                         } else {
                             $error = __('Slider not found', REVSLIDER_TEXTDOMAIN);
                         }
                     }
                 } else {
                     $error = __('No Data Received', REVSLIDER_TEXTDOMAIN);
                 }
                 break;
         }
     } else {
         $error = true;
     }
     if ($error !== false) {
         $showError = __('Loading Error', REVSLIDER_TEXTDOMAIN);
         if ($error !== true) {
             $showError = __('Loading Error: ', REVSLIDER_TEXTDOMAIN) . $error;
         }
         self::ajaxResponseError($showError, false);
     }
     exit;
 }
Ejemplo n.º 10
0
 /**
  *
  * a must function. adds scripts on the page
  * add all page scripts and styles here.
  * pelase don't remove this function
  * common scripts even if the plugin not load, use this function only if no choise.
  */
 public static function onAddScripts()
 {
     global $wp_version;
     $style_pre = '';
     $style_post = '';
     if ($wp_version < 3.7) {
         $style_pre = '<style type="text/css">';
         $style_post = '</style>';
     }
     self::addStyle("edit_layers", "edit_layers");
     //add google font
     //$urlGoogleFont = "http://fonts.useso.com/css?family=PT+Sans+Narrow:400,700";
     //self::addStyleAbsoluteUrl($urlGoogleFont,"google-font-pt-sans-narrow");
     self::addScriptCommon("edit_layers", "unite_layers");
     self::addScriptCommon("css_editor", "unite_css_editor");
     self::addScript("rev_admin");
     self::addScript("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools');
     //include all media upload scripts
     self::addMediaUploadIncludes();
     //add rs css:
     self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
     $db = new UniteDBRev();
     $styles = $db->fetch(GlobalsRevSlider::$table_css);
     $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
     $styles = UniteCssParserRev::compress_css($styles);
     wp_add_inline_style('rs-plugin-settings', $style_pre . $styles . $style_post);
     // KRISZTIAN MODIFICATION FOR INNERLAYERS
     $stylesinnerlayers = str_replace('.tp-caption', '', $styles);
     wp_add_inline_style('rs-plugin-settings', $style_pre . $stylesinnerlayers . $style_post);
     // END MODIFICATION
     $custom_css = RevOperations::getStaticCss();
     $custom_css = UniteCssParserRev::compress_css($custom_css);
     wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
     //self::addStyle("static-captions","rs-plugin-static","rs-plugin/css");
 }
Ejemplo n.º 11
0
<?php

header("Content-Type: text/css; charset=utf-8");
$absolute_path = str_replace('\\', '/', __FILE__);
$path_to_file = explode('/revslider/rs-plugin/', $absolute_path);
$path_to_wp = $path_to_file[0] . '/../..';
require_once $path_to_wp . '/wp-load.php';
$currentFolder = dirname($absolute_path);
//include framework files
require_once $currentFolder . '/../../inc_php/framework/include_framework.php';
$db = new UniteDBRev();
$styles = $db->fetch(GlobalsRevSlider::$table_css);
echo UniteCssParserRev::parseDbArrayToCss($styles, "\n");
Ejemplo n.º 12
0
 public static function getgeneratecss()
 {
     $getcss = self::getcaptioncss(GlobalsRevSlider::TABLE_CSS_NAME);
     $value = UniteCssParserRev::parseDbArrayToCss($getcss, "\n");
     if (isset($value)) {
         return $value;
     } else {
         return false;
     }
 }
    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);
        $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]";
        $setBase = Mage::helper('nwdrevslider')->isSsl() ? "https://" : "http://";
        ?>
		<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 
        //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 
        $_usedStyles = array();
        $_slides = $slider->getSlides();
        foreach ($_slides as $_slide) {
            $_layers = $_slide->getLayers();
            foreach ($_layers as $_layer) {
                $_style = isset($_layer['style']) ? $_layer['style'] : '';
                if ($_style && !in_array($_style, $_usedStyles)) {
                    $_usedStyles[] = $_style;
                }
            }
        }
        echo Mage::helper('nwdrevslider')->inlcudeStyleFonts($_usedStyles);
        $http = Mage::helper('nwdrevslider')->isSsl() ? 'https' : 'http';
        ?>

<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') . "\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 = Mage::getBaseUrl('media');
        ?>
			<?php 
        echo Mage::helper('nwdrevslider')->__('Replace image path:');
        ?>
			<?php 
        echo Mage::helper('nwdrevslider')->__('From:');
        ?>
			<input type="text" name="orig_image_path" value="<?php 
        echo $dir;
        ?>
" />
			<?php 
        echo Mage::helper('nwdrevslider')->__('To:');
        ?>
			<input type="text" name="replace_image_path" value="" />
			<input id="rev_replace_images" type="button" name="replace_images" value="<?php 
        echo Mage::helper('nwdrevslider')->__('Replace');
        ?>
" />
		</p>

		<div class="rev_cont_title"><?php 
        echo Mage::helper('nwdrevslider')->__('Header');
        ?>
 <a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_head_content"  href="javascript:void(0);" original-title=""><?php 
        echo Mage::helper('nwdrevslider')->__('Mark to Copy');
        ?>
</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 
        echo Mage::helper('nwdrevslider')->__('CSS');
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_style_content"  href="javascript:void(0);" original-title=""><?php 
        echo Mage::helper('nwdrevslider')->__('Mark to Copy');
        ?>
</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 
        echo Mage::helper('nwdrevslider')->__('Body');
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_the_content"  href="javascript:void(0);" original-title=""><?php 
        echo Mage::helper('nwdrevslider')->__('Mark to Copy');
        ?>
</a></div>
		<textarea id="rev_the_content" readonly="true" style="width: 100%; height: 100px;"><?php 
        echo $content;
        ?>
</textarea>
		<div class="rev_cont_title"><?php 
        echo Mage::helper('nwdrevslider')->__('Script');
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_script_content"  href="javascript:void(0);" original-title=""><?php 
        echo Mage::helper('nwdrevslider')->__('Mark to Copy');
        ?>
</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();
			});
			jQuery('#rev_replace_images').on('click', function() {
				var originalPath = jQuery('input[name=orig_image_path]').val();
				var replacePath = jQuery('input[name=replace_image_path]').val();
				var revContent = $('#rev_the_content').val();
				$('#rev_the_content').val(revContent.replace(originalPath, replacePath));
				jQuery('input[name=orig_image_path]').val(replacePath);
				jQuery('input[name=replace_image_path]').val(originalPath);
			});
		</script>
		</body>
		</html>
		<?php 
        exit;
    }