当前位置: 首页>>代码示例>>PHP>>正文


PHP RevOperations::getStaticCss方法代码示例

本文整理汇总了PHP中RevOperations::getStaticCss方法的典型用法代码示例。如果您正苦于以下问题:PHP RevOperations::getStaticCss方法的具体用法?PHP RevOperations::getStaticCss怎么用?PHP RevOperations::getStaticCss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RevOperations的用法示例。


在下文中一共展示了RevOperations::getStaticCss方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: yit_revslider_slider

function yit_revslider_slider()
{
    $operations = new RevOperations();
    $arrValues = $operations->getGeneralSettingsValues();

    $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");

    $isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
    $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");

    if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) {
        return;
    }

    wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION);

    $custom_css = RevOperations::getStaticCss();
    $custom_css = UniteCssParserRev::compress_css($custom_css);
    wp_add_inline_style('rs-plugin-settings', $custom_css);

    $setBase = (is_ssl()) ? "https://" : "http://";

    $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
    wp_enqueue_script("jquery", $url_jquery);

    // put javascript to footer
    add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
开发者ID:simonsays88,项目名称:costa,代码行数:28,代码来源:config.php

示例2: onAddScripts

 /**
  * 
  * a must function. you can not use it, but the function must stay there!.
  *   
  */
 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>';
     }
     $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");
     $custom_css = RevOperations::getStaticCss();
     $custom_css = UniteCssParserRev::compress_css($custom_css);
     wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
     /*
      */
     /*
     $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
     */
     $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") {
         $waitfor = array('jquery');
         $enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
         if ($enable_logs == 'on') {
             self::addScriptWaitFor("jquery.themepunch.enablelog", "rs-plugin/js", 'enable-logs');
             $waitfor[] = 'enable-logs';
         }
         self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
     } else {
         //put javascript to footer
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
开发者ID:epiii,项目名称:aros,代码行数:63,代码来源:revslider_front.php

示例3: onAddScripts

 /**
  * 
  * 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');
     }
 }
开发者ID:donpapa26,项目名称:bakancslistad,代码行数:47,代码来源:revslider_front.php

示例4: onAddScripts

 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>';
     }
     $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);
     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");
     $custom_css = RevOperations::getStaticCss();
     $custom_css = UniteCssParserRev::compress_css($custom_css);
     wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
     $setBase = get_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") {
         $waitfor = array('jquery');
         $enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
         if ($enable_logs == 'on') {
             self::addScriptWaitFor("jquery.themepunch.enablelog", "rs-plugin/js", 'enable-logs');
             $waitfor[] = 'enable-logs';
         }
         self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
     } else {
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
开发者ID:rinodung,项目名称:opencart-15x-flat-admin,代码行数:42,代码来源:revslider_front.php

示例5: yit_revslider_slider

function yit_revslider_slider()
{
    if ( ! class_exists('RevOperations') ) {
        return;
    }

    $operations = new RevOperations();
    $arrValues = $operations->getGeneralSettingsValues();

    $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");

    $isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
    $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");

    if ( YIT_Layout()->slider_name===false 
    	|| (YIT_Layout()->slider_name != 'none' && YIT_Slider::get_slider( YIT_Layout()->slider_name )->config->layout != 'revolution-slider') 
    	|| $includesGlobally == "on" 
    	|| $isWidgetActive 
    	|| $hasShortcode ) {
        return;
    }

    if ( defined( 'RS_PLUGIN_URL' ) ) {
        wp_enqueue_style( 'rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION );
    }
    else {
        wp_enqueue_style( "rs-plugin-settings", UniteBaseClassRev::$url_plugin . "rs-plugin/css/settings.css", array(), GlobalsRevSlider::SLIDER_REVISION );
    }

    $custom_css = RevOperations::getStaticCss();
    $custom_css = UniteCssParserRev::compress_css($custom_css);
    wp_add_inline_style('rs-plugin-settings', $custom_css);

    $setBase = (is_ssl()) ? "https://" : "http://";

    $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
    wp_enqueue_script("jquery", $url_jquery);

    // put javascript to footer
    add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
开发者ID:jabue,项目名称:wordpress,代码行数:41,代码来源:config.php

示例6: onAddScripts

 /**
  * 
  * 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");
     $custom_css = RevOperations::getStaticCss();
     $custom_css = UniteCssParserRev::compress_css($custom_css);
     wp_add_inline_style('rs-plugin-settings', $custom_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") {
         $use_hammer = UniteFunctionsRev::getVal($arrValues, "use_hammer_js", 'on');
         $waitfor = array('jquery');
         if ($use_hammer == 'off') {
             self::addScriptWaitFor("jquery.themepunch.disablehammer", "rs-plugin/js", 'disable-hammer');
             $waitfor[] = 'disable-hammer';
         }
         self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
     } else {
         //put javascript to footer
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:43,代码来源:revslider_front.php

示例7: importCaptionsCssContentArray

 /**
  * 
  * import contents of the css file
  */
 public static function importCaptionsCssContentArray()
 {
     $db = new UniteDBRev();
     $css = self::getCaptionsCssContentArray();
     $static = array();
     if (is_array($css) && $css !== false && count($css) > 0) {
         foreach ($css as $class => $styles) {
             //check if static style or dynamic style
             $class = trim($class);
             if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
                 //.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
                 $static[$class] = $styles;
                 continue;
             }
             //is a dynamic style
             if (strpos($class, ':hover') !== false) {
                 $class = trim(str_replace(':hover', '', $class));
                 $arrInsert = array();
                 $arrInsert["hover"] = json_encode($styles);
                 $arrInsert["settings"] = json_encode(array('hover' => 'true'));
             } else {
                 $arrInsert = array();
                 $arrInsert["params"] = json_encode($styles);
             }
             //check if class exists
             $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
             if (!empty($result)) {
                 //update
                 $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
             } else {
                 //insert
                 $arrInsert["handle"] = $class;
                 $db->insert(GlobalsRevSlider::$table_css, $arrInsert);
             }
         }
     }
     if (!empty($static)) {
         //save static into static-captions.css
         $css = UniteCssParserRev::parseStaticArrayToCss($static);
         $static_cur = RevOperations::getStaticCss();
         //get the open sans line!
         $css = $static_cur . "\n" . $css;
         self::updateStaticCss($css);
     }
 }
