db.class.php000066600000007016152141733250006761 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderDB{ private $lastRowID; /** * * constructor - set database object */ public function __construct(){ } /** * * throw error */ private function throwError($message,$code=-1){ RevSliderFunctions::throwError($message,$code); } //------------------------------------------------------------ // validate for errors private function checkForErrors($prefix = ""){ global $wpdb; if($wpdb->last_error !== ''){ $query = $wpdb->last_query; $message = $wpdb->last_error; if($prefix) $message = $prefix.' - '.$message.''; if($query) $message .= '
---
Query: ' . esc_attr($query); $this->throwError($message); } } /** * * insert variables to some table */ public function insert($table,$arrItems){ global $wpdb; $wpdb->insert($table, $arrItems); $this->checkForErrors("Insert query error"); $this->lastRowID = $wpdb->insert_id; return($this->lastRowID); } /** * * get last insert id */ public function getLastInsertID(){ global $wpdb; $this->lastRowID = $wpdb->insert_id; return($this->lastRowID); } /** * * delete rows */ public function delete($table,$where){ global $wpdb; RevSliderFunctions::validateNotEmpty($table,"table name"); RevSliderFunctions::validateNotEmpty($where,"where"); $query = "delete from $table where $where"; $wpdb->query($query); $this->checkForErrors("Delete query error"); } /** * * run some sql query */ public function runSql($query){ global $wpdb; $wpdb->query($query); $this->checkForErrors("Regular query error"); } /** * * run some sql query */ public function runSqlR($query){ global $wpdb; $return = $wpdb->get_results($query, ARRAY_A); return $return; } /** * * insert variables to some table */ public function update($table,$arrItems,$where){ global $wpdb; $response = $wpdb->update($table, $arrItems, $where); return($wpdb->num_rows); } /** * * get data array from the database * */ public function fetch($tableName,$where="",$orderField="",$groupByField="",$sqlAddon=""){ global $wpdb; $query = "select * from $tableName"; if($where) $query .= " where $where"; if($orderField) $query .= " order by $orderField"; if($groupByField) $query .= " group by $groupByField"; if($sqlAddon) $query .= " ".$sqlAddon; $response = $wpdb->get_results($query,ARRAY_A); $this->checkForErrors("fetch"); return($response); } /** * * fetch only one item. if not found - throw error */ public function fetchSingle($tableName,$where="",$orderField="",$groupByField="",$sqlAddon=""){ $response = $this->fetch($tableName, $where, $orderField, $groupByField, $sqlAddon); if(empty($response)) $this->throwError("Record not found"); $record = $response[0]; return($record); } /** * prepare statement to avoid sql injections */ public function prepare($query, $array){ global $wpdb; $query = $wpdb->prepare($query, $array); return($query); } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteDBRev extends RevSliderDB {} ?>wpml.class.php000066600000010021152141733250007341 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderWpml{ /** * * true / false if the wpml plugin exists */ public static function isWpmlExists(){ return did_action( 'wpml_loaded' ); } /** * * valdiate that wpml exists */ private static function validateWpmlExists(){ if(!self::isWpmlExists()) RevSliderFunctions::throwError("The wpml plugin is not activated"); } /** * * get languages array */ public static function getArrLanguages($getAllCode = true){ self::validateWpmlExists(); $arrLangs = apply_filters( 'wpml_active_languages', array() ); $response = array(); if($getAllCode == true) $response["all"] = __("All Languages",'revslider'); foreach($arrLangs as $code=>$arrLang){ $name = $arrLang["native_name"]; $response[$code] = $name; } return($response); } /** * * get assoc array of lang codes */ public static function getArrLangCodes($getAllCode = true){ $arrCodes = array(); if($getAllCode == true) $arrCodes["all"] = "all"; self::validateWpmlExists(); $arrLangs = apply_filters( 'wpml_active_languages', array() ); foreach($arrLangs as $code=>$arr){ $arrCodes[$code] = $code; } return($arrCodes); } /** * * check if all languages exists in the given langs array */ public static function isAllLangsInArray($arrCodes){ $arrAllCodes = self::getArrLangCodes(); $diff = array_diff($arrAllCodes, $arrCodes); return(empty($diff)); } /** * * get langs with flags menu list * @param $props */ public static function getLangsWithFlagsHtmlList($props = "",$htmlBefore = ""){ $arrLangs = self::getArrLanguages(); if(!empty($props)) $props = " ".$props; $html = ""."\n"; $html .= $htmlBefore; foreach($arrLangs as $code=>$title){ $urlIcon = self::getFlagUrl($code); /* NEW: foreach($arrLangs as $lang){ $code = $lang['language_code']; $title = $lang['native_name']; $urlIcon = $lang['country_flag_url']; */ $html .= "
  • "."\n"; $html .= " $title"."\n"; $html .= "
  • "."\n"; } $html .= ""; return($html); } /** * get flag url */ public static function getFlagUrl($code){ self::validateWpmlExists(); if ( empty( $code ) || $code == "all" ) { $url = RS_PLUGIN_URL.'admin/assets/images/icon-all.png'; // NEW: ICL_PLUGIN_URL . '/res/img/icon16.png'; } else { $active_languages = apply_filters( 'wpml_active_languages', array() ); $url = isset( $active_languages[$code]['country_flag_url'] ) ? $active_languages[$code]['country_flag_url'] : null; } //default: show all if(empty($url)){ $url = RS_PLUGIN_URL.'admin/assets/images/icon-all.png'; // NEW: $url = ICL_PLUGIN_URL . '/res/img/icon16.png'; } return($url); } /** * * get language title by code */ public static function getLangTitle($code){ if($code == "all") return(__("All Languages", 'revslider')); $default_language = apply_filters( 'wpml_default_language', null ); return apply_filters( 'wpml_translated_language_name', '', $code, $default_language ); } /** * * get current language */ public static function getCurrentLang(){ self::validateWpmlExists(); if ( is_admin() ) { return apply_filters( 'wpml_default_language', null ); } return apply_filters( 'wpml_current_language', null ); return($lang); } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteWpmlRev extends RevSliderWpml {} ?>index.php000066600000000000152141733250006361 0ustar00em-integration.class.php000066600000013354152141733250011320 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderEventsManager { const DEFAULT_FILTER = "none"; /** * * check if events class exists */ public static function isEventsExists(){ if(defined("EM_VERSION") && defined("EM_PRO_MIN_VERSION")) return(true); return(false); } /** * * get sort by list */ public static function getArrFilterTypes(){ $arrEventsSort = array("none" => __("All Events",'revslider'), "today" => __("Today",'revslider'), "tomorrow"=>__("Tomorrow",'revslider'), "future"=>__("Future",'revslider'), "past"=>__("Past",'revslider'), "month"=>__("This Month",'revslider'), "nextmonth"=>__("Next Month",'revslider') ); return($arrEventsSort); } /** * * get meta query */ public static function getWPQuery($filterType, $sortBy){ $response = array(); $dayMs = 60*60*24; $time = current_time('timestamp'); $todayStart = strtotime(date('Y-m-d', $time)); $todayEnd = $todayStart + $dayMs-1; $tomorrowStart = $todayEnd+1; $tomorrowEnd = $tomorrowStart + $dayMs-1; $start_month = strtotime(date('Y-m-1',$time)); $end_month = strtotime(date('Y-m-t',$time)) + 86399; $next_month_middle = strtotime('+1 month', $time); //get the end of this month + 1 day $start_next_month = strtotime(date('Y-m-1',$next_month_middle)); $end_next_month = strtotime(date('Y-m-t',$next_month_middle)) + 86399; $query = array(); switch($filterType){ case self::DEFAULT_FILTER: //none break; case "today": $query[] = array( 'key' => '_start_ts', 'value' => $todayEnd, 'compare' => '<=' ); $query[] = array( 'key' => '_end_ts', 'value' => $todayStart, 'compare' => '>=' ); break; case "future": $query[] = array( 'key' => '_start_ts', 'value' => $time, 'compare' => '>' ); break; case "tomorrow": $query[] = array( 'key' => '_start_ts', 'value' => $tomorrowEnd, 'compare' => '<=' ); $query[] = array( 'key' => '_end_ts', 'value' => $todayStart, 'compare' => '>=' ); break; case "past": $query[] = array( 'key' => '_end_ts', 'value' => $todayStart, 'compare' => '<' ); break; case "month": $query[] = array( 'key' => '_start_ts', 'value' => $end_month, 'compare' => '<=' ); $query[] = array( 'key' => '_end_ts', 'value' => $start_month, 'compare' => '>=' ); break; case "nextmonth": $query[] = array( 'key' => '_start_ts', 'value' => $end_next_month, 'compare' => '<=' ); $query[] = array( 'key' => '_end_ts', 'value' => $start_next_month, 'compare' => '>=' ); break; default: RevSliderFunctions::throwError("Wrong event filter"); break; } if(!empty($query)) $response["meta_query"] = $query; //convert sortby switch($sortBy){ case "event_start_date": $response["orderby"] = "meta_value_num"; $response["meta_key"] = "_start_ts"; break; case "event_end_date": $response["orderby"] = "meta_value_num"; $response["meta_key"] = "_end_ts"; break; } return($response); } /** * * get event post data in array. * if the post is not event, return empty array */ public static function getEventPostData($postID){ if(self::isEventsExists() == false) return(array()); $postType = get_post_type($postID); if($postType != EM_POST_TYPE_EVENT) return(array()); $event = new EM_Event($postID, 'post_id'); $location = $event->get_location(); $arrEvent = $event->to_array(); $arrLocation = $location->to_array(); $date_format = get_option('date_format'); $time_format = get_option('time_format'); $arrEvent["event_start_date"] = date_format(date_create_from_format('Y-m-d', $arrEvent["event_start_date"]), $date_format); $arrEvent["event_end_date"] = date_format(date_create_from_format('Y-m-d', $arrEvent["event_end_date"]), $date_format); $arrEvent["event_start_time"] = date_format(date_create_from_format('H:i:s', $arrEvent["event_start_time"]), $time_format); $arrEvent["event_end_time"] = date_format(date_create_from_format('H:i:s', $arrEvent["event_end_time"]), $time_format); $response = array(); $response["start_date"] = $arrEvent["event_start_date"]; $response["end_date"] = $arrEvent["event_end_date"]; $response["start_time"] = $arrEvent["event_start_time"]; $response["end_time"] = $arrEvent["event_end_time"]; $response["id"] = $arrEvent["event_id"]; $response["location_name"] = $arrLocation["location_name"]; $response["location_address"] = $arrLocation["location_address"]; $response["location_slug"] = $arrLocation["location_slug"]; $response["location_town"] = $arrLocation["location_town"]; $response["location_state"] = $arrLocation["location_state"]; $response["location_postcode"] = $arrLocation["location_postcode"]; $response["location_region"] = $arrLocation["location_region"]; $response["location_country"] = $arrLocation["location_country"]; $response["location_latitude"] = $arrLocation["location_latitude"]; $response["location_longitude"] = $arrLocation["location_longitude"]; return($response); } /** * * get events sort by array */ public static function getArrSortBy(){ $arrSortBy = array(); $arrSortBy["event_start_date"] = __("Event Start Date",'revslider'); $arrSortBy["event_end_date"] = __("Event End Date",'revslider'); return($arrSortBy); } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteEmRev extends RevSliderEventsManager {} ?>base.class.php000066600000045717152141733250007320 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderBase { protected static $wpdb; protected static $table_prefix; protected static $t; protected static $url_ajax; protected static $url_ajax_showimage; protected static $path_views; protected static $path_templates; protected static $is_multisite; public static $url_ajax_actions; /** * * the constructor */ public function __construct($t){ global $wpdb; self::$is_multisite = RevSliderFunctionsWP::isMultisite(); self::$wpdb = $wpdb; self::$table_prefix = self::$wpdb->base_prefix; if(self::$is_multisite){ $blogID = RevSliderFunctionsWP::getBlogID(); if($blogID != 1){ self::$table_prefix .= $blogID."_"; } } self::$t = $t; self::$url_ajax = admin_url("admin-ajax.php"); self::$url_ajax_actions = self::$url_ajax . "?action=revslider_ajax_action"; self::$url_ajax_showimage = self::$url_ajax . "?action=revslider_show_image"; self::$path_views = RS_PLUGIN_PATH."admin/views/"; self::$path_templates = self::$path_views."/templates/"; load_plugin_textdomain('revslider',false,'revslider/languages/'); //update globals oldversion flag RevSliderGlobals::$isNewVersion = false; $version = get_bloginfo("version"); $version = (double)$version; if($version >= 3.5) RevSliderGlobals::$isNewVersion = true; } /** * * add some wordpress action */ protected static function addAction($action,$eventFunction){ add_action( $action, array(self::$t, $eventFunction) ); } /** * * get image url to be shown via thumb making script. */ public static function getImageUrl($filepath, $width=null,$height=null,$exact=false,$effect=null,$effect_param=null){ $urlImage = self::getUrlThumb(self::$url_ajax_showimage, $filepath,$width ,$height ,$exact ,$effect ,$effect_param); return($urlImage); } /** * get thumb url * @since: 5.0 * @moved from image_view.class.php */ public static function getUrlThumb($urlBase, $filename,$width=null,$height=null,$exact=false,$effect=null,$effect_param=null){ $filename = urlencode($filename); $url = $urlBase."&img=$filename"; if(!empty($width)) $url .= "&w=".$width; if(!empty($height)) $url .= "&h=".$height; if($exact == true){ $url .= "&t=".self::TYPE_EXACT; } if(!empty($effect)){ $url .= "&e=".$effect; if(!empty($effect_param)) $url .= "&ea1=".$effect_param; } return($url); } /** * * on show image ajax event. outputs image with parameters */ public static function onShowImage(){ $pathImages = RevSliderFunctionsWP::getPathContent(); $urlImages = RevSliderFunctionsWP::getUrlContent(); try{ $imageID = intval(RevSliderFunctions::getGetVar("img")); $img = wp_get_attachment_image_src( $imageID, 'thumb' ); if(empty($img)) exit; self::outputImage($img[0]); }catch (Exception $e){ header("status: 500"); echo __('Image not Found', 'revslider'); exit(); } } /** * show Image to client * @since: 5.0 * @moved from image_view.class.php */ private static function outputImage($filepath){ $info = RevSliderFunctions::getPathInfo($filepath); $ext = $info["extension"]; $ext = strtolower($ext); if($ext == "jpg") $ext = "jpeg"; $numExpires = 31536000; //one year $strExpires = @date('D, d M Y H:i:s',time()+$numExpires); $contents = file_get_contents($filepath); $filesize = strlen($contents); header("Expires: $strExpires GMT"); header("Cache-Control: public"); header("Content-Type: image/$ext"); header("Content-Length: $filesize"); echo $contents; exit(); } /** * * get POST var */ protected static function getPostVar($key,$defaultValue = ""){ $val = self::getVar($_POST, $key, $defaultValue); return($val); } /** * * get GET var */ protected static function getGetVar($key,$defaultValue = ""){ $val = self::getVar($_GET, $key, $defaultValue); return($val); } /** * * get post or get variable */ protected static function getPostGetVar($key,$defaultValue = ""){ if(array_key_exists($key, $_POST)) $val = self::getVar($_POST, $key, $defaultValue); else $val = self::getVar($_GET, $key, $defaultValue); return($val); } /** * * get some var from array */ public static function getVar($arr,$key,$defaultValue = ""){ $val = $defaultValue; if(isset($arr[$key])) $val = $arr[$key]; return($val); } /** * Get all images sizes + custom added sizes */ public static function get_all_image_sizes($type = 'gallery'){ $custom_sizes = array(); switch($type){ case 'flickr': $custom_sizes = array( 'original' => __('Original', 'revslider'), 'large' => __('Large', 'revslider'), 'large-square' => __('Large Square', 'revslider'), 'medium' => __('Medium', 'revslider'), 'medium-800' => __('Medium 800', 'revslider'), 'medium-640' => __('Medium 640', 'revslider'), 'small' => __('Small', 'revslider'), 'small-320' => __('Small 320', 'revslider'), 'thumbnail'=> __('Thumbnail', 'revslider'), 'square' => __('Square', 'revslider') ); break; case 'instagram': $custom_sizes = array( 'standard_resolution' => __('Standard Resolution', 'revslider'), 'thumbnail' => __('Thumbnail', 'revslider'), 'low_resolution' => __('Low Resolution', 'revslider') ); break; case 'twitter': $custom_sizes = array( 'large' => __('Standard Resolution', 'revslider') ); break; case 'facebook': $custom_sizes = array( 'full' => __('Original Size', 'revslider'), 'thumbnail' => __('Thumbnail', 'revslider') ); break; case 'youtube': $custom_sizes = array( 'default' => __('Default', 'revslider'), 'medium' => __('Medium', 'revslider'), 'high' => __('High', 'revslider'), 'standard' => __('Standard', 'revslider'), 'maxres' => __('Max. Res.', 'revslider') ); break; case 'vimeo': $custom_sizes = array( 'thumbnail_small' => __('Small', 'revslider'), 'thumbnail_medium' => __('Medium', 'revslider'), 'thumbnail_large' => __('Large', 'revslider'), ); break; case 'gallery': default: $added_image_sizes = get_intermediate_image_sizes(); if(!empty($added_image_sizes) && is_array($added_image_sizes)){ foreach($added_image_sizes as $key => $img_size_handle){ $custom_sizes[$img_size_handle] = ucwords(str_replace('_', ' ', $img_size_handle)); } } $img_orig_sources = array( 'full' => __('Original Size', 'revslider'), 'thumbnail' => __('Thumbnail', 'revslider'), 'medium' => __('Medium', 'revslider'), 'large' => __('Large', 'revslider') ); $custom_sizes = array_merge($img_orig_sources, $custom_sizes); break; } return $custom_sizes; } /** * retrieve the image id from the given image url */ public static function get_image_id_by_url($image_url) { global $wpdb; $attachment_id = 0; if(function_exists('attachment_url_to_postid')){ $attachment_id = attachment_url_to_postid($image_url); //0 if failed } if ( 0 == $attachment_id ){ //try to get it old school way //for WP < 4.0.0 $attachment_id = false; // If there is no url, return. if ( '' == $image_url ) return; // Get the upload directory paths $upload_dir_paths = wp_upload_dir(); // Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image if ( false !== strpos( $image_url, $upload_dir_paths['baseurl'] ) ) { // If this is the URL of an auto-generated thumbnail, get the URL of the original image $image_url = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $image_url ); // Remove the upload path base directory from the attachment URL $image_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $image_url ); // Finally, run a custom database query to get the attachment ID from the modified attachment URL $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $image_url ) ); } } return $attachment_id; } /** * get all the svg url sets used in Slider Revolution * @since: 5.1.7 **/ public static function get_svg_sets_url(){ $svg_sets = array(); $path = RS_PLUGIN_PATH . 'public/assets/assets/svg/'; $url = RS_PLUGIN_URL . 'public/assets/assets/svg/'; if(!file_exists($path.'action/ic_3d_rotation_24px.svg')){ //the path needs to be changed to the uploads folder then $upload_dir = wp_upload_dir(); $path = $upload_dir['basedir'].'/revslider/assets/svg/'; $url = $upload_dir['baseurl'].'/revslider/assets/svg/'; } $svg_sets['Actions'] = array('path' => $path.'action/', 'url' => $url.'action/'); $svg_sets['Alerts'] = array('path' => $path.'alert/', 'url' => $url.'alert/'); $svg_sets['AV'] = array('path' => $path.'av/', 'url' => $url.'av/'); $svg_sets['Communication'] = array('path' => $path.'communication/', 'url' => $url.'communication/'); $svg_sets['Content'] = array('path' => $path.'content/', 'url' => $url.'content/'); $svg_sets['Device'] = array('path' => $path.'device/', 'url' => $url.'device/'); $svg_sets['Editor'] = array('path' => $path.'editor/', 'url' => $url.'editor/'); $svg_sets['File'] = array('path' => $path.'file/', 'url' => $url.'file/'); $svg_sets['Hardware'] = array('path' => $path.'hardware/', 'url' => $url.'hardware/'); $svg_sets['Images'] = array('path' => $path.'image/', 'url' => $url.'image/'); $svg_sets['Maps'] = array('path' => $path.'maps/', 'url' => $url.'maps/'); $svg_sets['Navigation'] = array('path' => $path.'navigation/', 'url' => $url.'navigation/'); $svg_sets['Notifications'] = array('path' => $path.'notification/', 'url' => $url.'notification/'); $svg_sets['Places'] = array('path' => $path.'places/', 'url' => $url.'places/'); $svg_sets['Social'] = array('path' => $path.'social/', 'url' => $url.'social/'); $svg_sets['Toggle'] = array('path' => $path.'toggle/', 'url' => $url.'toggle/'); $svg_sets = apply_filters('revslider_get_svg_sets', $svg_sets); return $svg_sets; } /** * get all the svg files for given sets used in Slider Revolution * @since: 5.1.7 **/ public static function get_svg_sets_full(){ $svg_sets = self::get_svg_sets_url(); $svg = array(); if(!empty($svg_sets)){ foreach($svg_sets as $handle => $values){ $svg[$handle] = array(); if($dir = opendir($values['path'])) { while(false !== ($file = readdir($dir))){ if ($file != "." && $file != "..") { $filetype = pathinfo($file); if(isset($filetype['extension']) && $filetype['extension'] == 'svg'){ $svg[$handle][$file] = $values['url'].$file; } } } } } } $svg = apply_filters('revslider_get_svg_sets_full', $svg); return $svg; } /** * get all the icon sets used in Slider Revolution * @since: 5.0 **/ public static function get_icon_sets(){ $icon_sets = array(); $icon_sets = apply_filters('revslider_mod_icon_sets', $icon_sets); return $icon_sets; } /** * add default icon sets of Slider Revolution * @since: 5.0 **/ public static function set_icon_sets($icon_sets){ $icon_sets[] = 'fa-icon-'; $icon_sets[] = 'pe-7s-'; return $icon_sets; } /** * translates removed settings from Slider Settings from version <= 4.x to 5.0 * @since: 5.0 **/ public static function translate_settings_to_v5($settings){ if(isset($settings['navigaion_type'])){ switch($settings['navigaion_type']){ case 'none': // all is off, so leave the defaults break; case 'bullet': $settings['enable_bullets'] = 'on'; $settings['enable_thumbnails'] = 'off'; $settings['enable_tabs'] = 'off'; break; case 'thumb': $settings['enable_bullets'] = 'off'; $settings['enable_thumbnails'] = 'on'; $settings['enable_tabs'] = 'off'; break; } unset($settings['navigaion_type']); } if(isset($settings['navigation_arrows'])){ $settings['enable_arrows'] = ($settings['navigation_arrows'] == 'solo' || $settings['navigation_arrows'] == 'nexttobullets') ? 'on' : 'off'; unset($settings['navigation_arrows']); } if(isset($settings['navigation_style'])){ $settings['navigation_arrow_style'] = $settings['navigation_style']; $settings['navigation_bullets_style'] = $settings['navigation_style']; unset($settings['navigation_style']); } if(isset($settings['navigaion_always_on'])){ $settings['arrows_always_on'] = $settings['navigaion_always_on']; $settings['bullets_always_on'] = $settings['navigaion_always_on']; $settings['thumbs_always_on'] = $settings['navigaion_always_on']; unset($settings['navigaion_always_on']); } if(isset($settings['hide_thumbs']) && !isset($settings['hide_arrows']) && !isset($settings['hide_bullets'])){ //as hide_thumbs is still existing, we need to check if the other two were already set and only translate this if they are not set yet $settings['hide_arrows'] = $settings['hide_thumbs']; $settings['hide_bullets'] = $settings['hide_thumbs']; } if(isset($settings['navigaion_align_vert'])){ $settings['bullets_align_vert'] = $settings['navigaion_align_vert']; $settings['thumbnails_align_vert'] = $settings['navigaion_align_vert']; unset($settings['navigaion_align_vert']); } if(isset($settings['navigaion_align_hor'])){ $settings['bullets_align_hor'] = $settings['navigaion_align_hor']; $settings['thumbnails_align_hor'] = $settings['navigaion_align_hor']; unset($settings['navigaion_align_hor']); } if(isset($settings['navigaion_offset_hor'])){ $settings['bullets_offset_hor'] = $settings['navigaion_offset_hor']; $settings['thumbnails_offset_hor'] = $settings['navigaion_offset_hor']; unset($settings['navigaion_offset_hor']); } if(isset($settings['navigaion_offset_hor'])){ $settings['bullets_offset_hor'] = $settings['navigaion_offset_hor']; $settings['thumbnails_offset_hor'] = $settings['navigaion_offset_hor']; unset($settings['navigaion_offset_hor']); } if(isset($settings['navigaion_offset_vert'])){ $settings['bullets_offset_vert'] = $settings['navigaion_offset_vert']; $settings['thumbnails_offset_vert'] = $settings['navigaion_offset_vert']; unset($settings['navigaion_offset_vert']); } if(isset($settings['show_timerbar']) && !isset($settings['enable_progressbar'])){ if($settings['show_timerbar'] == 'hide'){ $settings['enable_progressbar'] = 'off'; $settings['show_timerbar'] = 'top'; }else{ $settings['enable_progressbar'] = 'on'; } } return $settings; } /** * explodes google fonts and returns the number of font weights of all fonts * @since: 5.0 **/ public static function get_font_weight_count($string){ $string = explode(':', $string); $nums = 0; if(count($string) >= 2){ $string = $string[1]; if(strpos($string, '&') !== false){ $string = explode('&', $string); $string = $string[0]; } $nums = count(explode(',', $string)); } return $nums; } /** * strip slashes recursive * @since: 5.0 */ public static function stripslashes_deep($value){ $value = is_array($value) ? array_map( array('RevSliderBase', 'stripslashes_deep'), $value) : stripslashes($value); return $value; } /** * check if file is in zip * @since: 5.0 */ public static function check_file_in_zip($d_path, $image, $alias, &$alreadyImported, $add_path = false){ global $wp_filesystem; if(trim($image) !== ''){ if(strpos($image, 'http') !== false){ }else{ $strip = false; $zimage = $wp_filesystem->exists( $d_path.'images/'.$image ); if(!$zimage){ $zimage = $wp_filesystem->exists( str_replace('//', '/', $d_path.'images/'.$image) ); $strip = true; } if(!$zimage){ //echo $image.__(' not found!
    ', 'revslider'); }else{ if(!isset($alreadyImported['images/'.$image])){ //check if we are object folder, if yes, do not import into media library but add it to the object folder $uimg = ($strip == true) ? str_replace('//', '/', 'images/'.$image) : $image; //pclzip $object_library = (strpos($uimg, 'revslider/objects/') === 0) ? true : false; if($object_library === true){ //copy the image to the objects folder if false $objlib = new RevSliderObjectLibrary(); $importImage = $objlib->_import_object($d_path.'images/'.$uimg); }else{ $importImage = RevSliderFunctionsWP::import_media($d_path.'images/'.$uimg, $alias.'/'); } if($importImage !== false){ $alreadyImported['images/'.$image] = $importImage['path']; $image = $importImage['path']; } }else{ $image = $alreadyImported['images/'.$image]; } } if($add_path){ $upload_dir = wp_upload_dir(); $cont_url = $upload_dir['baseurl']; $image = str_replace('uploads/uploads/', 'uploads/', $cont_url . '/' . $image); } } } return $image; } /** * add "a" tags to links within a text * @since: 5.0 */ public static function add_wrap_around_url($text){ $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; // Check if there is a url in the text if(preg_match($reg_exUrl, $text, $url)){ // make the urls hyper links return preg_replace($reg_exUrl, ''.$url[0].'', $text); }else{ // if no urls in the text just return the text return $text; } } /** * prints out debug text if constant TP_DEBUG is defined and true * @since: 5.2.4 */ public static function debug($value , $message, $where = "console"){ if( defined('TP_DEBUG') && TP_DEBUG ){ if($where=="console"){ echo ' '; } else{ var_dump($value); } } else { return false; } } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteBaseClassRev extends RevSliderBase {} ?>addon-admin.class.php000066600000015655152141733250010557 0ustar00 */ class Rev_addon_Admin { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; } /** * Register the stylesheets for the admin area. * * @since 1.0.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Rev_addon_Loader as all of the hooks are defined * in that particular class. * * The Rev_addon_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ if(isset($_GET["page"]) && $_GET["page"]=="rev_addon"){ wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'admin/assets/css/admin.css', array(), RevSliderGlobals::SLIDER_REVISION); wp_enqueue_style( $this->plugin_name, RS_PLUGIN_URL . 'admin/assets/css/rev_addon-admin.css', array( ), $this->version); } } /** * Register the JavaScript for the admin area. * * @since 1.0.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Rev_addon_Loader as all of the hooks are defined * in that particular class. * * The Rev_addon_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ if(isset($_GET["page"]) && $_GET["page"]=="rev_addon"){ wp_enqueue_script('tp-tools', RS_PLUGIN_URL .'public/assets/js/jquery.themepunch.tools.min.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_script('unite_admin', RS_PLUGIN_URL .'admin/assets/js/admin.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_script( $this->plugin_name, RS_PLUGIN_URL .'admin/assets/js/rev_addon-admin.js', array( 'jquery' ), $this->version, false ); wp_localize_script( $this->plugin_name, 'rev_slider_addon', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'please_wait_a_moment' => __("Please Wait a Moment",'revslider'), 'settings_saved' => __("Settings saved",'revslider') )); } } /** * Register the administration menu for this plugin into the WordPress Dashboard menu. * * @since 1.0.0 */ public function add_plugin_admin_menu() { $this->plugin_screen_hook_suffix = add_submenu_page( 'revslider', __( 'Add-Ons', 'revslider' ), __( 'Add-Ons', 'revslider' ), 'manage_options', $this->plugin_name, array( $this, 'display_plugin_admin_page' ) ); } /** * Render the settings page for this plugin. * * @since 1.0.0 */ public function display_plugin_admin_page() { include_once( RS_PLUGIN_PATH.'admin/views/rev_addon-admin-display.php' ); } /** * Activates Installed Add-On/Plugin * * @since 1.0.0 */ public function activate_plugin() { // Verify that the incoming request is coming with the security nonce if( wp_verify_nonce( $_REQUEST['nonce'], 'ajax_rev_slider_addon_nonce' ) ) { if(isset($_REQUEST['plugin'])){ //update_option( "rev_slider_addon_gal_default", sanitize_text_field($_REQUEST['default_gallery']) ); $result = activate_plugin( $_REQUEST['plugin'] ); if ( is_wp_error( $result ) ) { // Process Error die('0'); } die( '1' ); } else{ die( '0' ); } } else { die( '-1' ); } } /** * Deactivates Installed Add-On/Plugin * * @since 1.0.0 */ public function deactivate_plugin() { // Verify that the incoming request is coming with the security nonce if( wp_verify_nonce( $_REQUEST['nonce'], 'ajax_rev_slider_addon_nonce' ) ) { if(isset($_REQUEST['plugin'])){ //update_option( "rev_slider_addon_gal_default", sanitize_text_field($_REQUEST['default_gallery']) ); $result = deactivate_plugins( $_REQUEST['plugin'] ); if ( is_wp_error( $result ) ) { // Process Error die('0'); } die( '1' ); } else{ die( '0' ); } } else { die( '-1' ); } } /** * Install Add-On/Plugin * * @since 1.0.0 */ public function install_plugin() { if( wp_verify_nonce( $_REQUEST['nonce'], 'ajax_rev_slider_addon_nonce' ) ) { if(isset($_REQUEST['plugin'])){ global $wp_version; $plugin_slug = basename($_REQUEST['plugin']); $plugin_result = false; $plugin_message = 'UNKNOWN'; if(0 !== strpos($plugin_slug, 'revslider-')) die( '-1' ); $url = 'http://updates.themepunch.tools/addons/'.$plugin_slug.'/'.$plugin_slug.'.zip'; $get = wp_remote_post($url, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'body' => '', 'timeout' => 45 )); if( !$get || $get["response"]["code"] != "200" ){ $plugin_message = 'FAILED TO DOWNLOAD'; }else{ $plugin_message = 'ZIP is there'; $upload_dir = wp_upload_dir(); $file = $upload_dir['basedir']. '/revslider/templates/' . $plugin_slug . '.zip'; @mkdir(dirname($file)); $ret = @file_put_contents( $file, $get['body'] ); WP_Filesystem(); global $wp_filesystem; $upload_dir = wp_upload_dir(); $d_path = WP_PLUGIN_DIR; $unzipfile = unzip_file( $file, $d_path); if( is_wp_error($unzipfile) ){ define('FS_METHOD', 'direct'); //lets try direct. WP_Filesystem(); //WP_Filesystem() needs to be called again since now we use direct ! //@chmod($file, 0775); $unzipfile = unzip_file( $file, $d_path); if( is_wp_error($unzipfile) ){ $d_path = WP_PLUGIN_DIR; $unzipfile = unzip_file( $file, $d_path); if( is_wp_error($unzipfile) ){ $f = basename($file); $d_path = str_replace($f, '', $file); $unzipfile = unzip_file( $file, $d_path); } } } @unlink($file); die('1'); } //$result = activate_plugin( $plugin_slug.'/'.$plugin_slug.'.php' ); } else{ die( '0' ); } } else { die( '-1' ); } } } // END of classelements-base.class.php000066600000000737152141733250011123 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderElementsBase { protected $db; public function __construct(){ $this->db = new RevSliderDB(); } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteElementsBaseRev extends RevSliderElementsBase {} ?>plugin-update.class.php000066600000337427152141733250011166 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderPluginUpdate { /** * @since 5.0 */ public function __construct(){ } /** * return version of installation * @since 5.0 */ public static function get_version(){ $real_version = get_option('revslider_update_version', 1.0); return $real_version; } /** * set version of installation * @since 5.0 */ public static function set_version($set_to){ update_option('revslider_update_version', $set_to); } /** * check for updates and proceed if needed * @since 5.0 */ public static function do_update_checks(){ $version = self::get_version(); if(version_compare($version, 5.0, '<')){ self::update_css_styles(); //update styles to the new 5.0 way self::add_v5_styles(); //add the version 5 styles that are new! self::check_settings_table(); //remove the usage of the settings table self::move_template_slider(); //move template sliders slides to the post based sliders and delete them/move them if not used self::add_animation_settings_to_layer(); //set missing animation fields to the slides layers self::add_style_settings_to_layer(); //set missing styling fields to the slides layers self::change_settings_on_layers(); //change settings on layers, for example, add the new structure of actions self::add_general_settings(); //set general settings self::remove_static_slides(); //remove static slides if the slider was v4 and had static slides which were not enabled $version = 5.0; self::set_version($version); } if(version_compare($version, '5.0.7', '<')){ $version = '5.0.7'; self::change_general_settings_5_0_7(); self::set_version($version); } if(version_compare($version, '5.1.1', '<')){ $version = '5.1.1'; self::change_slide_settings_5_1_1(); self::set_version($version); } if(version_compare($version, '5.2.5.5', '<')){ $version = '5.2.5.5'; self::change_layers_svg_5_2_5_5(); self::set_version($version); } } /** * add new styles for version 5.0 * @since 5.0 */ public static function add_v5_styles(){ $v5 = array( array('handle' => '.tp-caption.MarkerDisplay','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ff0000","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0px","0px","0px","0px"],"skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0"}','params' => '{"font-style":"normal","font-family":"Permanent Marker","padding":"0px 0px 0px 0px","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"#000000","border-style":"none","border-width":"0px","border-radius":"0px 0px 0px 0px","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"text-shadow":"none"},"hover":""}'), array('handle' => '.tp-caption.Restaurant-Display','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0"}','params' => '{"color":"#ffffff","font-size":"120px","line-height":"120px","font-weight":"700","font-style":"normal","font-family":"Roboto","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Restaurant-Cursive','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0"}','params' => '{"color":"#ffffff","font-size":"30px","line-height":"30px","font-weight":"400","font-style":"normal","font-family":"Nothing you could do","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Restaurant-ScrollDownText','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0"}','params' => '{"color":"#ffffff","font-size":"17px","line-height":"17px","font-weight":"400","font-style":"normal","font-family":"Roboto","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Restaurant-Description','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0"}','params' => '{"color":"#ffffff","font-size":"20px","line-height":"30px","font-weight":"300","font-style":"normal","font-family":"Roboto","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.Restaurant-Price','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0"}','params' => '{"color":"#ffffff","font-size":"30px","line-height":"30px","font-weight":"300","font-style":"normal","font-family":"Roboto","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.Restaurant-Menuitem','settings' => '{"hover":"false","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#000000","color-transparency":"1","text-decoration":"none","background-color":"#ffffff","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"500","easing":"Power2.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"17px","line-height":"17px","font-weight":"400","font-style":"normal","font-family":"Roboto","padding":["10px","30px","10px","30px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Furniture-LogoText','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#e6cfa3","color-transparency":"1","font-size":"160px","line-height":"150px","font-weight":"300","font-style":"normal","font-family":"\\"Raleway\\"","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"text-shadow":"none"},"hover":""}'), array('handle' => '.tp-caption.Furniture-Plus','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["30px","30px","30px","30px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0.5","easing":"Linear.easeNone"}','params' => '{"color":"#e6cfa3","color-transparency":"1","font-size":"20","line-height":"20px","font-weight":"400","font-style":"normal","font-family":"\\"Raleway\\"","padding":["6px","7px","4px","7px"],"text-decoration":"none","background-color":"#ffffff","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["30px","30px","30px","30px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"text-shadow":"none","box-shadow":"rgba(0,0,0,0.1) 0 1px 3px"},"hover":""}'), array('handle' => '.tp-caption.Furniture-Title','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#000000","color-transparency":"1","font-size":"20px","line-height":"20px","font-weight":"700","font-style":"normal","font-family":"\\"Raleway\\"","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"text-shadow":"none","letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.Furniture-Subtitle','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#000000","color-transparency":"1","font-size":"17px","line-height":"20px","font-weight":"300","font-style":"normal","font-family":"\\"Raleway\\"","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"text-shadow":"none"},"hover":""}'), array('handle' => '.tp-caption.Gym-Display','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"80px","line-height":"70px","font-weight":"900","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Gym-Subline','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"30px","line-height":"30px","font-weight":"100","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"5px"},"hover":""}'), array('handle' => '.tp-caption.Gym-SmallText','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"17px","line-height":"22","font-weight":"300","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"text-shadow":"none"},"hover":""}'), array('handle' => '.tp-caption.Fashion-SmallText','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"12px","line-height":"20px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Fashion-BigDisplay','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#000000","color-transparency":"1","font-size":"60px","line-height":"60px","font-weight":"900","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Fashion-TextBlock','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#000000","color-transparency":"1","font-size":"20px","line-height":"40px","font-weight":"400","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Sports-Display','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"130px","line-height":"130px","font-weight":"100","font-style":"normal","font-family":"\\"Raleway\\"","padding":"0 0 0 0","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":"0 0 0 0","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"13px"},"hover":""}'), array('handle' => '.tp-caption.Sports-DisplayFat','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"130px","line-height":"130px","font-weight":"900","font-style":"normal","font-family":"\\"Raleway\\"","padding":"0 0 0 0","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":"0 0 0 0","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":[""],"hover":""}'), array('handle' => '.tp-caption.Sports-Subline','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#000000","color-transparency":"1","font-size":"32px","line-height":"32px","font-weight":"400","font-style":"normal","font-family":"\\"Raleway\\"","padding":"0 0 0 0","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":"0 0 0 0","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"4px"},"hover":""}'), array('handle' => '.tp-caption.Instagram-Caption','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"20px","line-height":"20px","font-weight":"900","font-style":"normal","font-family":"Roboto","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.News-Title','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"70px","line-height":"60px","font-weight":"400","font-style":"normal","font-family":"Roboto Slab","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.News-Subtitle','settings' => '{"hover":"true","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"0.65","text-decoration":"none","background-color":"#ffffff","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"solid","border-width":"0px","border-radius":["0","0","0px","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"300","easing":"Power3.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"15px","line-height":"24px","font-weight":"300","font-style":"normal","font-family":"Roboto Slab","padding":["0","0","0","0"],"text-decoration":"none","background-color":"#ffffff","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Photography-Display','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"80px","line-height":"70px","font-weight":"100","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"5px"},"hover":""}'), array('handle' => '.tp-caption.Photography-Subline','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#777777","color-transparency":"1","font-size":"20px","line-height":"30px","font-weight":"300","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.Photography-ImageHover','settings' => '{"hover":"true","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"0.5","scalex":"0.8","scaley":"0.8","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"1000","easing":"Power3.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"20","line-height":"22","font-weight":"400","font-style":"normal","font-family":"","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"#ffffff","border-transparency":"0","border-style":"none","border-width":"0px","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Photography-Menuitem','settings' => '{"hover":"true","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#00ffde","background-transparency":"0.65","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"200","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"20px","line-height":"20px","font-weight":"300","font-style":"normal","font-family":"Raleway","padding":["3px","5px","3px","8px"],"text-decoration":"none","background-color":"#000000","background-transparency":"0.65","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Photography-Textblock','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#fff","color-transparency":"1","font-size":"17px","line-height":"30px","font-weight":"300","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Photography-Subline-2','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"0.35","font-size":"20px","line-height":"30px","font-weight":"300","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":{"letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.Photography-ImageHover2','settings' => '{"hover":"true","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"0.5","scalex":"0.8","scaley":"0.8","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"500","easing":"Back.easeOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"20","line-height":"22","font-weight":"400","font-style":"normal","font-family":"Arial","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"#ffffff","border-transparency":"0","border-style":"none","border-width":"0px","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.WebProduct-Title','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#333333","color-transparency":"1","font-size":"90px","line-height":"90px","font-weight":"100","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.WebProduct-SubTitle','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#999999","color-transparency":"1","font-size":"15px","line-height":"20px","font-weight":"400","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.WebProduct-Content','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#999999","color-transparency":"1","font-size":"16px","line-height":"24px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.WebProduct-Menuitem','settings' => '{"hover":"true","version":"5.0","translated":"5"}','hover' => '{"color":"#999999","color-transparency":"1","text-decoration":"none","background-color":"#ffffff","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"200","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"15px","line-height":"20px","font-weight":"500","font-style":"normal","font-family":"Raleway","padding":["3px","5px","3px","8px"],"text-decoration":"none","text-align":"left","background-color":"#333333","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.WebProduct-Title-Light','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#fff","color-transparency":"1","font-size":"90px","line-height":"90px","font-weight":"100","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","text-align":"left","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.WebProduct-SubTitle-Light','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"0.35","font-size":"15px","line-height":"20px","font-weight":"400","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","text-align":"left","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.WebProduct-Content-Light','settings' => '{"hover":"false","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"0.65","font-size":"16px","line-height":"24px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["0","0","0","0"],"text-decoration":"none","text-align":"left","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.FatRounded','settings' => '{"hover":"true","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#fff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"1","border-color":"#d3d3d3","border-transparency":"1","border-style":"none","border-width":"0px","border-radius":["50px","50px","50px","50px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Linear.easeNone"}','params' => '{"color":"#fff","color-transparency":"1","font-size":"30px","line-height":"30px","font-weight":"900","font-style":"normal","font-family":"Raleway","padding":["20px","22px","20px","25px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0.5","border-color":"#d3d3d3","border-transparency":"1","border-style":"none","border-width":"0px","border-radius":["50px","50px","50px","50px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"text-shadow":"none"},"hover":""}'), array('handle' => '.tp-caption.NotGeneric-Title','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"70px","line-height":"70px","font-weight":"800","font-style":"normal","font-family":"Raleway","padding":"10px 0px 10px 0","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":"0 0 0 0","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"[object Object]","hover":""}'), array('handle' => '.tp-caption.NotGeneric-SubTitle','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"13px","line-height":"20px","font-weight":"500","font-style":"normal","font-family":"Raleway","padding":"0 0 0 0","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":"0 0 0 0","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"4px","text-align":"left"},"hover":""}'), array('handle' => '.tp-caption.NotGeneric-CallToAction','settings' => '{"hover":"true","translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1","border-radius":"0px 0px 0px 0px","opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power3.easeOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"14px","line-height":"14px","font-weight":"500","font-style":"normal","font-family":"Raleway","padding":"10px 30px 10px 30px","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.5","border-style":"solid","border-width":"1","border-radius":"0px 0px 0px 0px","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"3px","text-align":"left"},"hover":""}'), array('handle' => '.tp-caption.NotGeneric-Icon','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"default","speed":"300","easing":"Power3.easeOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"30px","line-height":"30px","font-weight":"400","font-style":"normal","font-family":"Raleway","padding":"0px 0px 0px 0px","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0","border-style":"solid","border-width":"0px","border-radius":"0px 0px 0px 0px","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"3px","text-align":"left"},"hover":""}'), array('handle' => '.tp-caption.NotGeneric-Menuitem','settings' => '{"hover":"true","translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1px","border-radius":"0px 0px 0px 0px","opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power1.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"14px","line-height":"14px","font-weight":"500","font-style":"normal","font-family":"Raleway","padding":"27px 30px 27px 30px","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.15","border-style":"solid","border-width":"1px","border-radius":"0px 0px 0px 0px","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"3px","text-align":"left"},"hover":""}'), array('handle' => '.tp-caption.MarkerStyle','settings' => '{"translated":5,"type":"text","version":"5.0"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"17px","line-height":"30px","font-weight":"100","font-style":"normal","font-family":"\\"Permanent Marker\\"","padding":"0 0 0 0","text-decoration":"none","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":"0 0 0 0","z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"text-align":"left","0":""},"hover":""}'), array('handle' => '.tp-caption.Gym-Menuitem','settings' => '{"hover":"true","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"1","border-color":"#ffffff","border-transparency":"0.25","border-style":"solid","border-width":"2px","border-radius":["3px","3px","3px","3px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"200","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"20px","line-height":"20px","font-weight":"300","font-style":"normal","font-family":"Raleway","padding":["3px","5px","3px","8px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"1","border-color":"#ffffff","border-transparency":"0","border-style":"solid","border-width":"2px","border-radius":["3px","3px","3px","3px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Newspaper-Button','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#000000","color-transparency":"1","text-decoration":"none","background-color":"#FFFFFF","background-transparency":"1","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1px","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power1.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"13px","line-height":"17px","font-weight":"700","font-style":"normal","font-family":"Roboto","padding":["12px","35px","12px","35px"],"text-decoration":"none","text-align":"left","background-color":"#ffffff","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.25","border-style":"solid","border-width":"1px","border-radius":["0px","0px","0px","0px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Newspaper-Subtitle','settings' => '{"hover":"false","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#a8d8ee","color-transparency":"1","font-size":"15px","line-height":"20px","font-weight":"900","font-style":"normal","font-family":"Roboto","padding":["0","0","0","0"],"text-decoration":"none","text-align":"left","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Newspaper-Title','settings' => '{"hover":"false","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#fff","color-transparency":"1","font-size":"50px","line-height":"55px","font-weight":"400","font-style":"normal","font-family":"\\"Roboto Slab\\"","padding":["0","0","10px","0"],"text-decoration":"none","text-align":"left","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Newspaper-Title-Centered','settings' => '{"hover":"false","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#fff","color-transparency":"1","font-size":"50px","line-height":"55px","font-weight":"400","font-style":"normal","font-family":"\\"Roboto Slab\\"","padding":["0","0","10px","0"],"text-decoration":"none","text-align":"center","background-color":"transparent","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Hero-Button','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#000000","color-transparency":"1","text-decoration":"none","background-color":"#ffffff","background-transparency":"1","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power1.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"14px","line-height":"14px","font-weight":"500","font-style":"normal","font-family":"Raleway","padding":["10px","30px","10px","30px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.5","border-style":"solid","border-width":"1","border-radius":["0px","0px","0px","0px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.Video-Title','settings' => '{"hover":"false","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#fff","color-transparency":"1","font-size":"30px","line-height":"30px","font-weight":"900","font-style":"normal","font-family":"Raleway","padding":["5px","5px","5px","5px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"1","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"-20%","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Video-SubTitle','settings' => '{"hover":"false","type":"text","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"0","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"12px","line-height":"12px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["5px","5px","5px","5px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0.35","border-color":"transparent","border-transparency":"1","border-style":"none","border-width":"0","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"-20%","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.NotGeneric-Button','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"transparent","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power1.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"14px","line-height":"14px","font-weight":"500","font-style":"normal","font-family":"Raleway","padding":["10px","30px","10px","30px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.5","border-style":"solid","border-width":"1","border-radius":["0px","0px","0px","0px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"3px","text-align":"left"},"hover":""}'), array('handle' => '.tp-caption.NotGeneric-BigButton','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1px","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power1.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"14px","line-height":"14px","font-weight":"500","font-style":"normal","font-family":"Raleway","padding":["27px","30px","27px","30px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.15","border-style":"solid","border-width":"1px","border-radius":["0px","0px","0px","0px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.WebProduct-Button','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#333333","color-transparency":"1","text-decoration":"none","background-color":"#ffffff","background-transparency":"1","border-color":"#000000","border-transparency":"1","border-style":"none","border-width":"2","border-radius":["0","0","0","0"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"300","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"16px","line-height":"48px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["0px","40px","0px","40px"],"text-decoration":"none","text-align":"left","background-color":"#333333","background-transparency":"1","border-color":"#000000","border-transparency":"1","border-style":"none","border-width":"2","border-radius":["0","0","0","0"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"1px"},"hover":""}'), array('handle' => '.tp-caption.Restaurant-Button','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffe081","border-transparency":"1","border-style":"solid","border-width":"2","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"300","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"17px","line-height":"17px","font-weight":"500","font-style":"normal","font-family":"Roboto","padding":["12px","35px","12px","35px"],"text-decoration":"none","text-align":"left","background-color":"#0a0a0a","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.5","border-style":"solid","border-width":"2","border-radius":["0px","0px","0px","0px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"3px"},"hover":""}'), array('handle' => '.tp-caption.Gym-Button','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#72a800","background-transparency":"1","border-color":"#000000","border-transparency":"0","border-style":"solid","border-width":"0","border-radius":["30px","30px","30px","30px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power1.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"15px","line-height":"15px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["13px","35px","13px","35px"],"text-decoration":"none","text-align":"left","background-color":"#8bc027","background-transparency":"1","border-color":"#000000","border-transparency":"0","border-style":"solid","border-width":"0","border-radius":["30px","30px","30px","30px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"1px"},"hover":""}'), array('handle' => '.tp-caption.Gym-Button-Light','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#72a800","background-transparency":"0","border-color":"#8bc027","border-transparency":"1","border-style":"solid","border-width":"2px","border-radius":["30px","30px","30px","30px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Power2.easeInOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"15px","line-height":"15px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["12px","35px","12px","35px"],"text-decoration":"none","text-align":"left","background-color":"transparent","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.25","border-style":"solid","border-width":"2px","border-radius":["30px","30px","30px","30px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}'), array('handle' => '.tp-caption.Sports-Button-Light','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"2","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"500","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"17px","line-height":"17px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["12px","35px","12px","35px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.5","border-style":"solid","border-width":"2","border-radius":["0px","0px","0px","0px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Sports-Button-Red','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"1","border-color":"#000000","border-transparency":"1","border-style":"solid","border-width":"2","border-radius":["0px","0px","0px","0px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"500","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"17px","line-height":"17px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["12px","35px","12px","35px"],"text-decoration":"none","text-align":"left","background-color":"#db1c22","background-transparency":"1","border-color":"#db1c22","border-transparency":"0","border-style":"solid","border-width":"2px","border-radius":["0px","0px","0px","0px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"2px"},"hover":""}'), array('handle' => '.tp-caption.Photography-Button','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"1px","border-radius":["30px","30px","30px","30px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"auto","speed":"300","easing":"Power3.easeOut"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"15px","line-height":"15px","font-weight":"600","font-style":"normal","font-family":"Raleway","padding":["13px","35px","13px","35px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.25","border-style":"solid","border-width":"1px","border-radius":["30px","30px","30px","30px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":{"letter-spacing":"1px"},"hover":""}'), array('handle' => '.tp-caption.Newspaper-Button-2','settings' => '{"hover":"true","type":"button","version":"5.0","translated":"5"}','hover' => '{"color":"#ffffff","color-transparency":"1","text-decoration":"none","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"1","border-style":"solid","border-width":"2","border-radius":["3px","3px","3px","3px"],"opacity":"1","scalex":"1","scaley":"1","skewx":"0","skewy":"0","xrotate":"0","yrotate":"0","2d_rotation":"0","css_cursor":"pointer","speed":"300","easing":"Linear.easeNone"}','params' => '{"color":"#ffffff","color-transparency":"1","font-size":"15px","line-height":"15px","font-weight":"900","font-style":"normal","font-family":"Roboto","padding":["10px","30px","10px","30px"],"text-decoration":"none","text-align":"left","background-color":"#000000","background-transparency":"0","border-color":"#ffffff","border-transparency":"0.5","border-style":"solid","border-width":"2","border-radius":["3px","3px","3px","3px"],"z":"0","skewx":"0","skewy":"0","scalex":"1","scaley":"1","opacity":"1","xrotate":"0","yrotate":"0","2d_rotation":"0","2d_origin_x":"50","2d_origin_y":"50","pers":"600","corner_left":"nothing","corner_right":"nothing","parallax":"-"}','advanced' => '{"idle":"","hover":""}') ); $db = new RevSliderDB(); foreach($v5 as $v5class){ $result = $db->fetch(RevSliderGlobals::$table_css, $db->prepare("handle = %s", array($v5class['handle']))); if(empty($result)){ //add v5 style $db->insert(RevSliderGlobals::$table_css, $v5class); } } } /** * update the styles to meet requirements for version 5.0 * @since 5.0 */ public static function update_css_styles(){ $css = new RevSliderCssParser(); $db = new RevSliderDB(); $styles = $db->fetch(RevSliderGlobals::$table_css); $default_classes = RevSliderCssParser::default_css_classes(); $cs = array( 'background-color' => 'backgroundColor', //rgb rgba and opacity 'border-color' => 'borderColor', 'border-radius' => 'borderRadius', 'border-style' => 'borderStyle', 'border-width' => 'borderWidth', 'color' => 'color', 'font-family' => 'fontFamily', 'font-size' => 'fontSize', 'font-style' => 'fontStyle', 'font-weight' => 'fontWeight', 'line-height' => 'lineHeight', 'opacity' => 'opacity', 'padding' => 'padding', 'text-decoration' => 'textDecoration', 'text-align' => 'textAlign' ); $cs = array_merge($cs, RevSliderCssParser::get_deformation_css_tags()); foreach($styles as $key => $attr){ if(isset($attr['advanced'])){ $adv = json_decode($attr['advanced'], true); // = array('idle' => array(), 'hover' => ''); }else{ $adv = array('idle' => array(), 'hover' => ''); } if(!isset($adv['idle'])) $adv['idle'] = array(); if(!isset($adv['hover'])) $adv['hover'] = array(); //only do this to styles prior 5.0 $settings = json_decode($attr['settings'], true); if(!empty($settings) && isset($settings['translated'])){ if(version_compare($settings['translated'], 5.0, '>=')) continue; } $idle = json_decode($attr['params'], true); $hover = json_decode($attr['hover'], true); //check if in styles, there is type, then change the type text to something else $the_type = 'text'; if(!empty($idle)){ foreach($idle as $style => $value){ if($style == 'type') $the_type = $value; if(!isset($cs[$style])){ $adv['idle'][$style] = $value; unset($idle[$style]); } } } if(!empty($hover)){ foreach($hover as $style => $value){ if(!isset($cs[$style])){ $adv['hover'][$style] = $value; unset($hover[$style]); } } } $settings['translated'] = 5.0; //set the style version to 5.0 $settings['type'] = $the_type; //set the type version to text, since 5.0 we also have buttons and shapes, so we need to differentiate from now on if(!isset($settings['version'])){ if(isset($default_classes[$styles[$key]['handle']])){ $settings['version'] = $default_classes[$styles[$key]['handle']]; }else{ $settings['version'] = 'custom'; //set the version to custom as its not in the defaults } } $styles[$key]['params'] = json_encode($idle); $styles[$key]['hover'] = json_encode($hover); $styles[$key]['advanced'] = json_encode($adv); $styles[$key]['settings'] = json_encode($settings); } //save now all styles back to database foreach($styles as $key => $attr){ $ret = $db->update(RevSliderGlobals::$table_css, array('settings' => $styles[$key]['settings'], 'params' => $styles[$key]['params'], 'hover' => $styles[$key]['hover'], 'advanced' => $styles[$key]['advanced']), array('id' => $attr['id'])); } } /** * remove the settings from the table and use them from now on with get_option / update_option * @since 5.0 */ public static function check_settings_table(){ global $wpdb; if($wpdb->get_var("SHOW TABLES LIKE '".RevSliderGlobals::$table_settings."'") == RevSliderGlobals::$table_settings) { $result = $wpdb->get_row("SELECT `general` FROM ".RevSliderGlobals::$table_settings, ARRAY_A); if(isset($result['general'])){ update_option('revslider-global-settings', $result['general']); } } } /** * move the template sliders and add the slides to corresponding post based slider or simply move them and change them to post based slider if no slider is using them * @since 5.0 */ public static function move_template_slider(){ $db = new RevSliderDB(); $used_templates = array(); //will store all template IDs that are used by post based Sliders, these can be deleted after the progress. $sr = new RevSlider(); $sl = new RevSliderSlide(); $arrSliders = $sr->getArrSliders(false, false); $tempSliders = $sr->getArrSliders(false, true); if(empty($tempSliders) || !is_array($tempSliders)) return true; //as we do not have any template sliders, we do not need to run further here if(!empty($arrSliders) && is_array($arrSliders)){ foreach($arrSliders as $slider){ if($slider->getParam('source_type', 'gallery') !== 'posts') continue; //only check Slider with type of posts $slider_id = $slider->getID(); $template_id = $slider->getParam('slider_template_id',0); if($template_id > 0){ //initialize slider to see if it exists. Then copy over the Template Sliders Slides to the Post Based Slider foreach($tempSliders as $t_slider){ if($t_slider->getID() === $template_id){ //copy over the slides //get all slides from template, then copy to Slider $slides = $t_slider->getSlides(); if(!empty($slides) && is_array($slides)){ foreach($slides as $slide){ $slide_id = $slide->getID(); $slider->copySlideToSlider(array('slider_id' => $slider_id, 'slide_id' => $slide_id)); } } $static_id = $sl->getStaticSlideID($template_id); if($static_id !== false){ $record = $db->fetchSingle(RevSliderGlobals::$table_static_slides, $db->prepare("id = %s", array($static_id))); unset($record['id']); $record['slider_id'] = $slider_id; $db->insert(RevSliderGlobals::$table_static_slides, $record); } $used_templates[$template_id] = $t_slider; break; } } } } } if(!empty($used_templates)){ foreach($used_templates as $tid => $t_slider){ $t_slider->deleteSlider(); } } //translate all other template Sliders to normal sliders and set them to post based $temp_sliders = $sr->getArrSliders(false, true); if(!empty($temp_sliders) && is_array($temp_sliders)){ foreach($temp_sliders as $slider){ $slider->updateParam(array('template' => 'false')); $slider->updateParam(array('source_type' => 'posts')); } } } /** * add missing new animation fields to the layers as all animations would be broken without this * @since 5.0 */ public static function add_animation_settings_to_layer($sliders = false){ $sr = new RevSlider(); $sl = new RevSliderSlide(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } $inAnimations = RevSliderOperations::getArrAnimations(true); $outAnimations = RevSliderOperations::getArrEndAnimations(true); if(!empty($sliders) && is_array($sliders)){ foreach($sliders as $slider){ $slides = $slider->getSlides(); $staticID = $sl->getStaticSlideID($slider->getID()); if($staticID !== false){ $msl = new RevSliderSlide(); if(strpos($staticID, 'static_') === false){ $staticID = 'static_'.$slider->getID(); } $msl->initByID($staticID); if($msl->getID() !== ''){ $slides = array_merge($slides, array($msl)); } } if(!empty($slides) && is_array($slides)){ foreach($slides as $slide){ $layers = $slide->getLayers(); if(!empty($layers) && is_array($layers)){ foreach($layers as $lk => $layer){ if(RevSliderFunctions::getVal($layer, 'x_start', false) === false){ //values are not set, set them now through $animation = RevSliderFunctions::getVal($layer, 'animation', 'tp-fade'); $endanimation = RevSliderFunctions::getVal($layer, 'endanimation', 'tp-fade'); if($animation == 'fade') $animation = 'tp-fade'; if($endanimation == 'fade') $endanimation = 'tp-fade'; $anim_values = array(); foreach($inAnimations as $handle => $anim){ if($handle == $animation){ $anim_values = (isset($anim['params'])) ? $anim['params'] : ''; if(!is_array($anim_values)) $anim_values = json_encode($anim_values); break; } } $anim_endvalues = array(); foreach($outAnimations as $handle => $anim){ if($handle == $endanimation){ $anim_endvalues = (isset($anim['params'])) ? $anim['params'] : ''; if(!is_array($anim_endvalues)) $anim_endvalues = json_encode($anim_endvalues); break; } } $layers[$lk]['x_start'] = RevSliderFunctions::getVal($anim_values, 'movex', 'inherit'); $layers[$lk]['x_end'] = RevSliderFunctions::getVal($anim_endvalues, 'movex', 'inherit'); $layers[$lk]['y_start'] = RevSliderFunctions::getVal($anim_values, 'movey', 'inherit'); $layers[$lk]['y_end'] = RevSliderFunctions::getVal($anim_endvalues, 'movey', 'inherit'); $layers[$lk]['z_start'] = RevSliderFunctions::getVal($anim_values, 'movez', 'inherit'); $layers[$lk]['z_end'] = RevSliderFunctions::getVal($anim_endvalues, 'movez', 'inherit'); $layers[$lk]['x_rotate_start'] = RevSliderFunctions::getVal($anim_values, 'rotationx', 'inherit'); $layers[$lk]['x_rotate_end'] = RevSliderFunctions::getVal($anim_endvalues, 'rotationx', 'inherit'); $layers[$lk]['y_rotate_start'] = RevSliderFunctions::getVal($anim_values, 'rotationy', 'inherit'); $layers[$lk]['y_rotate_end'] = RevSliderFunctions::getVal($anim_endvalues, 'rotationy', 'inherit'); $layers[$lk]['z_rotate_start'] = RevSliderFunctions::getVal($anim_values, 'rotationz', 'inherit'); $layers[$lk]['z_rotate_end'] = RevSliderFunctions::getVal($anim_endvalues, 'rotationz', 'inherit'); $layers[$lk]['scale_x_start'] = RevSliderFunctions::getVal($anim_values, 'scalex', 'inherit'); if(intval($layers[$lk]['scale_x_start']) > 10) $layers[$lk]['scale_x_start'] /= 100; $layers[$lk]['scale_x_end'] = RevSliderFunctions::getVal($anim_endvalues, 'scalex', 'inherit'); if(intval($layers[$lk]['scale_x_end']) > 10) $layers[$lk]['scale_x_end'] /= 100; $layers[$lk]['scale_y_start'] = RevSliderFunctions::getVal($anim_values, 'scaley', 'inherit'); if(intval($layers[$lk]['scale_y_start']) > 10) $layers[$lk]['scale_y_start'] /= 100; $layers[$lk]['scale_y_end'] = RevSliderFunctions::getVal($anim_endvalues, 'scaley', 'inherit'); if(intval($layers[$lk]['scale_y_end']) > 10) $layers[$lk]['scale_y_end'] /= 100; $layers[$lk]['skew_x_start'] = RevSliderFunctions::getVal($anim_values, 'skewx', 'inherit'); $layers[$lk]['skew_x_end'] = RevSliderFunctions::getVal($anim_endvalues, 'skewx', 'inherit'); $layers[$lk]['skew_y_start'] = RevSliderFunctions::getVal($anim_values, 'skewy', 'inherit'); $layers[$lk]['skew_y_end'] = RevSliderFunctions::getVal($anim_endvalues, 'skewy', 'inherit'); $layers[$lk]['opacity_start'] = RevSliderFunctions::getVal($anim_values, 'captionopacity', 'inherit'); $layers[$lk]['opacity_end'] = RevSliderFunctions::getVal($anim_endvalues, 'captionopacity', 'inherit'); } } $slide->setLayersRaw($layers); $slide->saveLayers(); } } } } } } /** * add/change layers options * @since 5.0 */ public static function change_settings_on_layers($sliders = false){ $sr = new RevSlider(); $sl = new RevSliderSlide(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } if(!empty($sliders) && is_array($sliders)){ foreach($sliders as $slider){ $slides = $slider->getSlides(); $staticID = $sl->getStaticSlideID($slider->getID()); if($staticID !== false){ $msl = new RevSliderSlide(); if(strpos($staticID, 'static_') === false){ $staticID = 'static_'.$slider->getID(); } $msl->initByID($staticID); if($msl->getID() !== ''){ $slides = array_merge($slides, array($msl)); } } if(!empty($slides) && is_array($slides)){ foreach($slides as $slide){ $layers = $slide->getLayers(); if(!empty($layers) && is_array($layers)){ $do_save = false; foreach($layers as $lk => $layer){ $link_slide = RevSliderFunctions::getVal($layer, 'link_slide', false); if($link_slide != false && $link_slide !== 'nothing'){ //link to slide/scrollunder is set, move it to actions $layers[$lk]['layer_action'] = new stdClass(); switch($link_slide){ case 'link': $link = RevSliderFunctions::getVal($layer, 'link'); $link_open_in = RevSliderFunctions::getVal($layer, 'link_open_in'); $layers[$lk]['layer_action']->action = array('a' => 'link'); $layers[$lk]['layer_action']->link_type = array('a' => 'a'); $layers[$lk]['layer_action']->image_link = array('a' => $link); $layers[$lk]['layer_action']->link_open_in = array('a' => $link_open_in); unset($layers[$lk]['link']); unset($layers[$lk]['link_open_in']); case 'next': $layers[$lk]['layer_action']->action = array('a' => 'next'); break; case 'prev': $layers[$lk]['layer_action']->action = array('a' => 'prev'); break; case 'scroll_under': $scrollunder_offset = RevSliderFunctions::getVal($layer, 'scrollunder_offset'); $layers[$lk]['layer_action']->action = array('a' => 'scroll_under'); $layers[$lk]['layer_action']->scrollunder_offset = array('a' => $scrollunder_offset); unset($layers[$lk]['scrollunder_offset']); break; default: //its an ID, so its a slide ID $layers[$lk]['layer_action']->action = array('a' => 'jumpto'); $layers[$lk]['layer_action']->jump_to_slide = array('a' => $link_slide); break; } $layers[$lk]['layer_action']->tooltip_event = array('a' => 'click'); unset($layers[$lk]['link_slide']); $do_save = true; } } if($do_save){ $slide->setLayersRaw($layers); $slide->saveLayers(); } } } } } } } /** * add missing new style fields to the layers as all layers would be broken without this * @since 5.0 */ public static function add_style_settings_to_layer($sliders = false){ $sr = new RevSlider(); $sl = new RevSliderSlide(); $operations = new RevSliderOperations(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } $styles = $operations->getCaptionsContentArray(); if(!empty($sliders) && is_array($sliders)){ foreach($sliders as $slider){ $slides = $slider->getSlides(); $staticID = $sl->getStaticSlideID($slider->getID()); if($staticID !== false){ $msl = new RevSliderSlide(); if(strpos($staticID, 'static_') === false){ $staticID = 'static_'.$slider->getID(); } $msl->initByID($staticID); if($msl->getID() !== ''){ $slides = array_merge($slides, array($msl)); } } if(!empty($slides) && is_array($slides)){ foreach($slides as $slide){ $layers = $slide->getLayers(); if(!empty($layers) && is_array($layers)){ foreach($layers as $lk => $layer){ $static_styles = (array) RevSliderFunctions::getVal($layer, 'static_styles', array()); $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array()); $defh_val = (array) RevSliderFunctions::getVal($layer, 'deformation-hover', array()); if(empty($def_val)){ //add parallax always! $def_val['parallax'] = RevSliderFunctions::getVal($layer, 'parallax_level', '-'); $layers[$lk]['deformation'] = $def_val; //check for selected style in styles, then add all deformations to the layer $cur_style = RevSliderFunctions::getVal($layer, 'style', ''); if(trim($cur_style) == '') continue; $wws = false; foreach($styles as $style){ if($style['handle'] == '.tp-caption.'.$cur_style){ $wws = $style; break; } } if($wws == false) continue; $css_idle = ''; $css_hover = ''; $wws['params'] = (array)$wws['params']; $wws['hover'] = (array)$wws['hover']; $wws['advanced'] = (array)$wws['advanced']; if(isset($wws['params']['font-family'])) $def_val['font-family'] = $wws['params']['font-family']; if(isset($wws['params']['padding'])){ $raw_pad = $wws['params']['padding']; if(!is_array($raw_pad)) $raw_pad = explode(' ', $raw_pad); switch(count($raw_pad)){ case 1: $raw_pad = array($raw_pad[0], $raw_pad[0], $raw_pad[0], $raw_pad[0]); break; case 2: $raw_pad = array($raw_pad[0], $raw_pad[1], $raw_pad[0], $raw_pad[1]); break; case 3: $raw_pad = array($raw_pad[0], $raw_pad[1], $raw_pad[2], $raw_pad[1]); break; } $def_val['padding'] = $raw_pad; } if(isset($wws['params']['font-style'])) $def_val['font-style'] = $wws['params']['font-style']; if(isset($wws['params']['text-decoration'])) $def_val['text-decoration'] = $wws['params']['text-decoration']; if(isset($wws['params']['background-color'])){ if(RevSliderFunctions::isrgb($wws['params']['background-color'])){ $def_val['background-color'] = RevSliderFunctions::rgba2hex($wws['params']['background-color']); }else{ $def_val['background-color'] = $wws['params']['background-color']; } } if(isset($wws['params']['background-transparency'])){ $def_val['background-transparency'] = $wws['params']['background-transparency']; if($def_val['background-transparency'] > 1) $def_val['background-transparency'] /= 100; }else{ if(isset($wws['params']['background-color'])) $def_val['background-transparency'] = RevSliderFunctions::get_trans_from_rgba($wws['params']['background-color'], true); } if(isset($wws['params']['border-color'])){ if(RevSliderFunctions::isrgb($wws['params']['border-color'])){ $def_val['border-color'] = RevSliderFunctions::rgba2hex($wws['params']['border-color']); }else{ $def_val['border-color'] = $wws['params']['border-color']; } } if(isset($wws['params']['border-style'])) $def_val['border-style'] = $wws['params']['border-style']; if(isset($wws['params']['border-width'])) $def_val['border-width'] = $wws['params']['border-width']; if(isset($wws['params']['border-radius'])){ $raw_bor = $wws['params']['border-radius']; if(!is_array($raw_bor)) $raw_bor = explode(' ', $raw_bor); switch(count($raw_bor)){ case 1: $raw_bor = array($raw_bor[0], $raw_bor[0], $raw_bor[0], $raw_bor[0]); break; case 2: $raw_bor = array($raw_bor[0], $raw_bor[1], $raw_bor[0], $raw_bor[1]); break; case 3: $raw_bor = array($raw_bor[0], $raw_bor[1], $raw_bor[2], $raw_bor[1]); break; } $def_val['border-radius'] = $raw_bor; } if(isset($wws['params']['x'])) $def_val['x'] = $wws['params']['x']; if(isset($wws['params']['y'])) $def_val['y'] = $wws['params']['y']; if(isset($wws['params']['z'])) $def_val['z'] = $wws['params']['z']; if(isset($wws['params']['skewx'])) $def_val['skewx'] = $wws['params']['skewx']; if(isset($wws['params']['skewy'])) $def_val['skewy'] = $wws['params']['skewy']; if(isset($wws['params']['scalex'])) $def_val['scalex'] = $wws['params']['scalex']; if(isset($wws['params']['scaley'])) $def_val['scaley'] = $wws['params']['scaley']; if(isset($wws['params']['opacity'])) $def_val['opacity'] = $wws['params']['opacity']; if(isset($wws['params']['xrotate'])) $def_val['xrotate'] = $wws['params']['xrotate']; if(isset($wws['params']['yrotate'])) $def_val['yrotate'] = $wws['params']['yrotate']; if(isset($wws['params']['2d_rotation'])) $def_val['2d_rotation'] = $wws['params']['2d_rotation']; if(isset($wws['params']['2d_origin_x'])) $def_val['2d_origin_x'] = $wws['params']['2d_origin_x']; if(isset($wws['params']['2d_origin_y'])) $def_val['2d_origin_y'] = $wws['params']['2d_origin_y']; if(isset($wws['params']['pers'])) $def_val['pers'] = $wws['params']['pers']; if(isset($wws['params']['color'])){ if(RevSliderFunctions::isrgb($wws['params']['color'])){ $static_styles['color'] = RevSliderFunctions::rgba2hex($wws['params']['color']); }else{ $static_styles['color'] = $wws['params']['color']; } } if(isset($wws['params']['font-weight'])) $static_styles['font-weight'] = $wws['params']['font-weight']; if(isset($wws['params']['font-size'])) $static_styles['font-size'] = $wws['params']['font-size']; if(isset($wws['params']['line-height'])) $static_styles['line-height'] = $wws['params']['line-height']; if(isset($wws['params']['font-family'])) $static_styles['font-family'] = $wws['params']['font-family']; if(isset($wws['advanced']) && isset($wws['advanced']['idle']) && is_array($wws['advanced']['idle']) && !empty($wws['advanced']['idle'])){ $css_idle = '{'."\n"; foreach($wws['advanced']['idle'] as $handle => $value){ $value = implode(' ', $value); if($value !== '') $css_idle .= ' '.$key.': '.$value.';'."\n"; } $css_idle .= '}'."\n"; } if(isset($wws['hover']['color'])){ if(RevSliderFunctions::isrgb($wws['hover']['color'])){ $defh_val['color'] = RevSliderFunctions::rgba2hex($wws['hover']['color']); }else{ $defh_val['color'] = $wws['hover']['color']; } } if(isset($wws['hover']['text-decoration'])) $defh_val['text-decoration'] = $wws['hover']['text-decoration']; if(isset($wws['hover']['background-color'])){ if(RevSliderFunctions::isrgb($wws['hover']['background-color'])){ $defh_val['background-color'] = RevSliderFunctions::rgba2hex($wws['hover']['background-color']); }else{ $defh_val['background-color'] = $wws['hover']['background-color']; } } if(isset($wws['hover']['background-transparency'])){ $defh_val['background-transparency'] = $wws['hover']['background-transparency']; if($defh_val['background-transparency'] > 1) $defh_val['background-transparency'] /= 100; }else{ if(isset($wws['hover']['background-color'])) $defh_val['background-transparency'] = RevSliderFunctions::get_trans_from_rgba($wws['hover']['background-color'], true); } if(isset($wws['hover']['border-color'])){ if(RevSliderFunctions::isrgb($wws['hover']['border-color'])){ $defh_val['border-color'] = RevSliderFunctions::rgba2hex($wws['hover']['border-color']); }else{ $defh_val['border-color'] = $wws['hover']['border-color']; } } if(isset($wws['hover']['border-style'])) $defh_val['border-style'] = $wws['hover']['border-style']; if(isset($wws['hover']['border-width'])) $defh_val['border-width'] = $wws['hover']['border-width']; if(isset($wws['hover']['border-radius'])){ $raw_bor = $wws['hover']['border-radius']; if(!is_array($raw_bor)) $raw_bor = explode(' ', $raw_bor); switch(count($raw_bor)){ case 1: $raw_bor = array($raw_bor[0], $raw_bor[0], $raw_bor[0], $raw_bor[0]); break; case 2: $raw_bor = array($raw_bor[0], $raw_bor[1], $raw_bor[0], $raw_bor[1]); break; case 3: $raw_bor = array($raw_bor[0], $raw_bor[1], $raw_bor[2], $raw_bor[1]); break; } $defh_val['border-radius'] = $raw_bor; } if(isset($wws['hover']['x'])) $defh_val['x'] = $wws['hover']['x']; if(isset($wws['hover']['y'])) $defh_val['y'] = $wws['hover']['y']; if(isset($wws['hover']['z'])) $defh_val['z'] = $wws['hover']['z']; if(isset($wws['hover']['skewx'])) $defh_val['skewx'] = $wws['hover']['skewx']; if(isset($wws['hover']['skewy'])) $defh_val['skewy'] = $wws['hover']['skewy']; if(isset($wws['hover']['scalex'])) $defh_val['scalex'] = $wws['hover']['scalex']; if(isset($wws['hover']['scaley'])) $defh_val['scaley'] = $wws['hover']['scaley']; if(isset($wws['hover']['opacity'])) $defh_val['opacity'] = $wws['hover']['opacity']; if(isset($wws['hover']['xrotate'])) $defh_val['xrotate'] = $wws['hover']['xrotate']; if(isset($wws['hover']['yrotate'])) $defh_val['yrotate'] = $wws['hover']['yrotate']; if(isset($wws['hover']['2d_rotation'])) $defh_val['2d_rotation'] = $wws['hover']['2d_rotation']; if(isset($wws['hover']['2d_origin_x'])) $defh_val['2d_origin_x'] = $wws['hover']['2d_origin_x']; if(isset($wws['hover']['2d_origin_y'])) $defh_val['2d_origin_y'] = $wws['hover']['2d_origin_y']; if(isset($wws['hover']['speed'])) $defh_val['speed'] = $wws['hover']['speed']; if(isset($wws['hover']['easing'])) $defh_val['easing'] = $wws['hover']['easing']; if(isset($wws['advanced']) && isset($wws['advanced']['hover']) && is_array($wws['advanced']['hover']) && !empty($wws['advanced']['hover'])){ $css_hover = '{'."\n"; foreach($wws['advanced']['hover'] as $handle => $value){ $value = implode(' ', $value); if($value !== '') $css_hover .= ' '.$key.': '.$value.';'."\n"; } $css_hover .= '}'."\n"; } if(!isset($layers[$lk]['inline'])) $layers[$lk]['inline'] = array(); if($css_idle !== ''){ $layers[$lk]['inline']['idle'] = $css_idle; } if($css_hover !== ''){ $layers[$lk]['inline']['idle'] = $css_hover; } $layers[$lk]['deformation'] = $def_val; $layers[$lk]['deformation-hover'] = $defh_val; $layers[$lk]['static_styles'] = $static_styles; } } $slide->setLayersRaw($layers); $slide->saveLayers(); } } } } } } /** * add settings to layer depending on how * @since 5.0 */ public static function add_general_settings($sliders = false){ $sr = new RevSlider(); $sl = new RevSliderSlide(); //$operations = new RevSliderOperations(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } //$styles = $operations->getCaptionsContentArray(); if(!empty($sliders) && is_array($sliders)){ $fonts = get_option('tp-google-fonts', array()); foreach($sliders as $slider){ $settings = $slider->getSettings(); $bg_freeze = $slider->getParam('parallax_bg_freeze', 'off'); $google_fonts = $slider->getParam('google_font', array()); if(!isset($settings['version']) || version_compare($settings['version'], 5.0, '<')){ if(empty($google_fonts) && !empty($fonts)){ //add all punchfonts to the Slider foreach($fonts as $font){ $google_fonts[] = $font['url']; } $slider->updateParam(array('google_font' => $google_fonts)); } $settings['version'] = 5.0; $slider->updateSetting(array('version' => 5.0)); } if($bg_freeze == 'on'){ //deprecated here, moved to slides so remove check here and add on to slides $slider->updateParam(array('parallax_bg_freeze' => 'off')); } $slides = $slider->getSlides(); $staticID = $sl->getStaticSlideID($slider->getID()); if($staticID !== false){ $msl = new RevSliderSlide(); if(strpos($staticID, 'static_') === false){ $staticID = 'static_'.$slider->getID(); } $msl->initByID($staticID); if($msl->getID() !== ''){ $slides = array_merge($slides, array($msl)); } } if(!empty($slides) && is_array($slides)){ foreach($slides as $slide){ if($bg_freeze == 'on'){ //set bg_freeze to on for slide settings $slide->setParam('slide_parallax_level', '1'); } $slide->saveParams(); } } } } } /** * remove static slide from Sliders if the setting was set to off * @since 5.0 */ public static function remove_static_slides($sliders = false){ $sr = new RevSlider(); $sl = new RevSliderSlide(); //$operations = new RevSliderOperations(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } //$styles = $operations->getCaptionsContentArray(); if(!empty($sliders) && is_array($sliders)){ foreach($sliders as $slider){ $settings = $slider->getSettings(); $enable_static_layers = $slider->getParam('enable_static_layers', 'off'); if($enable_static_layers == 'off'){ $staticID = $sl->getStaticSlideID($slider->getID()); if($staticID !== false){ $slider->deleteStaticSlide(); } } } } } /** * change general settings of all sliders to 5.0.7 * @since 5.0.7 */ public static function change_general_settings_5_0_7($sliders = false){ //handle the new option for shuffle in combination with first alternative slide $sr = new RevSlider(); $sl = new RevSliderSlide(); //$operations = new RevSliderOperations(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } if(!empty($sliders) && is_array($sliders)){ foreach($sliders as $slider){ $settings = $slider->getSettings(); if(!isset($settings['version']) || version_compare($settings['version'], '5.0.7', '<')){ $start_with_slide = $slider->getParam('start_with_slide', '1'); if($start_with_slide !== '1'){ $slider->updateParam(array('start_with_slide_enable' => 'on')); } $settings['version'] = '5.0.7'; $slider->updateSetting(array('version' => '5.0.7')); } } } } /** * change image id of all slides to 5.1.1 * @since 5.1.1 */ public static function change_slide_settings_5_1_1($sliders = false){ $sr = new RevSlider(); $sl = new RevSliderSlide(); //$operations = new RevSliderOperations(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } if(!empty($sliders) && is_array($sliders)){ foreach($sliders as $slider){ $slides = $slider->getSlides(); $staticID = $sl->getStaticSlideID($slider->getID()); if($staticID !== false){ $msl = new RevSliderSlide(); if(strpos($staticID, 'static_') === false){ $staticID = 'static_'.$slider->getID(); } $msl->initByID($staticID); if($msl->getID() !== ''){ $slides = array_merge($slides, array($msl)); } } if(!empty($slides) && is_array($slides)){ foreach($slides as $slide){ //get image url, then get the image id and save it in image_id $image_id = $slide->getParam('image_id', ''); $image = $slide->getParam('image', ''); $ml_id = ''; if($image !== ''){ $ml_id = RevSliderFunctionsWP::get_image_id_by_url($image); } if($image == '' && $image_id == '') continue; //if we are a video and have no cover image, do nothing if($ml_id !== false && $ml_id !== $image_id){ $urlImage = wp_get_attachment_image_src($ml_id, 'full'); $slide->setParam('image_id', $ml_id); $slide->saveParams(); } } } } } } /** * change svg path of all layers from the upload folder if 5.2.5.3+ was installed * @since 5.2.5.5 */ public static function change_layers_svg_5_2_5_5($sliders = false){ $sr = new RevSlider(); $sl = new RevSliderSlide(); $upload_dir = wp_upload_dir(); $path = $upload_dir['baseurl'].'/revslider/assets/svg/'; //$operations = new RevSliderOperations(); if($sliders === false){ //do it on all Sliders $sliders = $sr->getArrSliders(false); }else{ $sliders = array($sliders); } if(!empty($sliders) && is_array($sliders)){ foreach($sliders as $slider){ $slides = $slider->getSlides(); $staticID = $sl->getStaticSlideID($slider->getID()); if($staticID !== false){ $msl = new RevSliderSlide(); if(strpos($staticID, 'static_') === false){ $staticID = 'static_'.$slider->getID(); } $msl->initByID($staticID); if($msl->getID() !== ''){ $slides = array_merge($slides, array($msl)); } } if(!empty($slides) && is_array($slides)){ foreach($slides as $slide){ $layers = $slide->getLayers(); if(!empty($layers) && is_array($layers)){ foreach($layers as $lk => $layer){ if(isset($layer['type']) && $layer['type'] == 'svg'){ if(isset($layer['svg']) && isset($layer['svg']->src)){ //change newer path to older path if(strpos($layers[$lk]['svg']->src, $path) !== false){ $layers[$lk]['svg']->src = str_replace($path, RS_PLUGIN_URL . 'public/assets/assets/svg/', $layers[$lk]['svg']->src); } } } } $slide->setLayersRaw($layers); $slide->saveLayers(); } } } } } } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UnitePluginUpdateRev extends RevSliderPluginUpdate {} ?>functions-wordpress.class.php000066600000070515152141733250012436 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderFunctionsWP { public static $urlSite; public static $urlAdmin; const SORTBY_NONE = "none"; const SORTBY_ID = "ID"; const SORTBY_AUTHOR = "author"; const SORTBY_TITLE = "title"; const SORTBY_SLUG = "name"; const SORTBY_DATE = "date"; const SORTBY_LAST_MODIFIED = "modified"; const SORTBY_RAND = "rand"; const SORTBY_COMMENT_COUNT = "comment_count"; const SORTBY_MENU_ORDER = "menu_order"; const ORDER_DIRECTION_ASC = "ASC"; const ORDER_DIRECTION_DESC = "DESC"; const THUMB_SMALL = "thumbnail"; const THUMB_MEDIUM = "medium"; const THUMB_LARGE = "large"; const THUMB_FULL = "full"; const STATE_PUBLISHED = "publish"; const STATE_DRAFT = "draft"; /** * * init the static variables */ public static function initStaticVars(){ self::$urlAdmin = admin_url(); if(substr(self::$urlAdmin, -1) != "/") self::$urlAdmin .= "/"; } /** * * get sort by with the names */ public static function getArrSortBy(){ $arr = array(); $arr[self::SORTBY_ID] = "Post ID"; $arr[self::SORTBY_DATE] = "Date"; $arr[self::SORTBY_TITLE] = "Title"; $arr[self::SORTBY_SLUG] = "Slug"; $arr[self::SORTBY_AUTHOR] = "Author"; $arr[self::SORTBY_LAST_MODIFIED] = "Last Modified"; $arr[self::SORTBY_COMMENT_COUNT] = "Number Of Comments"; $arr[self::SORTBY_RAND] = "Random"; $arr[self::SORTBY_NONE] = "Unsorted"; $arr[self::SORTBY_MENU_ORDER] = "Custom Order"; return($arr); } /** * * get array of sort direction */ public static function getArrSortDirection(){ $arr = array(); $arr[self::ORDER_DIRECTION_DESC] = "Descending"; $arr[self::ORDER_DIRECTION_ASC] = "Ascending"; return($arr); } /** * get blog id */ public static function getBlogID(){ global $blog_id; return($blog_id); } /** * * get blog id */ public static function isMultisite(){ $isMultisite = is_multisite(); return($isMultisite); } /** * * check if some db table exists */ public static function isDBTableExists($tableName){ global $wpdb; if(empty($tableName)) RevSliderFunctions::throwError("Empty table name!!!"); $sql = "show tables like '$tableName'"; $table = $wpdb->get_var($sql); if($table == $tableName) return(true); return(false); } /** * * get wordpress base path */ public static function getPathBase(){ return ABSPATH; } /** * * get wp-content path */ public static function getPathUploads(){ global $wpdb; if(self::isMultisite()){ if(!defined("BLOGUPLOADDIR")){ $pathBase = self::getPathBase(); //$pathContent = $pathBase."wp-content/uploads/"; $pathContent = $pathBase."wp-content/uploads/sites/{$wpdb->blogid}/"; }else $pathContent = BLOGUPLOADDIR; }else{ $pathContent = WP_CONTENT_DIR; if(!empty($pathContent)){ $pathContent .= "/"; } else{ $pathBase = self::getPathBase(); $pathContent = $pathBase."wp-content/uploads/"; } } return($pathContent); } /** * * get content url */ public static function getUrlUploads(){ if(self::isMultisite() == false){ //without multisite $baseUrl = content_url()."/"; } else{ //for multisite $arrUploadData = wp_upload_dir(); $baseUrl = $arrUploadData["baseurl"]."/"; } return($baseUrl); } /** * Check if current user is administrator **/ public static function isAdminUser(){ return current_user_can('administrator'); } /* Import media from url * * @param string $file_url URL of the existing file from the original site * @param int $folder_name The slidername will be used as folder name in import * * @return boolean True on success, false on failure */ public static function import_media($file_url, $folder_name) { require_once(ABSPATH . 'wp-admin/includes/image.php'); $ul_dir = wp_upload_dir(); $artDir = 'revslider/'; //if the directory doesn't exist, create it if(!file_exists($ul_dir['basedir'].'/'.$artDir)) mkdir($ul_dir['basedir'].'/'.$artDir); if(!file_exists($ul_dir['basedir'].'/'.$artDir.$folder_name)) mkdir($ul_dir['basedir'].'/'.$artDir.$folder_name); //rename the file... alternatively, you could explode on "/" and keep the original file name $filename = basename($file_url); //$siteurl = get_option('siteurl'); if(@fclose(@fopen($file_url, "r"))){ //make sure the file actually exists $saveDir = $ul_dir['basedir'].'/'.$artDir.$folder_name.$filename; $atc_id = self::get_image_id_by_url($artDir.$folder_name.$filename); if($atc_id == false || $atc_id == NULL){ copy($file_url, $saveDir); $file_info = getimagesize($saveDir); //create an array of attachment data to insert into wp_posts table $artdata = array( 'post_author' => 1, 'post_date' => current_time('mysql'), 'post_date_gmt' => current_time('mysql'), 'post_title' => $filename, 'post_status' => 'inherit', 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_name' => sanitize_title_with_dashes(str_replace("_", "-", $filename)), 'post_modified' => current_time('mysql'), 'post_modified_gmt' => current_time('mysql'), 'post_parent' => '', 'post_type' => 'attachment', 'guid' => $ul_dir['baseurl'].'/'.$artDir.$folder_name.$filename, 'post_mime_type' => $file_info['mime'], 'post_excerpt' => '', 'post_content' => '' ); //insert the database record $attach_id = wp_insert_attachment($artdata, $artDir.$folder_name.$filename); }else{ $attach_id = $atc_id; } //generate metadata and thumbnails if($attach_data = wp_generate_attachment_metadata($attach_id, $saveDir)) wp_update_attachment_metadata($attach_id, $attach_data); if(!self::isMultisite()) $artDir = 'uploads/'.$artDir; return array("id" => $attach_id, "path" => $artDir.$folder_name.$filename); }else{ return false; } } /** * * register widget (must be class) */ public static function registerWidget($widgetName){ add_action('widgets_init', create_function('', 'return register_widget("'.$widgetName.'");')); } /** * get image relative path from image url (from upload) */ public static function getImagePathFromURL($urlImage){ $baseUrl = self::getUrlUploads(); $pathImage = str_replace($baseUrl, "", $urlImage); return($pathImage); } /** * get image real path physical on disk from url */ public static function getImageRealPathFromUrl($urlImage){ $filepath = self::getImagePathFromURL($urlImage); $realPath = RevSliderFunctionsWP::getPathUploads().$filepath; return($realPath); } /** * * get image url from image path. */ public static function getImageUrlFromPath($pathImage){ //protect from absolute url $pathLower = strtolower($pathImage); if(strpos($pathLower, "http://") !== false || strpos($pathLower, "https://") !== false || strpos($pathLower, "www.") === 0) return($pathImage); $urlImage = self::getUrlUploads().$pathImage; return($urlImage); } /** * * get post categories list assoc - id / title */ public static function getCategoriesAssoc($taxonomy = "category"){ if(strpos($taxonomy,",") !== false){ $arrTax = explode(",", $taxonomy); $arrCats = array(); foreach($arrTax as $tax){ $cats = self::getCategoriesAssoc($tax); $arrCats = array_merge($arrCats,$cats); } return($arrCats); } //$cats = get_terms("category"); $args = array("taxonomy"=>$taxonomy); $cats = get_categories($args); $arrCats = array(); foreach($cats as $cat){ $numItems = $cat->count; $itemsName = "items"; if($numItems == 1) $itemsName = "item"; $title = $cat->name . " ($numItems $itemsName)"; $id = $cat->cat_ID; $arrCats[$id] = $title; } return($arrCats); } /** * * return post type title from the post type */ public static function getPostTypeTitle($postType){ $objType = get_post_type_object($postType); if(empty($objType)) return($postType); $title = $objType->labels->singular_name; return($title); } /** * * get post type taxomonies */ public static function getPostTypeTaxomonies($postType){ $arrTaxonomies = get_object_taxonomies(array( 'post_type' => $postType ), 'objects'); $arrNames = array(); foreach($arrTaxonomies as $key=>$objTax){ $arrNames[$objTax->name] = $objTax->labels->name; } return($arrNames); } /** * * get post types taxonomies as string */ public static function getPostTypeTaxonomiesString($postType){ $arrTax = self::getPostTypeTaxomonies($postType); $strTax = ""; foreach($arrTax as $name=>$title){ if(!empty($strTax)) $strTax .= ","; $strTax .= $name; } return($strTax); } /** * * get all the post types including custom ones * the put to top items will be always in top (they must be in the list) */ public static function getPostTypesAssoc($arrPutToTop = array()){ $arrBuiltIn = array( "post"=>"post", "page"=>"page", ); $arrCustomTypes = get_post_types(array('_builtin' => false)); //top items validation - add only items that in the customtypes list $arrPutToTopUpdated = array(); foreach($arrPutToTop as $topItem){ if(in_array($topItem, $arrCustomTypes) == true){ $arrPutToTopUpdated[$topItem] = $topItem; unset($arrCustomTypes[$topItem]); } } $arrPostTypes = array_merge($arrPutToTopUpdated,$arrBuiltIn,$arrCustomTypes); //update label foreach($arrPostTypes as $key=>$type){ $arrPostTypes[$key] = self::getPostTypeTitle($type); } return($arrPostTypes); } /** * * get the category data */ public static function getCategoryData($catID){ $catData = get_category($catID); if(empty($catData)) return($catData); $catData = (array)$catData; return($catData); } /** * * get posts by coma saparated posts */ public static function getPostsByIDs($strIDs, $slider_id, $is_gal, $additional = array()){ if(is_string($strIDs)){ $arr = explode(",",$strIDs); }else{ $arr = $strIDs; } $query = array( 'post_type'=>"any", 'ignore_sticky_posts' => 1, 'post__in' => $arr ); if($is_gal){ $query['post_status'] = 'inherit'; $query['orderby'] = 'post__in'; } $query = array_merge($query, $additional); $query = apply_filters('revslider_get_posts', $query, $slider_id); $objQuery = new WP_Query($query); $arrPosts = $objQuery->posts; //dmp($query);dmp("num posts: ".count($arrPosts));exit(); foreach($arrPosts as $key=>$post){ if(method_exists($post, "to_array")) $arrPosts[$key] = $post->to_array(); else $arrPosts[$key] = (array)$post; } return($arrPosts); } /** * * get posts by some category * could be multiple */ public static function getPostsByCategory($slider_id,$catID,$sortBy = self::SORTBY_ID,$direction = self::ORDER_DIRECTION_DESC,$numPosts=-1,$postTypes="any",$taxonomies="category",$arrAddition = array()){ //get post types if(strpos($postTypes,",") !== false){ $postTypes = explode(",", $postTypes); if(array_search("any", $postTypes) !== false) $postTypes = "any"; } if(empty($postTypes)) $postTypes = "any"; if(strpos($catID,",") !== false) $catID = explode(",",$catID); else $catID = array($catID); if(RevSliderWpml::isWpmlExists()){ //translate categories to languages $newcat = array(); foreach($catID as $id){ //$newcat[] = icl_object_id($id, 'category', true); $newcat[] = apply_filters( 'wpml_object_id', $id, 'category', true ); } $catID = $newcat; } $query = array( 'order'=>$direction, 'ignore_sticky_posts' => 1, 'posts_per_page'=>$numPosts, 'showposts'=>$numPosts, 'post_type'=>$postTypes ); //add sort by (could be by meta) if(strpos($sortBy, "meta_num_") === 0){ $metaKey = str_replace("meta_num_", "", $sortBy); $query["orderby"] = "meta_value_num"; $query["meta_key"] = $metaKey; }else if(strpos($sortBy, "meta_") === 0){ $metaKey = str_replace("meta_", "", $sortBy); $query["orderby"] = "meta_value"; $query["meta_key"] = $metaKey; }else $query["orderby"] = $sortBy; //get taxonomies array $arrTax = array(); if(!empty($taxonomies)){ $arrTax = explode(",", $taxonomies); } if(!empty($taxonomies)){ $taxQuery = array(); //add taxomonies to the query if(strpos($taxonomies,",") !== false){ //multiple taxomonies $taxonomies = explode(",",$taxonomies); foreach($taxonomies as $taxomony){ $taxArray = array( 'taxonomy' => $taxomony, 'field' => 'id', 'terms' => $catID ); $taxQuery[] = $taxArray; } }else{ //single taxomony $taxArray = array( 'taxonomy' => $taxonomies, 'field' => 'id', 'terms' => $catID ); $taxQuery[] = $taxArray; } $taxQuery['relation'] = 'OR'; $query['tax_query'] = $taxQuery; } //if exists taxanomies if(!empty($arrAddition)) $query = array_merge($query, $arrAddition); $query = apply_filters('revslider_get_posts', $query, $slider_id); $objQuery = new WP_Query($query); $arrPosts = $objQuery->posts; foreach($arrPosts as $key=>$post){ if(method_exists($post, "to_array")) $arrPost = $post->to_array(); else $arrPost = (array)$post; $arrPostCats = self::getPostCategories($post, $arrTax); $arrPost["categories"] = $arrPostCats; $arrPosts[$key] = $arrPost; } return($arrPosts); } /** * * get post categories by postID and taxonomies * the postID can be post object or array too */ public static function getPostCategories($postID,$arrTax){ if(!is_numeric($postID)){ $postID = (array)$postID; $postID = $postID["ID"]; } $arrCats = wp_get_post_terms( $postID, $arrTax); $arrCats = RevSliderFunctions::convertStdClassToArray($arrCats); return($arrCats); } /** * * get single post */ public static function getPost($postID){ $post = get_post($postID); if(empty($post)) RevSliderFunctions::throwError("Post with id: $postID not found"); $arrPost = $post->to_array(); return($arrPost); } /** * * update post state */ public static function updatePostState($postID,$state){ $arrUpdate = array(); $arrUpdate["ID"] = $postID; $arrUpdate["post_status"] = $state; wp_update_post($arrUpdate); } /** * * update post menu order */ public static function updatePostOrder($postID,$order){ $arrUpdate = array(); $arrUpdate["ID"] = $postID; $arrUpdate["menu_order"] = $order; wp_update_post($arrUpdate); } /** * * get url of post thumbnail */ public static function getUrlPostImage($postID,$size = self::THUMB_FULL){ $post_thumbnail_id = get_post_thumbnail_id( $postID ); if(empty($post_thumbnail_id)) return(""); $arrImage = wp_get_attachment_image_src($post_thumbnail_id,$size); if(empty($arrImage)) return(""); $urlImage = $arrImage[0]; return($urlImage); } /** * * get post thumb id from post id */ public static function getPostThumbID($postID){ $thumbID = get_post_thumbnail_id( $postID ); return($thumbID); } /** * * get attachment image array by id and size */ public static function getAttachmentImage($thumbID,$size = self::THUMB_FULL){ $arrImage = wp_get_attachment_image_src($thumbID,$size); if(empty($arrImage)) return(false); $output = array(); $output["url"] = RevSliderFunctions::getVal($arrImage, 0); $output["width"] = RevSliderFunctions::getVal($arrImage, 1); $output["height"] = RevSliderFunctions::getVal($arrImage, 2); return($output); } /** * * get attachment image url */ public static function getUrlAttachmentImage($thumbID,$size = self::THUMB_FULL){ $arrImage = wp_get_attachment_image_src($thumbID,$size); if(empty($arrImage)) return(false); $url = RevSliderFunctions::getVal($arrImage, 0); return($url); } /** * * get link of edit slides by category id */ public static function getUrlSlidesEditByCatID($catID){ $url = self::$urlAdmin; $url .= "edit.php?s&post_status=all&post_type=post&action=-1&m=0&cat=".$catID."&paged=1&mode=list&action2=-1"; return($url); } /** * * get edit post url */ public static function getUrlEditPost($postID){ $url = self::$urlAdmin; $url .= "post.php?post=".$postID."&action=edit"; return($url); } /** * * get new post url */ public static function getUrlNewPost(){ $url = self::$urlAdmin; $url .= "post-new.php"; return($url); } /** * * delete post */ public static function deletePost($postID){ $success = wp_delete_post($postID,false); if($success == false) RevSliderFunctions::throwError("Could not delete post: $postID"); } /** * * update post thumbnail */ public static function updatePostThumbnail($postID,$thumbID){ set_post_thumbnail($postID, $thumbID); } /** * * get intro from content */ public static function getIntroFromContent($text){ $intro = ""; if(!empty($text)){ $arrExtended = get_extended($text); $intro = RevSliderFunctions::getVal($arrExtended, "main"); /* if(strlen($text) != strlen($intro)) $intro .= "..."; */ } return($intro); } /** * * get excerpt from post id */ public static function getExcerptById($postID, $limit=55){ $post = get_post($postID); $excerpt = $post->post_excerpt; $excerpt = trim($excerpt); $excerpt = trim($excerpt); if(empty($excerpt)) $excerpt = $post->post_content; $excerpt = strip_tags($excerpt,"

    "); $excerpt = RevSliderFunctions::getTextIntro($excerpt, $limit); return apply_filters('revslider_getExcerptById', $excerpt, $post, $limit); } /** * * get user display name from user id */ public static function getUserDisplayName($userID){ $displayName = get_the_author_meta('display_name', $userID); return($displayName); } /** * * get categories by id's */ public static function getCategoriesByIDs($arrIDs,$strTax = null){ if(empty($arrIDs)) return(array()); if(is_string($arrIDs)) $strIDs = $arrIDs; else $strIDs = implode(",", $arrIDs); $args = array(); $args["include"] = $strIDs; if(!empty($strTax)){ if(is_string($strTax)) $strTax = explode(",",$strTax); $args["taxonomy"] = $strTax; } $arrCats = get_categories( $args ); if(!empty($arrCats)) $arrCats = RevSliderFunctions::convertStdClassToArray($arrCats); return($arrCats); } /** * * get categories short */ public static function getCategoriesByIDsShort($arrIDs,$strTax = null){ $arrCats = self::getCategoriesByIDs($arrIDs,$strTax); $arrNew = array(); foreach($arrCats as $cat){ $catID = $cat["term_id"]; $catName = $cat["name"]; $arrNew[$catID] = $catName; } return($arrNew); } /** * get categories list, copy the code from default wp functions */ public static function getCategoriesHtmlList($catIDs,$strTax = null){ global $wp_rewrite; //$catList = get_the_category_list( ",", "", $postID ); $categories = self::getCategoriesByIDs($catIDs,$strTax); $arrErrors = RevSliderFunctions::getVal($categories, "errors"); if(!empty($arrErrors)){ foreach($arrErrors as $key=>$arr){ $strErrors = implode($arr,","); } RevSliderFunctions::throwError("getCategoriesHtmlList error: ".$strErrors); } $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"'; $separator = ','; $thelist = ''; $i = 0; foreach ( $categories as $category ) { if(is_object($category)) $category = (array)$category; if ( 0 < $i ) $thelist .= $separator; $catID = $category["term_id"]; $link = get_category_link($catID); $catName = $category["name"]; if(!empty($link)) $thelist .= '' . $catName.''; else $thelist .= $catName; ++$i; } return $thelist; } /** * * get post tags html list */ public static function getTagsHtmlList($postID){ $tagList = get_the_tag_list("",",","",$postID); return($tagList); } /** * * convert date to the date format that the user chose. */ public static function convertPostDate($date, $with_time = false){ if(empty($date)) return($date); if($with_time){ $date = date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($date)); }else{ $date = date_i18n(get_option('date_format'), strtotime($date)); } return($date); } /** * * get assoc list of the taxonomies */ public static function getTaxonomiesAssoc(){ $arr = get_taxonomies(); unset($arr["post_tag"]); unset($arr["nav_menu"]); unset($arr["link_category"]); unset($arr["post_format"]); return($arr); } /** * * get post types array with taxomonies */ public static function getPostTypesWithTaxomonies(){ $arrPostTypes = self::getPostTypesAssoc(); foreach($arrPostTypes as $postType=>$title){ $arrTaxomonies = self::getPostTypeTaxomonies($postType); $arrPostTypes[$postType] = $arrTaxomonies; } return($arrPostTypes); } /** * * get array of post types with categories (the taxonomies is between). * get only those taxomonies that have some categories in it. */ public static function getPostTypesWithCats(){ $arrPostTypes = self::getPostTypesWithTaxomonies(); $arrPostTypesOutput = array(); foreach($arrPostTypes as $name=>$arrTax){ $arrTaxOutput = array(); foreach($arrTax as $taxName=>$taxTitle){ $cats = self::getCategoriesAssoc($taxName); if(!empty($cats)) $arrTaxOutput[] = array( "name"=>$taxName, "title"=>$taxTitle, "cats"=>$cats); } $arrPostTypesOutput[$name] = $arrTaxOutput; } return($arrPostTypesOutput); } /** * * get array of all taxonomies with categories. */ public static function getTaxonomiesWithCats(){ $arrTax = self::getTaxonomiesAssoc(); $arrTaxNew = array(); foreach($arrTax as $key=>$value){ $arrItem = array(); $arrItem["name"] = $key; $arrItem["title"] = $value; $arrItem["cats"] = self::getCategoriesAssoc($key); $arrTaxNew[$key] = $arrItem; } return($arrTaxNew); } /** * * get content url */ public static function getUrlContent(){ if(self::isMultisite() == false){ //without multisite $baseUrl = content_url()."/"; } else{ //for multisite $arrUploadData = wp_upload_dir(); $baseUrl = $arrUploadData["baseurl"]."/"; } if(is_ssl()){ $baseUrl = str_replace("http://", "https://", $baseUrl); } return($baseUrl); } /** * * get wp-content path */ public static function getPathContent(){ if(self::isMultisite()){ if(!defined("BLOGUPLOADDIR")){ $pathBase = self::getPathBase(); $pathContent = $pathBase."wp-content/"; }else $pathContent = BLOGUPLOADDIR; }else{ $pathContent = WP_CONTENT_DIR; if(!empty($pathContent)){ $pathContent .= "/"; } else{ $pathBase = self::getPathBase(); $pathContent = $pathBase."wp-content/"; } } return($pathContent); } /** * * get cats and taxanomies data from the category id's */ public static function getCatAndTaxData($catIDs){ if(is_string($catIDs)){ $catIDs = trim($catIDs); if(empty($catIDs)) return(array("tax"=>"","cats"=>"")); $catIDs = explode(",", $catIDs); } $strCats = ""; $arrTax = array(); foreach($catIDs as $cat){ if(strpos($cat,"option_disabled") === 0) continue; $pos = strrpos($cat,"_"); if($pos === false) RevSliderFunctions::throwError("The category is in wrong format"); $taxName = substr($cat,0,$pos); $catID = substr($cat,$pos+1,strlen($cat)-$pos-1); $arrTax[$taxName] = $taxName; if(!empty($strCats)) $strCats .= ","; $strCats .= $catID; } $strTax = ""; foreach($arrTax as $taxName){ if(!empty($strTax)) $strTax .= ","; $strTax .= $taxName; } $output = array("tax"=>$strTax,"cats"=>$strCats); return($output); } /** * * get current language code */ public static function getCurrentLangCode(){ $langTag = ICL_LANGUAGE_CODE; return($langTag); } /** * * check the current post for the existence of a short code */ public static function hasShortcode($shortcode = '') { if(!is_singular()) return false; $post = get_post(get_the_ID()); $found = false; if (empty($shortcode)) return $found; if (stripos($post->post_content, '[' . $shortcode) !== false ) $found = true; return $found; } /** * Check if shortcodes exists in the content * @since: 5.0 */ public static function check_for_shortcodes($mid_content){ if($mid_content !== null){ if(has_shortcode($mid_content, 'gallery')){ preg_match('/\[gallery.*ids=.(.*).\]/', $mid_content, $img_ids); if(isset($img_ids[1])){ if($img_ids[1] !== '') return explode(',', $img_ids[1]); } } } return false; } /** * retrieve the image id from the given image url * @since: 5.0 */ public static function get_image_id_by_url($image_url) { global $wpdb; $attachment_id = 0; if(function_exists('attachment_url_to_postid')){ $attachment_id = attachment_url_to_postid($image_url); //0 if failed } if ( 0 == $attachment_id ){ //try to get it old school way //for WP < 4.0.0 $attachment_id = false; // If there is no url, return. if ( '' == $image_url ) return; // Get the upload directory paths $upload_dir_paths = wp_upload_dir(); // Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image if ( false !== strpos( $image_url, $upload_dir_paths['baseurl'] ) ) { // If this is the URL of an auto-generated thumbnail, get the URL of the original image $image_url = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $image_url ); // Remove the upload path base directory from the attachment URL $image_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $image_url ); // Finally, run a custom database query to get the attachment ID from the modified attachment URL $attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $image_url ) ); } } return $attachment_id; } public static function update_option($handle, $value, $autoload = 'on'){ //on is on, false is 'off' if(!add_option($handle, $value, '', $autoload)){ //returns false if option is not existing delete_option($handle); } add_option($handle, $value, '', $autoload); } } //end of the class //init the static vars RevSliderFunctionsWP::initStaticVars(); /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteFunctionsWPRev extends RevSliderFunctionsWP {} ?>update.class.php000066600000020215152141733250007652 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderUpdate { private $plugin_url = 'https://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380'; private $remote_url = 'https://updates.themepunch.tools/check_for_updates.php'; private $remote_url_info = 'https://updates.themepunch.tools/revslider/revslider.php'; private $remote_temp_active = 'https://updates.themepunch.tools/temp_activate.php'; private $plugin_slug = 'revslider'; private $plugin_path = 'revslider/revslider.php'; private $version; private $plugins; private $option; public function __construct($version) { $this->option = $this->plugin_slug . '_update_info'; $this->_retrieve_version_info(); $this->version = $version; } public function add_update_checks(){ add_filter('pre_set_site_transient_update_plugins', array(&$this, 'set_update_transient')); add_filter('plugins_api', array(&$this, 'set_updates_api_results'), 10, 3); } public function set_update_transient($transient) { $this->_check_updates(); if(isset($transient) && !isset($transient->response)) { $transient->response = array(); } if(!empty($this->data->basic) && is_object($this->data->basic)) { if(version_compare($this->version, $this->data->basic->version, '<')) { $this->data->basic->new_version = $this->data->basic->version; $transient->response[$this->plugin_path] = $this->data->basic; } } return $transient; } public function set_updates_api_results($result, $action, $args) { $this->_check_updates(); if(isset($args->slug) && $args->slug == $this->plugin_slug && $action == 'plugin_information') { if(is_object($this->data->full) && !empty($this->data->full)) { $result = $this->data->full; } } return $result; } protected function _check_updates() { //reset saved options //update_option($this->option, false); $force_check = false; if(isset($_GET['checkforupdates']) && $_GET['checkforupdates'] == 'true') $force_check = true; // Get data if(empty($this->data)) { $data = get_option($this->option, false); $data = $data ? $data : new stdClass; $this->data = is_object($data) ? $data : maybe_unserialize($data); } $last_check = get_option('revslider-update-check'); if($last_check == false){ //first time called $last_check = time(); update_option('revslider-update-check', $last_check); } // Check for updates if(time() - $last_check > 172800 || $force_check == true){ $data = $this->_retrieve_update_info(); if(isset($data->basic)) { update_option('revslider-update-check', time()); $this->data->checked = time(); $this->data->basic = $data->basic; $this->data->full = $data->full; update_option('revslider-stable-version', $data->full->stable); update_option('revslider-latest-version', $data->full->version); } } // Save results update_option($this->option, $this->data); } public function _retrieve_update_info() { global $wp_version; $data = new stdClass; // Build request $code = get_option('revslider-code', ''); $validated = get_option('revslider-valid', 'false'); $stable_version = get_option('revslider-stable-version', '4.2'); $rattr = array( 'code' => urlencode($code), 'version' => urlencode(RevSliderGlobals::SLIDER_REVISION) ); if($validated !== 'true' && version_compare(RevSliderGlobals::SLIDER_REVISION, $stable_version, '<')){ //We'll get the last stable only now! $rattr['get_stable'] = 'true'; } $request = wp_remote_post($this->remote_url_info, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'body' => $rattr )); if(!is_wp_error($request)) { if($response = maybe_unserialize($request['body'])) { if(is_object($response)) { $data = $response; $data->basic->url = $this->plugin_url; $data->full->url = $this->plugin_url; $data->full->external = 1; } } } return $data; } public function _retrieve_version_info($force_check = false) { global $wp_version; $last_check = get_option('revslider-update-check-short'); if($last_check == false){ //first time called $last_check = time(); update_option('revslider-update-check-short', $last_check); } // Check for updates if(time() - $last_check > 172800 || $force_check == true){ update_option('revslider-update-check-short', time()); $purchase = (get_option('revslider-valid', 'false') == 'true') ? get_option('revslider-code', '') : ''; $response = wp_remote_post($this->remote_url, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'body' => array( 'item' => urlencode('revslider'), 'version' => urlencode(RevSliderGlobals::SLIDER_REVISION), 'code' => urlencode($purchase) ) )); $response_code = wp_remote_retrieve_response_code( $response ); $version_info = wp_remote_retrieve_body( $response ); if ( $response_code != 200 || is_wp_error( $version_info ) ) { update_option('revslider-connection', false); return false; }else{ update_option('revslider-connection', true); } $version_info = json_decode($version_info); if(isset($version_info->version)){ update_option('revslider-latest-version', $version_info->version); } if(isset($version_info->stable)){ update_option('revslider-stable-version', $version_info->stable); } if(isset($version_info->notices)){ update_option('revslider-notices', $version_info->notices); } if(isset($version_info->dashboard)){ update_option('revslider-dashboard', $version_info->dashboard); } if(isset($version_info->addons)){ update_option('revslider-addons', $version_info->addons); } if(isset($version_info->deactivated) && $version_info->deactivated === true){ if(get_option('revslider-valid', 'false') == 'true'){ //remove validation, add notice update_option('revslider-valid', 'false'); update_option('revslider-deact-notice', true); } } } if($force_check == true){ //force that the update will be directly searched update_option('revslider-update-check', ''); } } public function add_temp_active_check($force = false){ global $wp_version; $last_check = get_option('revslider-activate-temp-short'); if($last_check == false){ //first time called $last_check = time(); update_option('revslider-activate-temp-short', $last_check); } // Check for updates if(time() - $last_check > 3600 || $force == true){ $response = wp_remote_post($this->remote_temp_active, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'body' => array( 'item' => urlencode('revslider'), 'version' => urlencode(RevSliderGlobals::SLIDER_REVISION), 'code' => urlencode(get_option('revslider-code', '')) ) )); $response_code = wp_remote_retrieve_response_code( $response ); $version_info = wp_remote_retrieve_body( $response ); if ( $response_code != 200 || is_wp_error( $version_info ) ) { //wait, cant connect }else{ if($version_info == 'valid'){ update_option('revslider-valid', 'true'); update_option('revslider-temp-active', 'false'); }elseif($version_info == 'temp_valid'){ //do nothing, }elseif($version_info == 'invalid'){ //invalid, deregister plugin! update_option('revslider-valid', 'false'); update_option('revslider-temp-active', 'false'); update_option('revslider-temp-active-notice', 'true'); } } $last_check = time(); update_option('revslider-activate-temp-short', $last_check); } } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteUpdateClassRev extends RevSliderUpdate {} ?>base-admin.class.php000066600000034661152141733250010402 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderBaseAdmin extends RevSliderBase { protected static $master_view; protected static $view; private static $arrSettings = array(); private static $arrMenuPages = array(); private static $arrSubMenuPages = array(); private static $tempVars = array(); private static $startupError = ''; private static $menuRole = 'admin'; private static $arrMetaBoxes = array(); //option boxes that will be added to post private static $allowed_views = array('master-view', 'system/validation', 'system/dialog-video', 'system/dialog-update', 'system/dialog-global-settings', 'sliders', 'slider', 'slider_template', 'slides', 'slide', 'navigation-editor', 'slide-editor', 'slide-overview', 'slide-editor', 'slider-overview', 'themepunch-google-fonts', 'global-settings'); /** * * main constructor */ public function __construct($t){ parent::__construct($t); //set view self::$view = self::getGetVar("view"); if(empty(self::$view)) self::$view = 'sliders'; //add internal hook for adding a menu in arrMenus add_action('admin_menu', array('RevSliderBaseAdmin', 'addAdminMenu')); add_action('add_meta_boxes', array('RevSliderBaseAdmin', 'onAddMetaboxes')); add_action('save_post', array('RevSliderBaseAdmin', 'onSavePost')); //if not inside plugin don't continue if($this->isInsidePlugin() == true){ add_action('admin_enqueue_scripts', array('RevSliderBaseAdmin', 'addCommonScripts')); add_action('admin_enqueue_scripts', array('RevSliderAdmin', 'onAddScripts')); }else{ add_action('admin_enqueue_scripts', array('RevSliderBaseAdmin', 'addGlobalScripts')); } //a must event for any admin. call onActivate function. $this->addEvent_onActivate(); $this->addAction_onActivate(); self::addActionAjax('show_image', 'onShowImage'); } /** * * add some meta box * return metabox handle */ public static function addMetaBox($title,$content = null, $customDrawFunction = null,$location="post"){ $box = array(); $box['title'] = $title; $box['location'] = $location; $box['content'] = $content; $box['draw_function'] = $customDrawFunction; self::$arrMetaBoxes[] = $box; } /** * * on add metaboxes */ public static function onAddMetaboxes(){ foreach(self::$arrMetaBoxes as $index=>$box){ $title = $box['title']; $location = $box['location']; $boxID = 'mymetabox_revslider_'.$index; $function = array(self::$t, "onAddMetaBoxContent"); if(is_array($location)){ foreach($location as $loc) add_meta_box($boxID,$title,$function,$loc,'normal','default'); }else add_meta_box($boxID,$title,$function,$location,'normal','default'); } } /** * * on save post meta. Update metaboxes data from post, add it to the post meta */ public static function onSavePost(){ //protection against autosave if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ){ $postID = RevSliderFunctions::getPostVariable("ID"); return $postID; } $postID = RevSliderFunctions::getPostVariable("ID"); if(empty($postID)) return(false); foreach(self::$arrMetaBoxes as $box){ $arrSettingNames = array('slide_template'); foreach($arrSettingNames as $name){ $value = RevSliderFunctions::getPostVariable($name); update_post_meta( $postID, $name, $value ); } //end foreach settings } //end foreach meta } /** * * on add metabox content */ public static function onAddMetaBoxContent($post,$boxData){ $postID = $post->ID; $boxID = RevSliderFunctions::getVal($boxData, "id"); $index = str_replace('mymetabox_revslider_',"",$boxID); $arrMetabox = self::$arrMetaBoxes[$index]; //draw element $drawFunction = RevSliderFunctions::getVal($arrMetabox, "draw_function"); if(!empty($drawFunction)) call_user_func($drawFunction); } /** * * set the menu role - for viewing menus */ public static function setMenuRole($menuRole){ self::$menuRole = $menuRole; } /** * get the menu role - for viewing menus */ public static function getMenuRole(){ return self::$menuRole; } /** * * set startup error to be shown in master view */ public static function setStartupError($errorMessage){ self::$startupError = $errorMessage; } /** * * tells if the the current plugin opened is this plugin or not * in the admin side. */ private function isInsidePlugin(){ $page = self::getGetVar("page"); if($page == 'revslider' || $page == 'themepunch-google-fonts' || $page == 'revslider_navigation' || $page == 'revslider_global_settings') return(true); return(false); } /** * add global used scripts * @since: 5.1.1 */ public static function addGlobalScripts(){ wp_enqueue_script(array('jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'wpdialogs')); wp_enqueue_style(array('wp-jquery-ui', 'wp-jquery-ui-dialog', 'wp-jquery-ui-core')); } /** * add common used scripts */ public static function addCommonScripts(){ if(function_exists("wp_enqueue_media")) wp_enqueue_media(); wp_enqueue_script(array('jquery', 'jquery-ui-core', 'jquery-ui-mouse', 'jquery-ui-accordion', 'jquery-ui-datepicker', 'jquery-ui-dialog', 'jquery-ui-slider', 'jquery-ui-autocomplete', 'jquery-ui-sortable', 'jquery-ui-droppable', 'jquery-ui-tabs', 'jquery-ui-widget', 'wp-color-picker')); wp_enqueue_style(array('wp-jquery-ui', 'wp-jquery-ui-core', 'wp-jquery-ui-dialog', 'wp-color-picker')); wp_enqueue_script('unite_settings', RS_PLUGIN_URL .'admin/assets/js/settings.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_script('unite_admin', RS_PLUGIN_URL .'admin/assets/js/admin.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_style('unite_admin', RS_PLUGIN_URL .'admin/assets/css/admin.css', array(), RevSliderGlobals::SLIDER_REVISION); //add tipsy wp_enqueue_script('tipsy', RS_PLUGIN_URL .'admin/assets/js/jquery.tipsy.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_style('tipsy', RS_PLUGIN_URL .'admin/assets/css/tipsy.css', array(), RevSliderGlobals::SLIDER_REVISION); //include codemirror wp_enqueue_script('codemirror_js', RS_PLUGIN_URL .'admin/assets/js/codemirror/codemirror.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_script('codemirror_js_highlight', RS_PLUGIN_URL .'admin/assets/js/codemirror/util/match-highlighter.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_script('codemirror_js_searchcursor', RS_PLUGIN_URL .'admin/assets/js/codemirror/util/searchcursor.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_script('codemirror_js_css', RS_PLUGIN_URL .'admin/assets/js/codemirror/css.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_script('codemirror_js_html', RS_PLUGIN_URL .'admin/assets/js/codemirror/xml.js', array(), RevSliderGlobals::SLIDER_REVISION ); wp_enqueue_style('codemirror_css', RS_PLUGIN_URL .'admin/assets/js/codemirror/codemirror.css', array(), RevSliderGlobals::SLIDER_REVISION); } /** * * admin pages parent, includes all the admin files by default */ public static function adminPages(){ //self::validateAdminPermissions(); } /** * * validate permission that the user is admin, and can manage options. */ protected static function isAdminPermissions(){ if( is_admin() && current_user_can("manage_options") ) return(true); return(false); } /** * * validate admin permissions, if no pemissions - exit */ protected static function validateAdminPermissions(){ if(!self::isAdminPermissions()){ echo "access denied"; return(false); } } /** * * set view that will be the master */ protected static function setMasterView($masterView){ self::$master_view = $masterView; } /** * * inlcude some view file */ protected static function requireView($view){ try{ //require master view file, and if(!empty(self::$master_view) && !isset(self::$tempVars["is_masterView"]) ){ $masterViewFilepath = self::$path_views.self::$master_view.".php"; RevSliderFunctions::validateFilepath($masterViewFilepath,"Master View"); self::$tempVars["is_masterView"] = true; require $masterViewFilepath; }else{ //simple require the view file. if(!in_array($view, self::$allowed_views)) UniteFunctionsRev::throwError(__('Wrong Request', 'revslider')); switch($view){ //switch URLs to corresponding php files case 'slide': $view = 'slide-editor'; break; case 'slider': $view = 'slider-editor'; break; case 'sliders': $view = 'slider-overview'; break; case 'slides': $view = 'slide-overview'; break; } $viewFilepath = self::$path_views.$view.".php"; RevSliderFunctions::validateFilepath($viewFilepath,"View"); require $viewFilepath; } }catch (Exception $e){ echo "

    View (".esc_attr($view).") Error: ".esc_attr($e->getMessage()).""; } } /** * require some template from "templates" folder */ protected static function getPathTemplate($templateName){ $pathTemplate = self::$path_templates.$templateName.'.php'; RevSliderFunctions::validateFilepath($pathTemplate,'Template'); return($pathTemplate); } /** * * add all js and css needed for media upload */ protected static function addMediaUploadIncludes(){ wp_enqueue_script('thickbox'); wp_enqueue_script('media-upload'); wp_enqueue_style('thickbox'); } /** * add admin menus from the list. */ public static function addAdminMenu(){ global $revslider_screens; $role = "manage_options"; switch(self::$menuRole){ case 'author': $role = "edit_published_posts"; break; case 'editor': $role = "edit_pages"; break; default: case 'admin': $role = "manage_options"; break; } foreach(self::$arrMenuPages as $menu){ $title = $menu["title"]; $pageFunctionName = $menu["pageFunction"]; $revslider_screens[] = add_menu_page( $title, $title, $role, 'revslider', array(self::$t, $pageFunctionName), 'dashicons-update' ); } foreach(self::$arrSubMenuPages as $menu){ $title = $menu["title"]; $pageFunctionName = $menu["pageFunction"]; $pageSlug = $menu["pageSlug"]; $revslider_screens[] = add_submenu_page( 'revslider', $title, $title, $role, $pageSlug, array(self::$t, $pageFunctionName) ); } } /** * * add menu page */ protected static function addMenuPage($title,$pageFunctionName){ self::$arrMenuPages[] = array("title"=>$title,"pageFunction"=>$pageFunctionName); } /** * * add menu page */ protected static function addSubMenuPage($title,$pageFunctionName,$pageSlug){ self::$arrSubMenuPages[] = array("title"=>$title,"pageFunction"=>$pageFunctionName,"pageSlug"=>$pageSlug); } /** * * get url to some view. */ public static function getViewUrl($viewName,$urlParams=""){ $params = "&view=".$viewName; if(!empty($urlParams)) $params .= "&".$urlParams; $link = admin_url( 'admin.php?page=revslider'.$params); return($link); } /** * * register the "onActivate" event */ protected function addEvent_onActivate($eventFunc = "onActivate"){ register_activation_hook( RS_PLUGIN_FILE_PATH, array(self::$t, $eventFunc) ); } protected function addAction_onActivate(){ register_activation_hook( RS_PLUGIN_FILE_PATH, array(self::$t, 'onActivateHook') ); } public static function onActivateHook(){ $options = array(); $options = apply_filters('revslider_mod_activation_option', $options); $operations = new RevSliderOperations(); $options_exist = $operations->getGeneralSettingsValues(); if(!is_array($options_exist)) $options_exist = array(); $options = array_merge($options_exist, $options); $operations->updateGeneralSettings($options); } /** * * store settings in the object */ protected static function storeSettings($key,$settings){ self::$arrSettings[$key] = $settings; } /** * * get settings object */ protected static function getSettings($key){ if(!isset(self::$arrSettings[$key])) RevSliderFunctions::throwError("Settings $key not found"); $settings = self::$arrSettings[$key]; return($settings); } /** * * add ajax back end callback, on some action to some function. */ protected static function addActionAjax($ajaxAction,$eventFunction){ add_action('wp_ajax_revslider_'.$ajaxAction, array('RevSliderAdmin', $eventFunction)); } /** * * echo json ajax response */ private static function ajaxResponse($success,$message,$arrData = null){ $response = array(); $response["success"] = $success; $response["message"] = $message; if(!empty($arrData)){ if(gettype($arrData) == "string") $arrData = array("data"=>$arrData); $response = array_merge($response,$arrData); } $json = json_encode($response); echo $json; exit(); } /** * * echo json ajax response, without message, only data */ protected static function ajaxResponseData($arrData){ if(gettype($arrData) == "string") $arrData = array("data"=>$arrData); self::ajaxResponse(true,"",$arrData); } /** * * echo json ajax response */ protected static function ajaxResponseError($message,$arrData = null){ self::ajaxResponse(false,$message,$arrData,true); } /** * echo ajax success response */ protected static function ajaxResponseSuccess($message,$arrData = null){ self::ajaxResponse(true,$message,$arrData,true); } /** * echo ajax success response */ protected static function ajaxResponseSuccessRedirect($message,$url){ $arrData = array("is_redirect"=>true,"redirect_url"=>$url); self::ajaxResponse(true,$message,$arrData,true); } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteBaseAdminClassRev extends RevSliderBaseAdmin {} ?>woocommerce.class.php000066600000010037152141733250010710 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderWooCommerce{ const ARG_REGULAR_PRICE_FROM = "reg_price_from"; const ARG_REGULAR_PRICE_TO = "reg_price_to"; const ARG_SALE_PRICE_FROM = "sale_price_from"; const ARG_SALE_PRICE_TO = "sale_price_to"; const ARG_IN_STOCK_ONLY = "instock_only"; const ARG_FEATURED_ONLY = "featured_only"; const META_REGULAR_PRICE = "_regular_price"; const META_SALE_PRICE = "_sale_price"; const META_STOCK_STATUS = "_stock_status"; //can be 'instock' or 'outofstock' const META_SKU = "_sku"; //can be 'instock' or 'outofstock' const META_FEATURED = "_featured"; //can be 'instock' or 'outofstock' const META_STOCK = "_stock"; //can be 'instock' or 'outofstock' const SORTBY_NUMSALES = "meta_num_total_sales"; const SORTBY_REGULAR_PRICE = "meta_num__regular_price"; const SORTBY_SALE_PRICE = "meta_num__sale_price"; const SORTBY_FEATURED = "meta__featured"; const SORTBY_SKU = "meta__sku"; const SORTBY_STOCK = "meta_num_stock"; /** * * return true / false if the woo commerce exists */ public static function isWooCommerceExists(){ if(class_exists( 'Woocommerce' )) return(true); return(false); } /** * * get wc post types */ public static function getCustomPostTypes(){ $arr = array(); $arr["product"] = __("Product", 'revslider'); $arr["product_variation"] = __("Product Variation", 'revslider'); return($arr); } /** * * get price query */ private static function getPriceQuery($priceFrom, $priceTo, $metaTag){ if(empty($priceFrom)) $priceFrom = 0; if(empty($priceTo)) $priceTo = 9999999999; $query = array( 'key' => $metaTag, 'value' => array( $priceFrom, $priceTo), 'type' => 'numeric', 'compare' => 'BETWEEN'); return($query); } /** * * get meta query for filtering woocommerce posts. */ public static function getMetaQuery($args){ $regPriceFrom = RevSliderFunctions::getVal($args, self::ARG_REGULAR_PRICE_FROM); $regPriceTo = RevSliderFunctions::getVal($args, self::ARG_REGULAR_PRICE_TO); $salePriceFrom = RevSliderFunctions::getVal($args, self::ARG_SALE_PRICE_FROM); $salePriceTo = RevSliderFunctions::getVal($args, self::ARG_SALE_PRICE_TO); $inStockOnly = RevSliderFunctions::getVal($args, self::ARG_IN_STOCK_ONLY); $featuredOnly = RevSliderFunctions::getVal($args, self::ARG_FEATURED_ONLY); $arrQueries = array(); //get regular price array if(!empty($regPriceFrom) || !empty($regPriceTo)){ $arrQueries[] = self::getPriceQuery($regPriceFrom, $regPriceTo, self::META_REGULAR_PRICE); } //get sale price array if(!empty($salePriceFrom) || !empty($salePriceTo)){ $arrQueries[] = self::getPriceQuery($salePriceFrom, $salePriceTo, self::META_SALE_PRICE); } if($inStockOnly == "on"){ $query = array( 'key' => self::META_STOCK_STATUS, 'value' => "instock"); $arrQueries[] = $query; } if($featuredOnly == "on"){ $query = array( 'key' => self::META_FEATURED, 'value' => "yes"); $arrQueries[] = $query; } $query = array(); if(!empty($arrQueries)) $query = array("meta_query"=>$arrQueries); return($query); } /** * * get sortby function including standart wp sortby array */ public static function getArrSortBy(){ $arrSortBy = array(); $arrSortBy[self::SORTBY_REGULAR_PRICE] = __("Regular Price", 'revslider'); $arrSortBy[self::SORTBY_SALE_PRICE] = __("Sale Price", 'revslider'); $arrSortBy[self::SORTBY_NUMSALES] = __("Number Of Sales", 'revslider'); $arrSortBy[self::SORTBY_FEATURED] = __("Featured Products", 'revslider'); $arrSortBy[self::SORTBY_SKU] = __("SKU", 'revslider'); $arrSortBy[self::SORTBY_STOCK] = __("Stock Quantity", 'revslider'); return($arrSortBy); } } //end of the class ?>colorpicker.class.php000066600000020510152141733250010702 0ustar00 * @link http://www.themepunch.com/ * @copyright 2017 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); if(!class_exists('TPColorpicker')){ class TPColorpicker { /** * @since 5.3.1.6 */ public function __construct(){ add_filter(AJAX_ACTION, array($this, 'init_ajax'), 10, 6); } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function get($val) { if(!$val || empty($val)) return 'transparent'; $process = TPColorpicker::process($val, true); return $process[0]; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function parse($val, $prop, $returnColorType){ $val = TPColorpicker::process($val, true); $ar = array(); if(!$prop) $ar[0] = $val[0]; else $ar[0] = $prop + ': ' + $val[0] + ';'; if($returnColorType) $ar[1] = $val[1]; return $ar; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function convert($color, $opacity){ if( $opacity == "transparent" ){ return 'rgba(0,0,0,0)'; } if($color=="" ) return ''; if(strpos($color, "[{") !== false || strpos($color,'gradient') !== false ) return TPColorpicker::get($color); if(!is_bool($opacity) && "".$opacity === "0"){ return 'transparent'; } if($opacity==-1 || !$opacity || empty($opacity) || !is_numeric($opacity) || $color == "transparent" || $opacity === 1 || $opacity === 100 ) { if(strpos($color,'rgba') === false && strpos($color,'#') !== false) { return TPColorpicker::processRgba(TPColorpicker::sanitizeHex($color), $opacity); } else { return $color; } } $opacity = floatval($opacity); if($opacity < 1) $opacity = $opacity * 100; $opacity = round($opacity); $opacity = $opacity > 100 ? 100 : $opacity; $opacity = $opacity < -1 ? 0 : $opacity; if($opacity === 0) return 'transparent'; if(strpos($color,'#') !== false ) { return TPColorpicker::processRgba(TPColorpicker::sanitizeHex($color), $opacity); } else { $color = TPColorpicker::rgbValues($color, 3); return TPColorpicker::rgbaString($color[0], $color[1], $color[2], $opacity); } } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function process($clr, $processColor){ if( !is_string($clr) ) { if($processColor) $clr = TPColorpicker::sanatizeGradient($clr); return array( TPColorpicker::processGradient($clr), 'gradient', $clr ); } else if( trim($clr) == 'transparent' ) { return array('transparent', 'transparent'); } else if( strpos( $clr, "[{" ) !== false ) { try { $clr = json_decode( str_replace("amp;", '',str_replace("&", '"', $clr)) ); if($processColor) $clr = TPColorpicker::sanatizeGradient($clr); return array(TPColorpicker::processGradient($clr), 'gradient', $clr); } catch (Exception $e) { return '{"type":"linear","angle":"0","colors":[{"r":"255","g":"255","b":"255","a":"1","position":"0","align":"bottom"},{"r":"0","g":"0","b":"0","a":"1","position":"100","align":"bottom"}]}'; } } else if( strpos($clr,'#') !== false ) { return array(TPColorpicker::sanitizeHex($clr), 'hex'); } else if( strpos($clr,'rgba') !== false ) { $clr = preg_replace( '/\s+/', '', $clr ) ; return array($clr, 'rgba'); } else { $clr = preg_replace('/\s+/', '', $clr); return array($clr, 'rgb'); } } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function sanatizeGradient($obj) { $colors = $obj->colors; $len = sizeof($colors); $ar = array(); for($i = 0; $i < $len; $i++) { $cur = $colors[$i]; unset($cur->align); if( isset($prev) ) { if(json_encode($cur) !== json_encode($prev)) { $ar[sizeof($ar)] = $cur; } } else { $ar[sizeof($ar)] = $cur; } $prev = $cur; } $obj->colors = $ar; return $obj; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function processGradient($obj){ $tpe = $obj->type; $begin = $tpe . '-gradient('; $middle = $tpe === 'linear' ? $obj->angle . 'deg, ' : 'ellipse at center, '; $colors = $obj->colors; $len = sizeof($colors); $end = ''; for($i = 0; $i < $len; $i++) { if($i > 0) $end .= ', '; $clr = $colors[$i]; $end .= 'rgba(' . $clr->r . ',' . $clr->g . ',' . $clr->b . ',' . $clr->a . ') ' . $clr->position . '%'; } return $begin . $middle . $end . ')'; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function rgbValues($values, $num) { $values = substr( $values, strpos($values, '(') + 1 , strpos($values, ')')-strpos($values, '(') - 1 ); $values = explode(",", $values); if(sizeof($values) == 3 && $num == 4) $values[3] = '1'; for($i = 0; $i < $num; $i++) { if(isset($values[$i])) $values[$i] = trim($values[$i]); } return $values; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function rgbaString($r, $g, $b, $a) { if($a > 1){ $a = "".number_format($a * 0.01 , 2); $a = str_replace(".00", "", $a); } return 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $a . ')'; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function rgbToHex($clr) { $values = TPColorpicker::rgbValues($clr, 3); return TPColorpicker::getRgbToHex($values[0], $values[1], $values[2]); } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function rgbaToHex($clr) { $values = TPColorpicker::rgbValues($clr, 4); return array(TPColorpicker::getRgbToHex($values[0], $values[1], $values[2]), $values[3]); } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function getOpacity($val){ $rgb = TPColorpicker::rgbValues($val, 4); return intval($rgb[3] * 100, 10) + '%'; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function getRgbToHex($r, $g, $b){ $rgb = array($r, $g, $b); $hex = "#"; $hex .= str_pad(dechex($rgb[0]), 2, "0", STR_PAD_LEFT); $hex .= str_pad(dechex($rgb[1]), 2, "0", STR_PAD_LEFT); $hex .= str_pad(dechex($rgb[2]), 2, "0", STR_PAD_LEFT); return $hex; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function joinToRgba($val){ $val = explode('||', $val); return TPColorpicker::convert($val[0], $val[1]); } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function processRgba($hex, $opacity=false){ $hex = trim(str_replace('#', '' , $hex)); $rgb = $opacity!==false ? 'rgba' : 'rgb'; $r = hexdec(substr($hex,0,2)); $g = hexdec(substr($hex,2,2)); $b = hexdec(substr($hex,4,2)); $color = $rgb . "(" . $r . "," . $g . "," . $b ; if($opacity!==false){ if($opacity > 1) $opacity = "".number_format($opacity * 0.01 , 2); $opacity = str_replace(".00", "", $opacity); $color .= ',' . $opacity; } $color .= ')'; return $color; } /** * TODO: What does it do? * @since 5.3.1.6 */ public static function sanitizeHex($hex){ $hex = trim(str_replace('#', '' , $hex)); if (strlen($hex) == 3) { $hex[5] = $hex[2]; // f60##0 $hex[4] = $hex[2]; // f60#00 $hex[3] = $hex[1]; // f60600 $hex[2] = $hex[1]; // f66600 $hex[1] = $hex[0]; // ff6600 } return '#'.$hex; } /** * Save presets * @since 5.3.2 */ public static function save_color_presets($presets){ update_option('tp_colorpicker_presets', $presets); return self::get_color_presets(); } /** * Load presets * @since 5.3.2 */ public static function get_color_presets(){ return get_option('tp_colorpicker_presets', array()); } } } ?>cssparser.class.php000066600000051514152141733250010403 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderCssParser{ private $cssContent; public function __construct(){ } /** * * init the parser, set css content */ public function initContent($cssContent){ $this->cssContent = $cssContent; } /** * * get array of slide classes, between two sections. */ public function getArrClasses($startText = "",$endText="",$explodeonspace=false){ $content = $this->cssContent; //trim from top if(!empty($startText)){ $posStart = strpos($content, $startText); if($posStart !== false) $content = substr($content, $posStart,strlen($content)-$posStart); } //trim from bottom if(!empty($endText)){ $posEnd = strpos($content, $endText); if($posEnd !== false) $content = substr($content,0,$posEnd); } //get styles $lines = explode("\n",$content); $arrClasses = array(); foreach($lines as $key=>$line){ $line = trim($line); if(strpos($line, "{") === false) continue; //skip unnessasary links if(strpos($line, ".caption a") !== false) continue; if(strpos($line, ".tp-caption a") !== false) continue; //get style out of the line $class = str_replace("{", "", $line); $class = trim($class); //skip captions like this: .tp-caption.imageclass img if(strpos($class," ") !== false){ if(!$explodeonspace){ continue; }else{ $class = explode(',', $class); $class = $class[0]; } } //skip captions like this: .tp-caption.imageclass:hover, :before, :after if(strpos($class,":") !== false) continue; $class = str_replace(".caption.", ".", $class); $class = str_replace(".tp-caption.", ".", $class); $class = str_replace(".", "", $class); $class = trim($class); $arrWords = explode(" ", $class); $class = $arrWords[count($arrWords)-1]; $class = trim($class); $arrClasses[] = $class; } sort($arrClasses); return($arrClasses); } public static function parseCssToArray($css){ while(strpos($css, '/*') !== false){ if(strpos($css, '*/') === false) return false; $start = strpos($css, '/*'); $end = strpos($css, '*/') + 2; $css = str_replace(substr($css, $start, $end - $start), '', $css); } //preg_match_all( '/(?ims)([a-z0-9\s\.\:#_\-@]+)\{([^\}]*)\}/', $css, $arr); preg_match_all( '/(?ims)([a-z0-9\,\s\.\:#_\-@]+)\{([^\}]*)\}/', $css, $arr); $result = array(); foreach ($arr[0] as $i => $x){ $selector = trim($arr[1][$i]); if(strpos($selector, '{') !== false || strpos($selector, '}') !== false) return false; $rules = explode(';', trim($arr[2][$i])); $result[$selector] = array(); foreach ($rules as $strRule){ if (!empty($strRule)){ $rule = explode(":", $strRule); if(strpos($rule[0], '{') !== false || strpos($rule[0], '}') !== false || strpos($rule[1], '{') !== false || strpos($rule[1], '}') !== false) return false; //put back everything but not $rule[0]; $key = trim($rule[0]); unset($rule[0]); $values = implode(':', $rule); $result[$selector][trim($key)] = trim(str_replace("'", '"', $values)); } } } return($result); } public static function parseDbArrayToCss($cssArray, $nl = "\n\r"){ $css = ''; $deformations = self::get_deformation_css_tags(); $transparency = array( 'color' => 'color-transparency', 'background-color' => 'background-transparency', 'border-color' => 'border-transparency' ); $check_parameters = array( 'border-width' => 'px', 'border-radius' => 'px', 'padding' => 'px', 'font-size' => 'px', 'line-height' => 'px' ); foreach($cssArray as $id => $attr){ $stripped = ''; if(strpos($attr['handle'], '.tp-caption') !== false){ $stripped = trim(str_replace('.tp-caption', '', $attr['handle'])); } $attr['advanced'] = json_decode($attr['advanced'], true); $styles = json_decode(str_replace("'", '"', $attr['params']), true); $styles_adv = $attr['advanced']['idle']; $css.= $attr['handle']; if(!empty($stripped)) $css.= ', '.$stripped; $css.= " {".$nl; if(is_array($styles) || is_array($styles_adv)){ if(is_array($styles)){ foreach($styles as $name => $style){ if(in_array($name, $deformations) && $name !== 'css_cursor') continue; if(!is_array($name) && isset($transparency[$name])){ //the style can have transparency! if(isset($styles[$transparency[$name]]) && $style !== 'transparent'){ $style = RevSliderFunctions::hex2rgba($style, $styles[$transparency[$name]] * 100); } } if(!is_array($name) && isset($check_parameters[$name])){ $style = RevSliderFunctions::add_missing_val($style, $check_parameters[$name]); } if(is_array($style) || is_object($style)) $style = implode(' ', $style); $ret = self::check_for_modifications($name, $style); if($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue; $css.= $ret['name'].':'.$ret['style'].";".$nl; } } if(is_array($styles_adv)){ foreach($styles_adv as $name => $style){ if(in_array($name, $deformations) && $name !== 'css_cursor') continue; if(is_array($style) || is_object($style)) $style = implode(' ', $style); $ret = self::check_for_modifications($name, $style); if($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue; $css.= $ret['name'].':'.$ret['style'].";".$nl; } } } $css.= "}".$nl.$nl; //add hover $setting = json_decode($attr['settings'], true); if(isset($setting['hover']) && $setting['hover'] == 'true'){ $hover = json_decode(str_replace("'", '"', $attr['hover']), true); $hover_adv = $attr['advanced']['hover']; if(is_array($hover) || is_array($hover_adv)){ $css.= $attr['handle'].":hover"; if(!empty($stripped)) $css.= ', '.$stripped.':hover'; $css.= " {".$nl; if(is_array($hover)){ foreach($hover as $name => $style){ if(in_array($name, $deformations) && $name !== 'css_cursor') continue; if(!is_array($name) && isset($transparency[$name])){ //the style can have transparency! if(isset($hover[$transparency[$name]]) && $style !== 'transparent'){ $style = RevSliderFunctions::hex2rgba($style, $hover[$transparency[$name]] * 100); } } if(!is_array($name) && isset($check_parameters[$name])){ $style = RevSliderFunctions::add_missing_val($style, $check_parameters[$name]); } if(is_array($style)|| is_object($style)) $style = implode(' ', $style); $ret = self::check_for_modifications($name, $style); if($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue; $css.= $ret['name'].':'.$ret['style'].";".$nl; } } if(is_array($hover_adv)){ foreach($hover_adv as $name => $style){ if(in_array($name, $deformations) && $name !== 'css_cursor') continue; if(is_array($style)|| is_object($style)) $style = implode(' ', $style); $ret = self::check_for_modifications($name, $style); if($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue; $css.= $ret['name'].':'.$ret['style'].";".$nl; } } $css.= "}".$nl.$nl; } } } return $css; } /** * Check for Modifications like with css_cursor * @since: 5.1.3 **/ public static function check_for_modifications($name, $style){ if($name == 'css_cursor'){ if($style == 'zoom-in') $style = 'zoom-in; -webkit-zoom-in; cursor: -moz-zoom-in'; if($style == 'zoom-out') $style = 'zoom-out; -webkit-zoom-out; cursor: -moz-zoom-out'; $name = 'cursor'; } return array('name' => $name, 'style' => $style); } public static function parseArrayToCss($cssArray, $nl = "\n\r", $adv = false){ $deformations = self::get_deformation_css_tags(); $css = ''; foreach($cssArray as $id => $attr){ $setting = (array)$attr['settings']; $advanced = (array)$attr['advanced']; $stripped = ''; if(strpos($attr['handle'], '.tp-caption') !== false){ $stripped = trim(str_replace('.tp-caption', '', $attr['handle'])); } $styles = (array)$attr['params']; $css.= $attr['handle']; if(!empty($stripped)) $css.= ', '.$stripped; $css.= " {".$nl; if($adv && isset($advanced['idle'])){ $styles = array_merge($styles, (array)$advanced['idle']); if(isset($setting['type'])){ $styles['type'] = $setting['type']; } } if(is_array($styles) && !empty($styles)){ foreach($styles as $name => $style){ if(in_array($name, $deformations) && $name !== 'css_cursor') continue; if($name == 'background-color' && strpos($style, 'rgba') !== false){ //rgb && rgba $rgb = explode(',', str_replace('rgba', 'rgb', $style)); unset($rgb[count($rgb)-1]); $rgb = implode(',', $rgb).')'; $css.= $name.':'.$rgb.";".$nl; } $style = (is_array($style) || is_object($style)) ? implode(' ', $style) : $style; $css.= $name.':'.$style.";".$nl; } } $css.= "}".$nl.$nl; //add hover if(isset($setting['hover']) && $setting['hover'] == 'true'){ $hover = (array)$attr['hover']; if($adv && isset($advanced['hover'])){ $styles = array_merge($styles, (array)$advanced['hover']); } if(is_array($hover)){ $css.= $attr['handle'].":hover"; if(!empty($stripped)) $css.= ', '.$stripped.":hover"; $css.= " {".$nl; foreach($hover as $name => $style){ if($name == 'background-color' && strpos($style, 'rgba') !== false){ //rgb && rgba $rgb = explode(',', str_replace('rgba', 'rgb', $style)); unset($rgb[count($rgb)-1]); $rgb = implode(',', $rgb).')'; $css.= $name.':'.$rgb.";".$nl; } $style = (is_array($style) || is_object($style)) ? implode(' ', $style) : $style; $css.= $name.':'.$style.";".$nl; } $css.= "}".$nl.$nl; } } } return $css; } public static function parseStaticArrayToCss($cssArray, $nl = "\n"){ $css = RevSliderCssParser::parseSimpleArrayToCss(); return $css; } public static function parseSimpleArrayToCss($cssArray, $nl = "\n"){ $css = ''; foreach($cssArray as $class => $styles){ $css.= $class." {".$nl; if(is_array($styles) && !empty($styles)){ foreach($styles as $name => $style){ $style = (is_array($style) || is_object($style)) ? implode(' ', $style) : $style; $css.= $name.':'.$style.";".$nl; } } $css.= "}".$nl.$nl; } return $css; } public static function parseDbArrayToArray($cssArray, $handle = false){ if(!is_array($cssArray) || empty($cssArray)) return false; foreach($cssArray as $key => $css){ if($handle != false){ if($cssArray[$key]['handle'] == '.tp-caption.'.$handle){ $cssArray[$key]['params'] = json_decode(str_replace("'", '"', $css['params'])); $cssArray[$key]['hover'] = json_decode(str_replace("'", '"', $css['hover'])); $cssArray[$key]['advanced'] = json_decode(str_replace("'", '"', $css['advanced'])); $cssArray[$key]['settings'] = json_decode(str_replace("'", '"', $css['settings'])); return $cssArray[$key]; }else{ unset($cssArray[$key]); } }else{ $cssArray[$key]['params'] = json_decode(str_replace("'", '"', $css['params'])); $cssArray[$key]['hover'] = json_decode(str_replace("'", '"', $css['hover'])); $cssArray[$key]['advanced'] = json_decode(str_replace("'", '"', $css['advanced'])); $cssArray[$key]['settings'] = json_decode(str_replace("'", '"', $css['settings'])); } } return $cssArray; } public static function compress_css($buffer){ /* remove comments */ $buffer = preg_replace("!/\*[^*]*\*+([^/][^*]*\*+)*/!", "", $buffer) ; /* remove tabs, spaces, newlines, etc. */ $arr = array("\r\n", "\r", "\n", "\t", " ", " ", " "); $rep = array("", "", "", "", " ", " ", " "); $buffer = str_replace($arr, $rep, $buffer); /* remove whitespaces around {}:, */ $buffer = preg_replace("/\s*([\{\}:,])\s*/", "$1", $buffer); /* remove last ; */ $buffer = str_replace(';}', "}", $buffer); return $buffer; } /** * Defines the default CSS Classes, can be given a version number to order them accordingly * @since: 5.0 **/ public static function default_css_classes(){ $default = array( '.tp-caption.medium_grey' => '4', '.tp-caption.small_text' => '4', '.tp-caption.medium_text' => '4', '.tp-caption.large_text' => '4', '.tp-caption.very_large_text' => '4', '.tp-caption.very_big_white' => '4', '.tp-caption.very_big_black' => '4', '.tp-caption.modern_medium_fat' => '4', '.tp-caption.modern_medium_fat_white' => '4', '.tp-caption.modern_medium_light' => '4', '.tp-caption.modern_big_bluebg' => '4', '.tp-caption.modern_big_redbg' => '4', '.tp-caption.modern_small_text_dark' => '4', '.tp-caption.boxshadow' => '4', '.tp-caption.black' => '4', '.tp-caption.noshadow' => '4', '.tp-caption.thinheadline_dark' => '4', '.tp-caption.thintext_dark' => '4', '.tp-caption.largeblackbg' => '4', '.tp-caption.largepinkbg' => '4', '.tp-caption.largewhitebg' => '4', '.tp-caption.largegreenbg' => '4', '.tp-caption.excerpt' => '4', '.tp-caption.large_bold_grey' => '4', '.tp-caption.medium_thin_grey' => '4', '.tp-caption.small_thin_grey' => '4', '.tp-caption.lightgrey_divider' => '4', '.tp-caption.large_bold_darkblue' => '4', '.tp-caption.medium_bg_darkblue' => '4', '.tp-caption.medium_bold_red' => '4', '.tp-caption.medium_light_red' => '4', '.tp-caption.medium_bg_red' => '4', '.tp-caption.medium_bold_orange' => '4', '.tp-caption.medium_bg_orange' => '4', '.tp-caption.grassfloor' => '4', '.tp-caption.large_bold_white' => '4', '.tp-caption.medium_light_white' => '4', '.tp-caption.mediumlarge_light_white' => '4', '.tp-caption.mediumlarge_light_white_center' => '4', '.tp-caption.medium_bg_asbestos' => '4', '.tp-caption.medium_light_black' => '4', '.tp-caption.large_bold_black' => '4', '.tp-caption.mediumlarge_light_darkblue' => '4', '.tp-caption.small_light_white' => '4', '.tp-caption.roundedimage' => '4', '.tp-caption.large_bg_black' => '4', '.tp-caption.mediumwhitebg' => '4', '.tp-caption.MarkerDisplay' => '5.0', '.tp-caption.Restaurant-Display' => '5.0', '.tp-caption.Restaurant-Cursive' => '5.0', '.tp-caption.Restaurant-ScrollDownText' => '5.0', '.tp-caption.Restaurant-Description' => '5.0', '.tp-caption.Restaurant-Price' => '5.0', '.tp-caption.Restaurant-Menuitem' => '5.0', '.tp-caption.Furniture-LogoText' => '5.0', '.tp-caption.Furniture-Plus' => '5.0', '.tp-caption.Furniture-Title' => '5.0', '.tp-caption.Furniture-Subtitle' => '5.0', '.tp-caption.Gym-Display' => '5.0', '.tp-caption.Gym-Subline' => '5.0', '.tp-caption.Gym-SmallText' => '5.0', '.tp-caption.Fashion-SmallText' => '5.0', '.tp-caption.Fashion-BigDisplay' => '5.0', '.tp-caption.Fashion-TextBlock' => '5.0', '.tp-caption.Sports-Display' => '5.0', '.tp-caption.Sports-DisplayFat' => '5.0', '.tp-caption.Sports-Subline' => '5.0', '.tp-caption.Instagram-Caption' => '5.0', '.tp-caption.News-Title' => '5.0', '.tp-caption.News-Subtitle' => '5.0', '.tp-caption.Photography-Display' => '5.0', '.tp-caption.Photography-Subline' => '5.0', '.tp-caption.Photography-ImageHover' => '5.0', '.tp-caption.Photography-Menuitem' => '5.0', '.tp-caption.Photography-Textblock' => '5.0', '.tp-caption.Photography-Subline-2' => '5.0', '.tp-caption.Photography-ImageHover2' => '5.0', '.tp-caption.WebProduct-Title' => '5.0', '.tp-caption.WebProduct-SubTitle' => '5.0', '.tp-caption.WebProduct-Content' => '5.0', '.tp-caption.WebProduct-Menuitem' => '5.0', '.tp-caption.WebProduct-Title-Light' => '5.0', '.tp-caption.WebProduct-SubTitle-Light' => '5.0', '.tp-caption.WebProduct-Content-Light' => '5.0', '.tp-caption.FatRounded' => '5.0', '.tp-caption.NotGeneric-Title' => '5.0', '.tp-caption.NotGeneric-SubTitle' => '5.0', '.tp-caption.NotGeneric-CallToAction' => '5.0', '.tp-caption.NotGeneric-Icon' => '5.0', '.tp-caption.NotGeneric-Menuitem' => '5.0', '.tp-caption.MarkerStyle' => '5.0', '.tp-caption.Gym-Menuitem' => '5.0', '.tp-caption.Newspaper-Button' => '5.0', '.tp-caption.Newspaper-Subtitle' => '5.0', '.tp-caption.Newspaper-Title' => '5.0', '.tp-caption.Newspaper-Title-Centered' => '5.0', '.tp-caption.Hero-Button' => '5.0', '.tp-caption.Video-Title' => '5.0', '.tp-caption.Video-SubTitle' => '5.0', '.tp-caption.NotGeneric-Button' => '5.0', '.tp-caption.NotGeneric-BigButton' => '5.0', '.tp-caption.WebProduct-Button' => '5.0', '.tp-caption.Restaurant-Button' => '5.0', '.tp-caption.Gym-Button' => '5.0', '.tp-caption.Gym-Button-Light' => '5.0', '.tp-caption.Sports-Button-Light' => '5.0', '.tp-caption.Sports-Button-Red' => '5.0', '.tp-caption.Photography-Button' => '5.0', '.tp-caption.Newspaper-Button-2' => '5.0' ); $default = apply_filters('revslider_mod_default_css_handles', $default); return $default; } /** * Defines the deformation CSS which is not directly usable as pure CSS * @since: 5.0 **/ public static function get_deformation_css_tags(){ return array( 'x' => 'x', 'y' => 'y', 'z' => 'z', 'skewx' => 'skewx', 'skewy' => 'skewy', 'scalex' => 'scalex', 'scaley' => 'scaley', 'opacity' => 'opacity', 'xrotate' => 'xrotate', 'yrotate' => 'yrotate', '2d_rotation' => '2d_rotation', 'layer_2d_origin_x' => 'layer_2d_origin_x', 'layer_2d_origin_y' => 'layer_2d_origin_y', '2d_origin_x' => '2d_origin_x', '2d_origin_y' => '2d_origin_y', 'pers' => 'pers', 'color-transparency' => 'color-transparency', 'background-transparency' => 'background-transparency', 'border-transparency' => 'border-transparency', 'css_cursor' => 'css_cursor', 'speed' => 'speed', 'easing' => 'easing', 'corner_left' => 'corner_left', 'corner_right' => 'corner_right', 'parallax' => 'parallax', 'type' => 'type', 'padding' => 'padding', 'margin' => 'margin', 'text-align' => 'text-align' ); } public static function get_captions_sorted(){ $db = new RevSliderDB(); $styles = $db->fetch(RevSliderGlobals::$table_css, '', 'handle ASC'); $arr = array('5.0' => array(), 'Custom' => array(), '4' => array()); foreach($styles as $style){ $setting = json_decode($style['settings'], true); if(!isset($setting['type'])) $setting['type'] = 'text'; if(array_key_exists('version', $setting) && isset($setting['version'])) $arr[ucfirst($setting['version'])][] = array('label' => trim(str_replace('.tp-caption.', '', $style['handle'])), 'type' => $setting['type']); } $sorted = array(); foreach($arr as $version => $class){ foreach($class as $name){ $sorted[] = array('label' => $name['label'], 'version' => $version, 'type' => $name['type']); } } return $sorted; } /** * Handles media queries * @since: 5.2.0 **/ public static function parse_media_blocks($css){ $mediaBlocks = array(); $start = 0; while(($start = strpos($css, '@media', $start)) !== false){ $s = array(); $i = strpos($css, '{', $start); if ($i !== false){ $block = trim(substr($css, $start, $i - $start)); array_push($s, $css[$i]); $i++; while(!empty($s)){ if ($css[$i] == '{'){ array_push($s, '{'); }elseif ($css[$i] == '}'){ array_pop($s); }else{ //broken css? } $i++; } $mediaBlocks[$block] = substr($css, $start, ($i + 1) - $start); $start = $i; } } return $mediaBlocks; } /** * removes @media { ... } queries from CSS * @since: 5.2.0 **/ public static function clear_media_block($css){ $start = 0; if(strpos($css, '@media', $start) !== false){ $start = strpos($css, '@media', 0); $i = strpos($css, '{', $start) + 1; //remove @media ... first { $remove = substr($css, $start - 1, $i - $start + 1); $css = str_replace($remove, '', $css); //remove last } $css = preg_replace('/}$/', '', $css); } return $css; } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteCssParserRev extends RevSliderCssParser {} ?>include-framework.php000066600000001526152141733250010706 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); $folderIncludes = dirname(__FILE__)."/"; require_once($folderIncludes . 'functions.class.php'); require_once($folderIncludes . 'functions-wordpress.class.php'); require_once($folderIncludes . 'db.class.php'); require_once($folderIncludes . 'cssparser.class.php'); require_once($folderIncludes . 'wpml.class.php'); require_once($folderIncludes . 'woocommerce.class.php'); require_once($folderIncludes . 'em-integration.class.php'); require_once($folderIncludes . 'aq-resizer.class.php'); require_once($folderIncludes . 'plugin-update.class.php'); require_once($folderIncludes . 'addon-admin.class.php'); require_once($folderIncludes . 'colorpicker.class.php'); ?>base-front.class.php000066600000001222152141733250010425 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderBaseFront extends RevSliderBase { const ACTION_ENQUEUE_SCRIPTS = "wp_enqueue_scripts"; /** * * main constructor */ public function __construct($t){ parent::__construct($t); add_action('wp_enqueue_scripts', array('RevSliderFront', 'onAddScripts')); } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteBaseFrontClassRev extends RevSliderBaseFront {} ?>aq-resizer.class.php000066600000017317152141733250010463 0ustar00resize( $width, $height, $crop ) ) ) return false; $resized_file = $editor->save(); if ( ! is_wp_error( $resized_file ) ) { $resized_rel_path = str_replace( $upload_dir, '', $resized_file['path'] ); $img_url = $upload_url . $resized_rel_path; } else { return false; } } } // Okay, leave the ship. if ( true === $upscale ) remove_filter( 'image_resize_dimensions', array( $this, 'aq_upscale' ) ); // Return the output. if ( $single ) { // str return. $image = $img_url; } else { // array return. $image = array ( 0 => $img_url, 1 => $dst_w, 2 => $dst_h ); } return $image; } /** * Callback to overwrite WP computing of thumbnail measures */ function aq_upscale( $default, $orig_w, $orig_h, $dest_w, $dest_h, $crop ) { if ( ! $crop ) return null; // Let the wordpress default function handle this. // Here is the point we allow to use larger image size than the original one. $aspect_ratio = $orig_w / $orig_h; $new_w = $dest_w; $new_h = $dest_h; if ( ! $new_w ) { $new_w = intval( $new_h * $aspect_ratio ); } if ( ! $new_h ) { $new_h = intval( $new_w / $aspect_ratio ); } $size_ratio = max( $new_w / $orig_w, $new_h / $orig_h ); $crop_w = round( $new_w / $size_ratio ); $crop_h = round( $new_h / $size_ratio ); $s_x = floor( ( $orig_w - $crop_w ) / 2 ); $s_y = floor( ( $orig_h - $crop_h ) / 2 ); return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h ); } } } if(!function_exists('rev_aq_resize')) { /** * This is just a tiny wrapper function for the class above so that there is no * need to change any code in your own WP themes. Usage is still the same :) */ function rev_aq_resize( $url, $width = null, $height = null, $crop = null, $single = true, $upscale = false ) { $aq_resize = Rev_Aq_Resize::getInstance(); return $aq_resize->process( $url, $width, $height, $crop, $single, $upscale ); } } ?>newsletter.class.php000066600000003434152141733250010570 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch * @version 1.0.0 */ if( !defined( 'ABSPATH') ) exit(); if(!class_exists('ThemePunch_Newsletter')) { class ThemePunch_Newsletter { protected static $remote_url = 'http://newsletter.themepunch.com/'; protected static $subscribe = 'subscribe.php'; protected static $unsubscribe = 'unsubscribe.php'; public function __construct(){ } /** * Subscribe to the ThemePunch Newsletter * @since: 1.0.0 **/ public static function subscribe($email){ global $wp_version; $request = wp_remote_post(self::$remote_url.self::$subscribe, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'timeout' => 15, 'body' => array( 'email' => urlencode($email) ) )); if(!is_wp_error($request)) { if($response = json_decode($request['body'], true)) { if(is_array($response)) { $data = $response; return $data; }else{ return false; } } } } /** * Unsubscribe to the ThemePunch Newsletter * @since: 1.0.0 **/ public static function unsubscribe($email){ global $wp_version; $request = wp_remote_post(self::$remote_url.self::$unsubscribe, array( 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url'), 'timeout' => 15, 'body' => array( 'email' => urlencode($email) ) )); if(!is_wp_error($request)) { if($response = json_decode($request['body'], true)) { if(is_array($response)) { $data = $response; return $data; }else{ return false; } } } } } } ?>functions.class.php000066600000040255152141733250010406 0ustar00 * @link http://www.themepunch.com/ * @copyright 2015 ThemePunch */ if( !defined( 'ABSPATH') ) exit(); class RevSliderFunctions{ public static function throwError($message,$code=null){ if(!empty($code)){ throw new Exception($message,$code); }else{ throw new Exception($message); } } /** * set output for download */ public static function downloadFile($str,$filename="output.txt"){ //output for download header('Content-Description: File Transfer'); header('Content-Type: text/html; charset=UTF-8'); header("Content-Disposition: attachment; filename=".$filename.";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".strlen($str)); echo $str; exit(); } /** * turn boolean to string */ public static function boolToStr($bool){ if(gettype($bool) == "string") return($bool); if($bool == true) return("true"); else return("false"); } /** * convert string to boolean */ public static function strToBool($str){ if(is_bool($str)) return($str); if(empty($str)) return(false); if(is_numeric($str)) return($str != 0); $str = strtolower($str); if($str == "true") return(true); return(false); } /** * get value from array. if not - return alternative */ public static function getVal($arr,$key,$altVal=""){ if(is_array($arr)){ if(isset($arr[$key])){ return($arr[$key]); } }elseif(is_object($arr)){ if(isset($arr->$key)){ return($arr->$key); } } return($altVal); } //------------------------------------------------------------ // get variable from post or from get. post wins. public static function getPostGetVariable($name,$initVar = ""){ $var = $initVar; if(isset($_POST[$name])) $var = $_POST[$name]; else if(isset($_GET[$name])) $var = $_GET[$name]; return($var); } //------------------------------------------------------------ public static function getPostVariable($name,$initVar = ""){ $var = $initVar; if(isset($_POST[$name])) $var = $_POST[$name]; return($var); } //------------------------------------------------------------ public static function getGetVar($name,$initVar = ""){ $var = $initVar; if(isset($_GET[$name])) $var = $_GET[$name]; return($var); } public static function sortByOrder($a, $b) { return $a['order'] - $b['order']; } /** * validate that some file exists, if not - throw error */ public static function validateFilepath($filepath,$errorPrefix=null){ if(file_exists($filepath) == true) return(false); if($errorPrefix == null) $errorPrefix = "File"; $message = $errorPrefix." ".esc_attr($filepath)." not exists!"; self::throwError($message); } /** * validate that some value is numeric */ public static function validateNumeric($val,$fieldName=""){ self::validateNotEmpty($val,$fieldName); if(empty($fieldName)) $fieldName = "Field"; if(!is_numeric($val)) self::throwError("$fieldName should be numeric "); } /** * validate that some variable not empty */ public static function validateNotEmpty($val,$fieldName=""){ if(empty($fieldName)) $fieldName = "Field"; if(empty($val) && is_numeric($val) == false) self::throwError("Field $fieldName should not be empty"); } //------------------------------------------------------------ //get path info of certain path with all needed fields public static function getPathInfo($filepath){ $info = pathinfo($filepath); //fix the filename problem if(!isset($info["filename"])){ $filename = $info["basename"]; if(isset($info["extension"])) $filename = substr($info["basename"],0,(-strlen($info["extension"])-1)); $info["filename"] = $filename; } return($info); } /** * Convert std class to array, with all sons * @param unknown_type $arr */ public static function convertStdClassToArray($arr){ $arr = (array)$arr; $arrNew = array(); foreach($arr as $key=>$item){ $item = (array)$item; $arrNew[$key] = $item; } return($arrNew); } public static function cleanStdClassToArray($arr){ $arr = (array)$arr; $arrNew = array(); foreach($arr as $key=>$item){ $arrNew[$key] = $item; } return($arrNew); } /** * encode array into json for client side */ public static function jsonEncodeForClientSide($arr){ $json = ""; if(!empty($arr)){ $json = json_encode($arr); $json = addslashes($json); } if(empty($json)) $json = '{}'; $json = "'".$json."'"; return($json); } /** * decode json from the client side */ public static function jsonDecodeFromClientSide($data){ $data = stripslashes($data); $data = str_replace('\"','\"',$data); $data = json_decode($data); $data = (array)$data; return($data); } /** * do "trim" operation on all array items. */ public static function trimArrayItems($arr){ if(gettype($arr) != "array") RevSliderFunctions::throwError("trimArrayItems error: The type must be array"); foreach ($arr as $key=>$item){ if(is_array($item)){ foreach($item as $key => $value){ $arr[$key][$key] = trim($value); } }else{ $arr[$key] = trim($item); } } return($arr); } /** * get link html */ public static function getHtmlLink($link,$text,$id="",$class=""){ if(!empty($class)) $class = " class='$class'"; if(!empty($id)) $id = " id='$id'"; $html = "$text"; return($html); } /** * get select from array */ public static function getHTMLSelect($arr,$default="",$htmlParams="",$assoc = false){ $html = ""; return($html); } /** * convert assoc array to array */ public static function assocToArray($assoc){ $arr = array(); foreach($assoc as $item) $arr[] = $item; return($arr); } /** * * strip slashes from textarea content after ajax request to server */ public static function normalizeTextareaContent($content){ if(empty($content)) return($content); $content = stripslashes($content); $content = trim($content); return($content); } /** * get text intro, limit by number of words */ public static function getTextIntro($text, $limit){ $arrIntro = explode(' ', $text, $limit); if (count($arrIntro)>=$limit) { array_pop($arrIntro); $intro = implode(" ",$arrIntro); $intro = trim($intro); if(!empty($intro)) $intro .= '...'; } else { $intro = implode(" ",$arrIntro); } $intro = preg_replace('`\[[^\]]*\]`','',$intro); return($intro); } /** * add missing px/% to value, do also for object and array * @since: 5.0 **/ public static function add_missing_val($obj, $set_to = 'px'){ if(is_array($obj)){ foreach($obj as $key => $value){ if(strpos($value, $set_to) === false){ $obj[$key] = $value.$set_to; } } }elseif(is_object($obj)){ foreach($obj as $key => $value){ if(strpos($value, $set_to) === false){ $obj->$key = $value.$set_to; } } }else{ if(strpos($obj, $set_to) === false){ $obj .= $set_to; } } return $obj; } /** * normalize object with device informations depending on what is enabled for the Slider * @since: 5.0 **/ public static function normalize_device_settings($obj, $enabled_devices, $return = 'obj', $set_to_if = array()){ //array -> from -> to /*desktop notebook tablet mobile*/ if(!empty($set_to_if)){ foreach($obj as $key => $value) { foreach($set_to_if as $from => $to){ if(trim($value) == $from) $obj->$key = $to; } } } $inherit_size = self::get_biggest_device_setting($obj, $enabled_devices); if($enabled_devices['desktop'] == 'on'){ if(!isset($obj->desktop) || $obj->desktop === ''){ $obj->desktop = $inherit_size; }else{ $inherit_size = $obj->desktop; } }else{ $obj->desktop = $inherit_size; } if($enabled_devices['notebook'] == 'on'){ if(!isset($obj->notebook) || $obj->notebook === ''){ $obj->notebook = $inherit_size; }else{ $inherit_size = $obj->notebook; } }else{ $obj->notebook = $inherit_size; } if($enabled_devices['tablet'] == 'on'){ if(!isset($obj->tablet) || $obj->tablet === ''){ $obj->tablet = $inherit_size; }else{ $inherit_size = $obj->tablet; } }else{ $obj->tablet = $inherit_size; } if($enabled_devices['mobile'] == 'on'){ if(!isset($obj->mobile) || $obj->mobile === ''){ $obj->mobile = $inherit_size; }else{ $inherit_size = $obj->mobile; } }else{ $obj->mobile = $inherit_size; } switch($return){ case 'obj': //order according to: desktop, notebook, tablet, mobile $new_obj = new stdClass(); $new_obj->desktop = $obj->desktop; $new_obj->notebook = $obj->notebook; $new_obj->tablet = $obj->tablet; $new_obj->mobile = $obj->mobile; return $new_obj; break; case 'html-array': if($obj->desktop === $obj->notebook && $obj->desktop === $obj->mobile && $obj->desktop === $obj->tablet){ return $obj->desktop; }else{ return "['".@$obj->desktop."','".@$obj->notebook."','".@$obj->tablet."','".@$obj->mobile."']"; } break; } return $obj; } /** * return biggest value of object depending on which devices are enabled * @since: 5.0 **/ public static function get_biggest_device_setting($obj, $enabled_devices){ if($enabled_devices['desktop'] == 'on'){ if(isset($obj->desktop) && $obj->desktop != ''){ return $obj->desktop; } } if($enabled_devices['notebook'] == 'on'){ if(isset($obj->notebook) && $obj->notebook != ''){ return $obj->notebook; } } if($enabled_devices['tablet'] == 'on'){ if(isset($obj->tablet) && $obj->tablet != ''){ return $obj->tablet; } } if($enabled_devices['mobile'] == 'on'){ if(isset($obj->mobile) && $obj->mobile != ''){ return $obj->mobile; } } return ''; } /** * change hex to rgba */ public static function hex2rgba($hex, $transparency = false, $raw = false, $do_rgb = false) { if($transparency !== false){ $transparency = ($transparency > 0) ? number_format( ( $transparency / 100 ), 2, ".", "" ) : 0; }else{ $transparency = 1; } $hex = str_replace("#", "", $hex); if(strlen($hex) == 3) { $r = hexdec(substr($hex,0,1).substr($hex,0,1)); $g = hexdec(substr($hex,1,1).substr($hex,1,1)); $b = hexdec(substr($hex,2,1).substr($hex,2,1)); } else if(self::isrgb($hex)){ return $hex; } else { $r = hexdec(substr($hex,0,2)); $g = hexdec(substr($hex,2,2)); $b = hexdec(substr($hex,4,2)); } if($do_rgb){ $ret = $r.', '.$g.', '.$b; }else{ $ret = $r.', '.$g.', '.$b.', '.$transparency; } if($raw){ return $ret; }else{ return 'rgba('.$ret.')'; } } public static function isrgb($rgba){ if(strpos($rgba, 'rgb') !== false) return true; return false; } /** * change rgba to hex * @since: 5.0 */ public static function rgba2hex($rgba){ if(strtolower($rgba) == 'transparent') return $rgba; $temp = explode(',', $rgba); $rgb = array(); if(count($temp) == 4) unset($temp[3]); foreach($temp as $val){ $t = dechex(preg_replace('/[^\d.]/', '', $val)); if(strlen($t) < 2) $t = '0'.$t; $rgb[] = $t; } return '#'.implode('', $rgb); } /** * get transparency from rgba * @since: 5.0 */ public static function get_trans_from_rgba($rgba, $in_percent = false){ if(strtolower($rgba) == 'transparent') return 100; $temp = explode(',', $rgba); if(count($temp) == 4){ return ($in_percent) ? preg_replace('/[^\d.]/', '', $temp[3]) : preg_replace('/[^\d.]/', "", $temp[3]) * 100; } return 100; } public static function get_responsive_size($slider){ $operations = new RevSliderOperations(); $arrValues = $operations->getGeneralSettingsValues(); $enable_custom_size_notebook = $slider->slider->getParam('enable_custom_size_notebook','off'); $enable_custom_size_tablet = $slider->slider->getParam('enable_custom_size_tablet','off'); $enable_custom_size_iphone = $slider->slider->getParam('enable_custom_size_iphone','off'); $adv_resp_sizes = ($enable_custom_size_notebook == 'on' || $enable_custom_size_tablet == 'on' || $enable_custom_size_iphone == 'on') ? true : false; if($adv_resp_sizes == true){ $width = $slider->slider->getParam("width", 1240, RevSlider::FORCE_NUMERIC); $width .= ','. $slider->slider->getParam("width_notebook", 1024, RevSlider::FORCE_NUMERIC); $width .= ','. $slider->slider->getParam("width_tablet", 778, RevSlider::FORCE_NUMERIC); $width .= ','. $slider->slider->getParam("width_mobile", 480, RevSlider::FORCE_NUMERIC); $height = $slider->slider->getParam("height", 868, RevSlider::FORCE_NUMERIC); $height .= ','. $slider->slider->getParam("height_notebook", 768, RevSlider::FORCE_NUMERIC); $height .= ','. intval($slider->slider->getParam("height_tablet", 960, RevSlider::FORCE_NUMERIC)); $height .= ','. intval($slider->slider->getParam("height_mobile", 720, RevSlider::FORCE_NUMERIC)); $responsive = (isset($arrValues['width'])) ? $arrValues['width'] : '1240'; $def = (isset($arrValues['width'])) ? $arrValues['width'] : '1240'; $responsive.= ','; if($enable_custom_size_notebook == 'on'){ $responsive.= (isset($arrValues['width_notebook'])) ? $arrValues['width_notebook'] : '1024'; $def = (isset($arrValues['width_notebook'])) ? $arrValues['width_notebook'] : '1024'; }else{ $responsive.= $def; } $responsive.= ','; if($enable_custom_size_tablet == 'on'){ $responsive.= (isset($arrValues['width_tablet'])) ? $arrValues['width_tablet'] : '778'; $def = (isset($arrValues['width_tablet'])) ? $arrValues['width_tablet'] : '778'; }else{ $responsive.= $def; } $responsive.= ','; if($enable_custom_size_iphone == 'on'){ $responsive.= (isset($arrValues['width_mobile'])) ? $arrValues['width_mobile'] : '480'; $def = (isset($arrValues['width_mobile'])) ? $arrValues['width_mobile'] : '480'; }else{ $responsive.= $def; } return array( 'level' => $responsive, 'height' => $height, 'width' => $width ); }else{ $responsive = (isset($arrValues['width'])) ? $arrValues['width'] : '1240'; $def = (isset($arrValues['width'])) ? $arrValues['width'] : '1240'; $responsive.= ','; $responsive.= (isset($arrValues['width_notebook'])) ? $arrValues['width_notebook'] : '1024'; $responsive.= ','; $responsive.= (isset($arrValues['width_tablet'])) ? $arrValues['width_tablet'] : '778'; $responsive.= ','; $responsive.= (isset($arrValues['width_mobile'])) ? $arrValues['width_mobile'] : '480'; return array( 'visibilitylevel' => $responsive, 'height' => $slider->slider->getParam("height", "868", RevSlider::FORCE_NUMERIC), 'width' => $slider->slider->getParam("width", "1240", RevSlider::FORCE_NUMERIC) ); } } } if(!function_exists("dmp")){ function dmp($str){ echo "
    "; echo "
    ";
    		print_r($str);
    		echo "
    "; echo "
    "; } } /** * old classname extends new one (old classnames will be obsolete soon) * @since: 5.0 **/ class UniteFunctionsRev extends RevSliderFunctions {} ?>