开发者ID:shahadat014,项目名称:geleyi,代码行数:49,代码来源:revslider_operations.class.php

示例8: cmo_import_sliders_ajax

function cmo_import_sliders_ajax()
{
    global $wpdb;
    if (!class_exists('UniteFunctionsRev')) {
        ajax_finish(false, __('Revolution Slider plugin is not installed or activated.', 'cumulo'));
    } else {
        $rev_directory = CMO_FRAMEWORK_PATH . '/demo/sliders/';
        if (!empty($_POST['demo'])) {
            if ($_POST['demo'] != 'default') {
                $rev_directory .= $_POST['demo'] . '/';
            }
        }
        foreach (glob($rev_directory . '*.zip') as $filename) {
            $filename = basename($filename);
            $rev_files[] = $rev_directory . $filename;
        }
        foreach ($rev_files as $rev_file) {
            $filepath = $rev_file;
            $zip = new ZipArchive();
            $importZip = $zip->open($filepath, ZIPARCHIVE::CREATE);
            if ($importZip === true) {
                $slider_export = $zip->getStream('slider_export.txt');
                $custom_animations = $zip->getStream('custom_animations.txt');
                $dynamic_captions = $zip->getStream('dynamic-captions.css');
                $static_captions = $zip->getStream('static-captions.css');
                $content = '';
                $animations = '';
                $dynamic = '';
                $static = '';
                while (!feof($slider_export)) {
                    $content .= fread($slider_export, 1024);
                }
                if ($custom_animations) {
                    while (!feof($custom_animations)) {
                        $animations .= fread($custom_animations, 1024);
                    }
                }
                if ($dynamic_captions) {
                    while (!feof($dynamic_captions)) {
                        $dynamic .= fread($dynamic_captions, 1024);
                    }
                }
                if ($static_captions) {
                    while (!feof($static_captions)) {
                        $static .= fread($static_captions, 1024);
                    }
                }
                fclose($slider_export);
                if ($custom_animations) {
                    fclose($custom_animations);
                }
                if ($dynamic_captions) {
                    fclose($dynamic_captions);
                }
                if ($static_captions) {
                    fclose($static_captions);
                }
                //check for images!
            } else {
                $content = @file_get_contents($filepath);
            }
            if ($importZip === true) {
                //we have a zip
                $db = new UniteDBRev();
                //update/insert custom animations
                $animations = @unserialize($animations);
                if (!empty($animations)) {
                    foreach ($animations as $key => $animation) {
                        $exist = $db->fetch(GlobalsRevSlider::$table_layer_anims, "handle = '" . $animation['handle'] . "'");
                        if (!empty($exist)) {
                            if ($updateAnim == "true") {
                                $arrUpdate = array();
                                $arrUpdate['params'] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                                $db->update(GlobalsRevSlider::$table_layer_anims, $arrUpdate, array('handle' => $animation['handle']));
                                $id = $exist['0']['id'];
                            } else {
                                $arrInsert = array();
                                $arrInsert["handle"] = 'copy_' . $animation['handle'];
                                $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                                $id = $db->insert(GlobalsRevSlider::$table_layer_anims, $arrInsert);
                            }
                        } else {
                            $arrInsert = array();
                            $arrInsert["handle"] = $animation['handle'];
                            $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                            $id = $db->insert(GlobalsRevSlider::$table_layer_anims, $arrInsert);
                        }
                        $content = str_replace(array('customin-' . $animation['id'], 'customout-' . $animation['id']), array('customin-' . $id, 'customout-' . $id), $content);
                    }
                } else {
                }
                //overwrite/append static-captions.css
                if (!empty($static)) {
                    if (isset($updateStatic) && $updateStatic == "true") {
                        RevOperations::updateStaticCss($static);
                    } else {
                        //append
                        $static_cur = RevOperations::getStaticCss();
                        $static = $static_cur . "\n" . $static;
                        RevOperations::updateStaticCss($static);
//.........这里部分代码省略.........
开发者ID:supahseppe,项目名称:ashley-travel,代码行数:101,代码来源:demo-importer-ajax.php

示例9: hb_importer


//.........这里部分代码省略.........
                                        //overwrite animation if exists
                                        $arrUpdate = array();
                                        $arrUpdate['params'] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                                        $db->update(GlobalsRevSlider::$table_layer_anims, $arrUpdate, array('handle' => $animation['handle']));
                                        $id = $exist['0']['id'];
                                    } else {
                                        //insert with new handle
                                        $arrInsert = array();
                                        $arrInsert["handle"] = 'copy_' . $animation['handle'];
                                        $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                                        $id = $db->insert(GlobalsRevSlider::$table_layer_anims, $arrInsert);
                                    }
                                } else {
                                    //insert the animation, get the ID
                                    $arrInsert = array();
                                    $arrInsert["handle"] = $animation['handle'];
                                    $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                                    $id = $db->insert(GlobalsRevSlider::$table_layer_anims, $arrInsert);
                                }
                                //and set the current customin-oldID and customout-oldID in slider params to new ID from $id
                                $content = str_replace(array('customin-' . $animation['id'], 'customout-' . $animation['id']), array('customin-' . $id, 'customout-' . $id), $content);
                            }
                            //dmp(__("animations imported!",REVSLIDER_TEXTDOMAIN));
                        } else {
                            //dmp(__("no custom animations found, if slider uses custom animations, the provided export may be broken...",REVSLIDER_TEXTDOMAIN));
                        }
                        //overwrite/append static-captions.css
                        if (!empty($static)) {
                            if ($updateStatic == "true") {
                                //overwrite file
                                RevOperations::updateStaticCss($static);
                            } else {
                                //append
                                $static_cur = RevOperations::getStaticCss();
                                $static = $static_cur . "\n" . $static;
                                RevOperations::updateStaticCss($static);
                            }
                        }
                        //overwrite/create dynamic-captions.css
                        //parse css to classes
                        $dynamicCss = UniteCssParserRev::parseCssToArray($dynamic);
                        if (is_array($dynamicCss) && $dynamicCss !== false && count($dynamicCss) > 0) {
                            foreach ($dynamicCss as $class => $styles) {
                                //check if static style or dynamic style
                                $class = trim($class);
                                if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
                                    //.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
                                    continue;
                                }
                                //is a dynamic style
                                if (strpos($class, ':hover') !== false) {
                                    $class = trim(str_replace(':hover', '', $class));
                                    $arrInsert = array();
                                    $arrInsert["hover"] = json_encode($styles);
                                    $arrInsert["settings"] = json_encode(array('hover' => 'true'));
                                } else {
                                    $arrInsert = array();
                                    $arrInsert["params"] = json_encode($styles);
                                }
                                //check if class exists
                                $result = $db->fetch(GlobalsRevSlider::$table_css, "handle = '" . $class . "'");
                                if (!empty($result)) {
                                    //update
                                    $db->update(GlobalsRevSlider::$table_css, $arrInsert, array('handle' => $class));
                                } else {
                                    //insert
开发者ID:phupx,项目名称:genco,代码行数:67,代码来源:importer.php

示例10: importSliderFromPost

 public function importSliderFromPost($updateAnim = true, $updateStatic = true)
 {
     try {
         $sliderID = UniteFunctionsRev::getPostVariable("sliderid");
         $sliderExists = !empty($sliderID);
         if ($sliderExists) {
             $this->initByID($sliderID);
         }
         $filepath = $_FILES["import_file"]["tmp_name"];
         if (file_exists($filepath) == false) {
             UniteFunctionsRev::throwError("Import file not found!!!");
         }
         if (!class_exists("ZipArchive")) {
             $importZip = false;
         } else {
             $zip = new ZipArchive();
             $importZip = $zip->open($filepath, ZIPARCHIVE::CREATE);
         }
         if ($importZip === true) {
             $slider_export = $zip->getStream('slider_export.txt');
             $custom_animations = $zip->getStream('custom_animations.txt');
             $dynamic_captions = $zip->getStream('dynamic-captions.css');
             $static_captions = $zip->getStream('static-captions.css');
             if (!$slider_export) {
                 UniteFunctionsRev::throwError("slider_export.txt does not exist!");
             }
             $content = '';
             $animations = '';
             $dynamic = '';
             $static = '';
             while (!feof($slider_export)) {
                 $content .= fread($slider_export, 1024);
             }
             if ($custom_animations) {
                 while (!feof($custom_animations)) {
                     $animations .= fread($custom_animations, 1024);
                 }
             }
             if ($dynamic_captions) {
                 while (!feof($dynamic_captions)) {
                     $dynamic .= fread($dynamic_captions, 1024);
                 }
             }
             if ($static_captions) {
                 while (!feof($static_captions)) {
                     $static .= fread($static_captions, 1024);
                 }
             }
             fclose($slider_export);
             if ($custom_animations) {
                 fclose($custom_animations);
             }
             if ($dynamic_captions) {
                 fclose($dynamic_captions);
             }
             if ($static_captions) {
                 fclose($static_captions);
             }
         } else {
             $content = @file_get_contents($filepath);
         }
         if ($importZip === true) {
             $db = new UniteDBRev();
             $animations = @unserialize($animations);
             if (!empty($animations)) {
                 foreach ($animations as $key => $animation) {
                     $exist = $db->fetch(GlobalsRevSlider::$table_layer_anims, "handle = '" . $animation['handle'] . "'");
                     if (!empty($exist)) {
                         if ($updateAnim == "true") {
                             $arrUpdate = array();
                             $arrUpdate['params'] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                             $db->update(GlobalsRevSlider::$table_layer_anims, $arrUpdate, array('handle' => $animation['handle']));
                             $id = $exist['0']['id'];
                         } else {
                             $arrInsert = array();
                             $arrInsert["handle"] = 'copy_' . $animation['handle'];
                             $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                             $id = $db->insert(GlobalsRevSlider::$table_layer_anims, $arrInsert);
                         }
                     } else {
                         $arrInsert = array();
                         $arrInsert["handle"] = $animation['handle'];
                         $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
                         $id = $db->insert(GlobalsRevSlider::$table_layer_anims, $arrInsert);
                     }
                     $content = str_replace(array('customin-' . $animation['id'], 'customout-' . $animation['id']), array('customin-' . $id, 'customout-' . $id), $content);
                 }
                 dmp(__("animations imported!", REVSLIDER_TEXTDOMAIN));
             } else {
                 dmp(__("no custom animations found, if slider uses custom animations, the provided export may be broken...", REVSLIDER_TEXTDOMAIN));
             }
             if (!empty($static)) {
                 if ($updateStatic == "true") {
                     RevOperations::updateStaticCss($static);
                 } else {
                     $static_cur = RevOperations::getStaticCss();
                     $static = $static_cur . "\n" . $static;
                     RevOperations::updateStaticCss($static);
                 }
             }
//.........这里部分代码省略.........
开发者ID:rinodung,项目名称:opencart-15x-flat-admin,代码行数:101,代码来源:revslider_slider.class.php

示例11: onAjaxAction


//.........这里部分代码省略.........
                 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)
开发者ID:rinodung,项目名称:opencart-15x-flat-admin,代码行数:67,代码来源:revslider_admin.php

示例12: onAjaxAction


//.........这里部分代码省略.........
                 break;
             case "update_slide":
                 RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_EDIT_SLIDE);
                 require self::getSettingsFilePath("slide_settings");
                 $slide->updateSlideFromData($data, $slideSettings);
                 self::ajaxResponseSuccess(__ug("Slide updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "delete_slide":
                 RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
                 $isPost = $slide->deleteSlideFromData($data);
                 if ($isPost) {
                     $message = __ug("Post Deleted Successfully", REVSLIDER_TEXTDOMAIN);
                 } else {
                     $message = __ug("Slide Deleted Successfully", REVSLIDER_TEXTDOMAIN);
                 }
                 $sliderID = UniteFunctionsRev::getVal($data, "sliderID");
                 self::ajaxResponseSuccessRedirect($message, self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "update_static_slide":
                 $slide->updateStaticSlideFromData($data);
                 self::ajaxResponseSuccess(__ug("Static Global Layers updated", REVSLIDER_TEXTDOMAIN));
                 break;
             case "duplicate_slide":
                 RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
                 $sliderID = $slider->duplicateSlideFromData($data);
                 self::ajaxResponseSuccessRedirect(__ug("Slide Duplicated Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
                 break;
             case "copy_move_slide":
                 RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
                 $sliderID = $slider->copyMoveSlideFromData($data);
                 self::ajaxResponseSuccessRedirect(__ug("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(__ug("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "update_captions_css":
                 $arrCaptions = $operations->updateCaptionsContentData($data);
                 self::ajaxResponseSuccess(__ug("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "delete_captions_css":
                 $arrCaptions = $operations->deleteCaptionsContentData($data);
                 self::ajaxResponseSuccess(__ug("Style deleted succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
                 break;
             case "update_static_css":
                 $staticCss = $operations->updateStaticCss($data);
                 self::ajaxResponseSuccess(__ug("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("css" => $staticCss));
                 break;
             case "insert_custom_anim":
                 $arrAnims = $operations->insertCustomAnim($data);
                 //$arrCaptions =
                 self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
                 break;
             case "update_custom_anim":
                 $arrAnims = $operations->updateCustomAnim($data);
                 self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
                 //,array("arrCaptions"=>$arrCaptions)
开发者ID:jhener79,项目名称:vlakc,代码行数:67,代码来源:revslider_admin.php

示例13: stripslashes

             $arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
             $id = $db->insert(GlobalsRevSlider::$table_layer_anims, $arrInsert);
         }
         //and set the current customin-oldID and customout-oldID in slider params to new ID from $id
         $content = str_replace(array('customin-' . $animation['id'], 'customout-' . $animation['id']), array('customin-' . $id, 'customout-' . $id), $content);
     }
 } else {
 }
 //overwrite/append static-captions.css
 if (!empty($static)) {
     if (isset($updateStatic) && $updateStatic == "true") {
         //overwrite file
         RevOperations::updateStaticCss($static);
     } else {
         //append
         $static_cur = RevOperations::getStaticCss();
         $static = $static_cur . "\n" . $static;
         RevOperations::updateStaticCss($static);
     }
 }
 //overwrite/create dynamic-captions.css
 //parse css to classes
 $dynamicCss = UniteCssParserRev::parseCssToArray($dynamic);
 if (is_array($dynamicCss) && $dynamicCss !== false && count($dynamicCss) > 0) {
     foreach ($dynamicCss as $class => $styles) {
         //check if static style or dynamic style
         $class = trim($class);
         if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
             //.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
             continue;
         }
开发者ID:jgeletka,项目名称:simskin,代码行数:31,代码来源:themeva-importer.php

示例14: previewOutputMarkup

    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>
//.........这里部分代码省略.........
开发者ID:perseusl,项目名称:kingdavid,代码行数:101,代码来源:revslider_operations.class.php

示例15: previewOutput

    /**
     * 
     * preview slider output
     * if output object is null - create object
     */
    public function previewOutput($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 = RevSliderAdmin::$url_plugin . "rs-plugin/";
        $urlPreviewPattern = UniteBaseClassRev::$url_ajax_actions . "&client_action=preview_slider&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]";
        $nonce = wp_create_nonce("revslider_actions");
        $setBase = is_ssl() ? "https://" : "http://";
        ?>
				<html>
					<head>
						<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
css/settings.css?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
						<?php 
        //check if dynamic-captions.css exists. If not, include captions.php
        //if(file_exists(UniteBaseClassRev::$path_plugin."rs-plugin/css/dynamic-captions.css") == false){
        ?>
							<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
css/captions.php?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
							<?php 
        /*}else{
        			?>
        			<link rel='stylesheet' href='<?php echo $urlPlugin?>css/dynamic-captions.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?>' type='text/css' media='all' />
        			<?php
        		}*/
        $custom_css = RevOperations::getStaticCss();
        echo '<style type="text/css">' . $custom_css . '</style>';
        /*<!--link rel='stylesheet' href='<?php echo $urlPlugin?>css/static-captions.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?>' type='text/css' media='all' /-->*/
        ?>
						
						<script type='text/javascript' src='<?php 
        echo $setBase;
        ?>
ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
						<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.plugins.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>
					</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;
//.........这里部分代码省略.........
开发者ID:RagnarDanneskjold,项目名称:goodbyeloans.com,代码行数:101,代码来源:revslider_operations.class.php


注:本文中的RevOperations::getStaticCss方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。