function acf_qtranslate_plugin_format_value_for_api($value)
{
    if (acf_qtranslate_enabled() && is_string($value)) {
        $value = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
    }
    return $value;
}
示例#2
0
 function format_value_for_api($value, $post_id, $field)
 {
     if (acf_qtranslate_enabled()) {
         $value = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
     }
     return acf_field_textarea::format_value_for_api($value, $post_id, $field);
 }
示例#3
0
 /**
  * This filter is applied to the $value after it is loaded from the db and
  * before it is returned to the template via functions such as get_field().
  */
 public function format_value_for_api($value)
 {
     if (is_string($value)) {
         $value = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
     }
     return $value;
 }
示例#4
0
 protected function qTrans($output)
 {
     if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         $output = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($output);
     }
     return $output;
 }
 public function translate($text)
 {
     if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
     } else {
         return qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
     }
 }
示例#6
0
文件: lang.php 项目: slavic18/cats
 public function filterLang($text, $lang = NULL)
 {
     if (!empty($lang) && function_exists('qtrans_use')) {
         return qtrans_use($lang, $text);
     }
     if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         return qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
     }
     return $text;
 }
示例#7
0
文件: options.php 项目: alx/Tetalab
 function get_options()
 {
     $saved_options = unserialize(get_option('arras_options'));
     if (!empty($saved_options) && is_object($saved_options)) {
         foreach ($saved_options as $name => $value) {
             // Apply filters if qTranslate is enabled
             if (function_exists('qtrans_init') && (!isset($_GET['page']) || $_GET['page'] != 'arras-options')) {
                 $value = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
             }
             $this->{$name} = $value;
         }
     }
 }
示例#8
0
 /**
  * @param int $postId
  * @param string $metaId
  * @param bool $single
  * @return mixed
  */
 public function find($postId, $metaId, $single = true)
 {
     $metaId = $this->gummOptionId($metaId, true);
     $meta = false;
     if (strpos($metaId, '.') !== false) {
         $parts = explode('.', $metaId);
         $rootId = array_shift($parts);
         $rootMetaData = get_post_meta($postId, $rootId, $single);
         $metaXPath = implode('.', $parts);
         $meta = Set::classicExtract($rootMetaData, $metaXPath);
         if ($meta === null || $rootMetaData === '' && !$meta) {
             $meta = false;
         }
     } else {
         $meta = get_post_meta($postId, $metaId, $single);
         // if ($postId == 442 && $metaId == 'nova_postmeta') {
         //     debug(get_post_meta(442, 'nova_postmeta'), true);
         //     d($meta);
         // } else {
         //     debug($postId);
         //     debug($metaId);
         // }
     }
     // debug($metaId);
     $_post = get_post($postId);
     $friendlyId = $this->friendlyOptionId($metaId);
     $postTypes = array($_post->post_type);
     if (in_array($_post->post_type, $this->Post->getPostTypes())) {
         $postTypes[] = 'single';
     }
     if (!$meta && isset($this->_schema[$friendlyId])) {
         $meta = $this->_schema[$friendlyId];
     } elseif ($friendlyId == 'postmeta') {
         foreach ($postTypes as $postType) {
             if (isset($this->_schema[$postType]) && isset($this->_schema[$postType]['postmeta'])) {
                 if (!$meta) {
                     $meta = $this->_schema[$postType]['postmeta'];
                 } else {
                     $meta = array_merge($this->_schema[$postType]['postmeta'], (array) $meta);
                 }
                 if (is_array($meta)) {
                     $meta = Set::booleanize($meta);
                 }
             }
         }
     }
     if ($meta && !is_admin() && function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         $meta = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($meta);
     }
     return $meta;
 }
示例#9
0
function qtrans_fixAdminBar($wp_admin_bar)
{
    global $wp_admin_bar;
    $nodes = $wp_admin_bar->get_nodes();
    if (is_array($nodes)) {
        foreach ($wp_admin_bar->get_nodes() as $node) {
            $wp_admin_bar->add_node(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($node));
        }
    }
}
function relevanssi_do_query(&$query)
{
    // this all is basically lifted from Kenny Katzgrau's wpSearch
    // thanks, Kenny!
    global $relevanssi_active;
    $relevanssi_active = true;
    $posts = array();
    if (function_exists('mb_strtolower')) {
        $q = trim(stripslashes(mb_strtolower($query->query_vars["s"])));
    } else {
        $q = trim(stripslashes(strtolower($query->query_vars["s"])));
    }
    $cache = get_option('relevanssi_enable_cache');
    $cache == 'on' ? $cache = true : ($cache = false);
    if (isset($query->query_vars['searchblogs'])) {
        $search_blogs = $query->query_vars['searchblogs'];
        $post_type = false;
        if (isset($query->query_vars["post_type"]) && $query->query_vars["post_type"] != 'any') {
            $post_type = $query->query_vars["post_type"];
        }
        if (isset($query->query_vars["post_types"]) && $query->query_vars["post_types"] != 'any') {
            $post_type = $query->query_vars["post_types"];
        }
        if (function_exists('relevanssi_search_multi')) {
            $return = relevanssi_search_multi($q, $search_blogs, $post_type);
        }
    } else {
        $tax_query = array();
        $tax_query_relation = apply_filters('relevanssi_default_tax_query_relation', 'OR');
        if (isset($query->tax_query) && empty($query->tax_query->queries)) {
            // Tax query is empty, let's get rid of it.
            $query->tax_query = null;
        }
        if (isset($query->query_vars['tax_query'])) {
            // This is user-created tax_query array as described in WP Codex
            foreach ($query->query_vars['tax_query'] as $type => $item) {
                if (is_string($type) && $type == 'relation') {
                    $tax_query_relation = $item;
                } else {
                    $tax_query[] = $item;
                }
            }
        } else {
            if (isset($query->tax_query)) {
                // This is the WP-created Tax_Query object, which is different from above
                foreach ($query->tax_query as $type => $item) {
                    if (is_string($type) && $type == 'relation') {
                        $tax_query_relation = $item;
                    }
                    if (is_string($type) && $type == 'queries') {
                        foreach ($item as $tax_query_row) {
                            $tax_query[] = $tax_query_row;
                        }
                    }
                }
            } else {
                $cat = false;
                if (isset($query->query_vars["cats"])) {
                    $cat = $query->query_vars["cats"];
                }
                if (empty($cat)) {
                    $cat = get_option('relevanssi_cat');
                    if (0 == $cat) {
                        $cat = false;
                    }
                }
                if ($cat) {
                    $cat = explode(',', $cat);
                    $tax_query[] = array('taxonomy' => 'category', 'field' => 'id', 'terms' => $cat);
                }
                if (!empty($query->query_vars['category_name']) && empty($query->query_vars['category__in'])) {
                    $cat = explode(',', $query->query_vars['category_name']);
                    $tax_query[] = array('taxonomy' => 'category', 'field' => 'slug', 'terms' => $cat);
                }
                if (!empty($query->query_vars['category__in'])) {
                    $tax_query[] = array('taxonomy' => 'category', 'field' => 'id', 'terms' => $query->query_vars['category__in']);
                }
                if (!empty($query->query_vars['category__not_in'])) {
                    $tax_query[] = array('taxonomy' => 'category', 'field' => 'id', 'terms' => $query->query_vars['category__not_in'], 'operator' => 'NOT IN');
                }
                if (!empty($query->query_vars['category__and'])) {
                    $tax_query[] = array('taxonomy' => 'category', 'field' => 'id', 'terms' => $query->query_vars['category__and'], 'operator' => 'AND', 'include_children' => false);
                }
                $excat = get_option('relevanssi_excat');
                if (isset($excat) && $excat != 0) {
                    $tax_query[] = array('taxonomy' => 'category', 'field' => 'id', 'terms' => $excat, 'operator' => 'NOT IN');
                }
                $tag = false;
                if (isset($query->query_vars["tags"])) {
                    $tag = $query->query_vars["tags"];
                }
                if ($tag) {
                    if (strpos($tag, '+') !== false) {
                        $tag = explode('+', $tag);
                        $operator = 'and';
                    } else {
                        $tag = explode(',', $tag);
                        $operator = 'or';
                    }
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $tag, 'operator' => $operator);
                }
                if (!empty($query->query_vars['tag_id'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $query->query_vars['tag_id']);
                }
                if (!empty($query->query_vars['tag_id'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $query->query_vars['tag_id']);
                }
                if (!empty($query->query_vars['tag__in'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $query->query_vars['tag__in']);
                }
                if (!empty($query->query_vars['tag__not_in'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $query->query_vars['tag__not_in'], 'operator' => 'NOT IN');
                }
                if (!empty($query->query_vars['tag__and'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $query->query_vars['tag__and'], 'operator' => 'AND');
                }
                if (!empty($query->query_vars['tag__not_in'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'id', 'terms' => $query->query_vars['tag__not_in'], 'operator' => 'NOT IN');
                }
                if (!empty($query->query_vars['tag_slug__in'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'slug', 'terms' => $query->query_vars['tag_slug__in']);
                }
                if (!empty($query->query_vars['tag_slug__not_in'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'slug', 'terms' => $query->query_vars['tag_slug__not_in'], 'operator' => 'NOT IN');
                }
                if (!empty($query->query_vars['tag_slug__and'])) {
                    $tax_query[] = array('taxonomy' => 'post_tag', 'field' => 'slug', 'terms' => $query->query_vars['tag_slug__and'], 'operator' => 'AND');
                }
                if (isset($query->query_vars["taxonomy"])) {
                    if (function_exists('relevanssi_process_taxonomies')) {
                        $tax_query = relevanssi_process_taxonomies($query->query_vars["taxonomy"], $query->query_vars["term"], $tax_query);
                    } else {
                        if (!empty($query->query_vars["term"])) {
                            $term = $query->query_vars["term"];
                        }
                        $tax_query[] = array('taxonomy' => $query->query_vars["taxonomy"], 'field' => 'slug', 'terms' => $term);
                    }
                }
            }
        }
        $author = false;
        if (!empty($query->query_vars["author"])) {
            $author = explode(',', $query->query_vars["author"]);
        }
        if (!empty($query->query_vars["author_name"])) {
            $author_object = get_user_by('slug', $query->query_vars["author_name"]);
            $author[] = $author_object->ID;
        }
        $post_query = array();
        if (!empty($query->query_vars['post__in'])) {
            $post_query = array('in' => $query->query_vars['post__in']);
        }
        if (!empty($query->query_vars['post__not_in'])) {
            $post_query = array('not in' => $query->query_vars['post__not_in']);
        }
        $meta_query = array();
        $meta_query_relation = apply_filters('relevanssi_default_meta_query_relation', 'AND');
        if (!empty($query->query_vars["meta_query"])) {
            $meta_query = $query->query_vars["meta_query"];
        }
        if (isset($query->query_vars["customfield_key"])) {
            isset($query->query_vars["customfield_value"]) ? $value = $query->query_vars["customfield_value"] : ($value = null);
            $meta_query[] = array('key' => $query->query_vars["customfield_key"], 'value' => $value, 'compare' => '=');
        }
        if (!empty($query->query_vars["meta_key"]) || !empty($query->query_vars["meta_value"]) || !empty($query->query_vars["meta_value_num"])) {
            $value = null;
            if (!empty($query->query_vars["meta_value"])) {
                $value = $query->query_vars["meta_value"];
            }
            if (!empty($query->query_vars["meta_value_num"])) {
                $value = $query->query_vars["meta_value_num"];
            }
            !empty($query->query_vars["meta_compare"]) ? $compare = $query->query_vars["meta_compare"] : ($compare = '=');
            $meta_query[] = array('key' => $query->query_vars["meta_key"], 'value' => $value, 'compare' => $compare);
        }
        $search_blogs = false;
        if (isset($query->query_vars["search_blogs"])) {
            $search_blogs = $query->query_vars["search_blogs"];
        }
        $post_type = false;
        if (isset($query->query_vars["post_type"]) && $query->query_vars["post_type"] != 'any') {
            $post_type = $query->query_vars["post_type"];
        }
        if (isset($query->query_vars["post_types"]) && $query->query_vars["post_types"] != 'any') {
            $post_type = $query->query_vars["post_types"];
        }
        if ($post_type == -1) {
            $post_type = false;
        }
        $expids = get_option("relevanssi_exclude_posts");
        if (is_admin()) {
            // in admin search, search everything
            $excat = null;
            $expids = null;
        }
        $operator = "";
        if (function_exists('relevanssi_set_operator')) {
            $operator = relevanssi_set_operator($query);
            $operator = strtoupper($operator);
            // just in case
        }
        if ($operator != "OR" && $operator != "AND") {
            $operator = get_option("relevanssi_implicit_operator");
        }
        isset($query->query_vars['orderby']) ? $orderby = $query->query_vars['orderby'] : ($orderby = null);
        isset($query->query_vars['order']) ? $order = $query->query_vars['order'] : ($order = null);
        // Add synonyms
        // This is done here so the new terms will get highlighting
        if ("OR" == $operator) {
            // Synonyms are only used in OR queries
            $q = relevanssi_add_synonyms($q);
        }
        if ($cache) {
            $params = md5(serialize(array($q, $tax_query, $tax_query_relation, $post_query, $meta_query, $expids, $post_type, $operator, $search_blogs, $author, $orderby, $order)));
            $return = relevanssi_fetch_hits($params);
            if (!$return) {
                $return = relevanssi_search($q, $tax_query, $tax_query_relation, $post_query, $meta_query, $expids, $post_type, $operator, $search_blogs, $author, $orderby, $order);
                $return_ser = serialize($return);
                relevanssi_store_hits($params, $return_ser);
            }
        } else {
            $return = relevanssi_search($q, $tax_query, $tax_query_relation, $post_query, $meta_query, $expids, $post_type, $operator, $search_blogs, $author, $orderby, $order);
        }
    }
    isset($return['hits']) ? $hits = $return['hits'] : ($hits = array());
    isset($return['query']) ? $q = $return['query'] : ($q = "");
    $filter_data = array($hits, $q);
    $hits_filters_applied = apply_filters('relevanssi_hits_filter', $filter_data);
    $hits = $hits_filters_applied[0];
    $query->found_posts = sizeof($hits);
    if ($query->query_vars["posts_per_page"] == 0) {
        // assume something sensible to prevent "division by zero error";
        $query->query_vars["posts_per_page"] = -1;
    }
    if ($query->query_vars["posts_per_page"] == -1) {
        $query->max_num_pages = sizeof($hits);
    } else {
        $query->max_num_pages = ceil(sizeof($hits) / $query->query_vars["posts_per_page"]);
    }
    $update_log = get_option('relevanssi_log_queries');
    if ('on' == $update_log) {
        relevanssi_update_log($q, sizeof($hits));
    }
    $make_excerpts = get_option('relevanssi_excerpts');
    if ($query->is_admin) {
        $make_excerpts = false;
    }
    if ($query->query_vars['paged'] > 0) {
        $wpSearch_low = ($query->query_vars['paged'] - 1) * $query->query_vars["posts_per_page"];
    } else {
        $wpSearch_low = 0;
    }
    if ($query->query_vars["posts_per_page"] == -1) {
        $wpSearch_high = sizeof($hits);
    } else {
        $wpSearch_high = $wpSearch_low + $query->query_vars["posts_per_page"] - 1;
    }
    if (isset($query->query_vars['offset']) && $query->query_vars['offset'] > 0) {
        $wpSearch_high += $query->query_vars['offset'];
        $wpSearch_low += $query->query_vars['offset'];
    }
    if ($wpSearch_high > sizeof($hits)) {
        $wpSearch_high = sizeof($hits);
    }
    for ($i = $wpSearch_low; $i <= $wpSearch_high; $i++) {
        if (isset($hits[intval($i)])) {
            $post = $hits[intval($i)];
        } else {
            continue;
        }
        if ($post == NULL) {
            // apparently sometimes you can get a null object
            continue;
        }
        //Added by OdditY - Highlight Result Title too ->
        if ("on" == get_option('relevanssi_hilite_title')) {
            if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
                $post->post_title = strip_tags(qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title));
            } else {
                $post->post_title = strip_tags($post->post_title);
            }
            $highlight = get_option('relevanssi_highlight');
            if ("none" != $highlight) {
                if (!is_admin()) {
                    $post->post_title = relevanssi_highlight_terms($post->post_title, $q);
                }
            }
        }
        // OdditY end <-
        if ('on' == $make_excerpts) {
            if ($cache) {
                $post->post_excerpt = relevanssi_fetch_excerpt($post->ID, $q);
                if ($post->post_excerpt == null) {
                    $post->post_excerpt = relevanssi_do_excerpt($post, $q);
                    relevanssi_store_excerpt($post->ID, $q, $post->post_excerpt);
                }
            } else {
                $post->post_excerpt = relevanssi_do_excerpt($post, $q);
            }
            if ('on' == get_option('relevanssi_show_matches')) {
                $post->post_excerpt .= relevanssi_show_matches($return, $post->ID);
            }
        }
        if (isset($return['scores'][$post->ID])) {
            $post->relevance_score = round($return['scores'][$post->ID], 2);
        }
        $posts[] = $post;
    }
    $query->posts = $posts;
    $query->post_count = count($posts);
    return $posts;
}
 /**
  * Sends the notification message to a given user
  */
 public function notify_user($_post_ID = 0, $_email = '', $_comment_ID = 0)
 {
     // Retrieve the options from the database
     $from_name = html_entity_decode(stripslashes(get_option('subscribe_reloaded_from_name', 'admin')), ENT_QUOTES, 'UTF-8');
     $from_email = get_option('subscribe_reloaded_from_email', get_bloginfo('admin_email'));
     $subject = html_entity_decode(stripslashes(get_option('subscribe_reloaded_notification_subject', 'There is a new comment on the post [post_title]')), ENT_QUOTES, 'UTF-8');
     $message = html_entity_decode(stripslashes(get_option('subscribe_reloaded_notification_content', '')), ENT_COMPAT, 'UTF-8');
     $manager_link = get_bloginfo('url') . get_option('subscribe_reloaded_manager_page', '/comment-subscriptions/');
     if (function_exists('qtrans_convertURL')) {
         $manager_link = qtrans_convertURL($manager_link);
     }
     $clean_email = $this->clean_email($_email);
     $subscriber_salt = $this->generate_temp_key($clean_email);
     $manager_link .= (strpos($manager_link, '?') !== false ? '&' : '?') . "sre=" . $this->get_subscriber_key($clean_email) . "&srk={$subscriber_salt}";
     $headers = "From: {$from_name} <{$from_email}>\n";
     $content_type = get_option('subscribe_reloaded_enable_html_emails', 'no') == 'yes' ? 'text/html' : 'text/plain';
     $headers .= "Content-Type: {$content_type}; charset=" . get_bloginfo('charset') . "\n";
     if (get_option('subscribe_reloaded_admin_bcc', 'no') == 'yes') {
         $headers .= "Bcc: {$from_name} <{$from_email}>\n";
     }
     $post = get_post($_post_ID);
     $comment = get_comment($_comment_ID);
     $post_permalink = get_permalink($_post_ID);
     $comment_permalink = get_comment_link($_comment_ID);
     $comment_reply_permalink = get_permalink($_post_ID) . '?replytocom=' . $_comment_ID . '#respond';
     $comment_content = $comment->comment_content;
     // Add HTML paragraph tags to comment
     // See wp-includes/formatting.php for details on the wpautop() function
     if ($content_type == 'text/html') {
         $comment_content = wpautop($comment->comment_content);
     }
     // Replace tags with their actual values
     $subject = str_replace('[post_title]', $post->post_title, $subject);
     $message = str_replace('[post_permalink]', $post_permalink, $message);
     $message = str_replace('[comment_permalink]', $comment_permalink, $message);
     $message = str_replace('[comment_reply_permalink]', $comment_reply_permalink, $message);
     $message = str_replace('[comment_author]', $comment->comment_author, $message);
     $message = str_replace('[comment_content]', $comment_content, $message);
     $message = str_replace('[manager_link]', $manager_link, $message);
     // QTranslate support
     if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         $subject = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($subject);
         $message = str_replace('[post_title]', qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($post->post_title), $message);
         $message = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($message);
     } else {
         $message = str_replace('[post_title]', $post->post_title, $message);
     }
     $message = apply_filters('stcr_notify_user_message', $message, $_post_ID, $_email, $_comment_ID);
     if ($content_type == 'text/html') {
         if (get_option('subscribe_reloaded_htmlify_message_links') == 'yes') {
             $message = $this->htmlify_message_links($message);
         }
         $message = $this->wrap_html_message($message, $subject);
     }
     wp_mail($clean_email, $subject, $message, $headers);
 }
function ym_membership_content_page($with_boxes = false, $with_snippets = TRUE, $with_expires = FALSE, $show = 'posts,bundles,premium')
{
    get_currentuserinfo();
    global $current_user, $wpdb, $ym_res;
    $snippet_length = 200;
    $max_loops = 30;
    $html = '';
    $membership_level = ym_get_user_package_type($current_user->ID);
    $posts = false;
    $show = explode(',', $show);
    if (in_array('posts', $show)) {
        if ($pp = ym_render_my_purchased_posts($current_user->ID, false, true, $with_expires, $with_snippets)) {
            if ($with_boxes) {
                $html .= ym_start_box(__('My Purchased Posts', 'ym'));
            }
            $html .= $pp;
            if ($with_boxes) {
                $html .= ym_end_box();
            }
        }
    }
    if (in_array('bundles', $show)) {
        // bundle
        if ($bundles = ym_render_my_purchased_bundles($current_user->ID, $with_expires, TRUE, $with_snippets)) {
            if ($with_boxes) {
                $html .= ym_start_box(__('My Purchased Bundles', 'ym'));
            }
            $html .= $bundles;
            if ($with_boxes) {
                $html .= ym_end_box();
            }
        }
    }
    if (in_array('premium', $show)) {
        $sql = 'SELECT DISTINCT(ID), post_title, post_date, post_content
				FROM
					' . $wpdb->posts . ' p
					JOIN ' . $wpdb->postmeta . ' pm ON (
						p.ID = pm.post_id
						AND p.post_status = "publish"
						AND pm.meta_key = "_ym_account_type"
						AND pm.meta_value LIKE "%' . $membership_level . '%"
						AND post_type = "post"
					)
				ORDER BY post_date DESC';
        $results = $wpdb->get_results($sql);
        $loops = 0;
        if ($members_pages = count($results)) {
            foreach ($results as $id => $obj) {
                if (!ym_user_has_access($obj->ID)) {
                    $membership_pages--;
                    continue;
                }
                $published = date(YM_DATEFORMAT, strtotime($obj->post_date));
                $full_content = apply_filters('the_content', $obj->post_content);
                $title = $obj->post_title;
                if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
                    $title = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($title);
                    $full_content = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($full_content);
                }
                $row = '<tr>
				<td style="border-top: 1px solid silver;">
					<div style="margin-bottom: 5px;"><a href="' . get_permalink($obj->ID) . '">' . $title . '</a></div>
					';
                if ($with_snippets) {
                    $content = substr(strip_tags($full_content), 0, $snippet_length);
                    //$content = preg_replace("'\[/?\s?private\s?\]'i",'', $content);
                    $ending = strlen($full_content) > strip_tags($snippet_length) ? '...' : '';
                    $row .= '<div style="font-size: 10px; margin-bottom: 5px;">' . $content . $ending . '</div>';
                }
                $row .= '
				</td>
				<td style="vertical-align: top; border-top: 1px solid silver;">' . $published . '</td>
			</tr>';
                $posts .= $row;
                $loops++;
                if ($loops >= $max_loops) {
                    break;
                }
            }
        }
        $table_intro = 'Showing the most recent ' . $loops . ' posts of a total ' . $members_pages . ' available to you.';
        $html .= $ym_res->members_content_divider_html;
        if ($with_boxes) {
            $html .= ym_start_box(__('Premium Content', 'ym'));
        }
        $html .= '	<div class="premium_content_intro">' . __('Your membership level is:', "ym") . ' <strong>' . $membership_level . '</strong>. 	
				' . __('You have access to a total of', "ym") . ' ' . $members_pages . ' ' . __('premium', 'ym') . ' ' . ($members_pages == 1 ? __('post', 'ym') : __('posts', 'ym')) . ' 
			</div>';
        if ($members_pages > 0) {
            $html .= $table_intro;
            $html .= '<div style="padding-top: 10px; margin-bottom: 10px;">
				<table style="width: 100%" cellspacing="0" cellpadding="2">
				<tr>
					<th style="text-align: left;">Post Title</th>
					<th style="width: 160px; text-align: left;">Published</th>
				</tr>
					' . $posts . '
			</table></div>';
        }
        if ($with_boxes) {
            $html .= ym_end_box();
        }
    }
    return $html;
}
 function get_summary($id, $instance)
 {
     if (!is_numeric($id)) {
         return false;
     }
     global $wpdb;
     $excerpt = "";
     $result = "";
     $result = $wpdb->get_results("SELECT post_excerpt FROM {$wpdb->posts} WHERE ID = " . $id, ARRAY_A);
     if (empty($result[0]['post_excerpt'])) {
         // no custom excerpt defined, how lazy of you!
         $result = $wpdb->get_results("SELECT post_content FROM {$wpdb->posts} WHERE ID = " . $id, ARRAY_A);
         $excerpt = preg_replace("/\\[caption.*\\[\\/caption\\]/", "", $result[0]['post_content']);
     } else {
         // user has defined a custom excerpt, yay!
         $excerpt = preg_replace("/\\[caption.*\\[\\/caption\\]/", "", $result[0]['post_excerpt']);
     }
     // RRR added call to the_content filters, allows qTranslate to hook in.
     if ($this->qTrans) {
         $excerpt = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($excerpt);
     }
     // remove flash objects
     $excerpt = preg_replace("/<object[0-9 a-z_?*=\":\\-\\/\\.#\\,\\n\\r\\t]+/smi", "", $excerpt);
     // remove shortcodes
     $excerpt = strip_shortcodes($excerpt);
     if ($instance['post-excerpt']['keep_format']) {
         $excerpt = strip_tags($excerpt, '<a><b><i><strong><em>');
     } else {
         $excerpt = strip_tags($excerpt);
     }
     if (strlen($excerpt) > $instance['post-excerpt']['length']) {
         $excerpt = $this->truncate($excerpt, $instance['post-excerpt']['length'], '', true, true);
     }
     return $excerpt;
 }
示例#14
0
文件: core.php 项目: ayoayco/upbeat
 /**
  * Support for i18n with wpml, polyglot or qtrans
  *
  * @param string $in
  * @param string $name (optional) required for wpml to determine the type of translation
  * @return string $in localized
  */
 static function i18n($in, $name = null)
 {
     if (function_exists('langswitch_filter_langs_with_message')) {
         $in = langswitch_filter_langs_with_message($in);
     }
     if (function_exists('polyglot_filter')) {
         $in = polyglot_filter($in);
     }
     if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
     }
     if (is_string($name) && !empty($name) && function_exists('icl_translate')) {
         $in = icl_translate('plugin_ngg', $name, $in, true);
     }
     $in = apply_filters('localization', $in);
     return $in;
 }
 /**
  * Displays the checkbox to allow visitors to subscribe
  */
 function subscribe_reloaded_show()
 {
     global $post, $wp_subscribe_reloaded;
     $checkbox_subscription_type = null;
     $_comment_ID = null;
     // Enable JS scripts.
     $wp_subscribe_reloaded->stcr->utils->add_plugin_js_scripts();
     wp_enqueue_style('stcr-plugin-style');
     $is_disabled = get_post_meta($post->ID, 'stcr_disable_subscriptions', true);
     if (!empty($is_disabled)) {
         return $_comment_ID;
     }
     $show_subscription_box = true;
     $html_to_show = '';
     $user_link = get_bloginfo('url') . get_option('subscribe_reloaded_manager_page', '');
     if (function_exists('qtrans_convertURL')) {
         $user_link = qtrans_convertURL($user_link);
     }
     $manager_link = strpos($user_link, '?') !== false ? "{$user_link}&amp;srp={$post->ID}&amp;srk=" . get_option('subscribe_reloaded_unique_key') : "{$user_link}?srp={$post->ID}&amp;srk=" . get_option('subscribe_reloaded_unique_key');
     if ($wp_subscribe_reloaded->stcr->is_user_subscribed($post->ID, '', 'C')) {
         $html_to_show = str_replace('[manager_link]', $user_link, __(html_entity_decode(stripslashes(get_option('subscribe_reloaded_subscribed_waiting_label', "Your subscription to this post needs to be confirmed. <a href='[manager_link]'>Manage your subscriptions</a>.")), ENT_QUOTES, 'UTF-8'), 'subscribe-reloaded'));
         $show_subscription_box = false;
     } elseif ($wp_subscribe_reloaded->stcr->is_user_subscribed($post->ID, '')) {
         $html_to_show = str_replace('[manager_link]', $user_link, __(html_entity_decode(stripslashes(get_option('subscribe_reloaded_subscribed_label', "You are subscribed to this post. <a href='[manager_link]'>Manage</a> your subscriptions.")), ENT_QUOTES, 'UTF-8'), 'subscribe-reloaded'));
         $show_subscription_box = false;
     }
     if ($wp_subscribe_reloaded->stcr->is_author($post->post_author)) {
         // when the second parameter is empty, cookie value will be used
         if (get_option('subscribe_reloaded_admin_subscribe', 'no') == 'no') {
             $show_subscription_box = false;
         }
         $html_to_show .= str_replace('[manager_link]', $manager_link, __(html_entity_decode(stripslashes(get_option('subscribe_reloaded_author_label', "You can <a href='[manager_link]'>manage the subscriptions</a> of this post.")), ENT_QUOTES, 'UTF-8'), 'subscribe-reloaded'));
     }
     if ($show_subscription_box) {
         $checkbox_label = str_replace('[subscribe_link]', "{$manager_link}&amp;sra=s", __(html_entity_decode(stripslashes(get_option('subscribe_reloaded_checkbox_label', "Notify me of followup comments via e-mail. You can also <a href='[subscribe_link]'>subscribe</a> without commenting.")), ENT_QUOTES, 'UTF-8'), 'subscribe-reloaded'));
         $checkbox_inline_style = get_option('subscribe_reloaded_checkbox_inline_style', 'width:30px');
         if (!empty($checkbox_inline_style)) {
             $checkbox_inline_style = " style='{$checkbox_inline_style}'";
         }
         $checkbox_html_wrap = html_entity_decode(stripslashes(get_option('subscribe_reloaded_checkbox_html', '')), ENT_QUOTES, 'UTF-8');
         if (get_option('subscribe_reloaded_enable_advanced_subscriptions', 'no') == 'no') {
             switch (get_option('subscribe_reloaded_checked_by_default_value')) {
                 case '0':
                     $checkbox_subscription_type = 'yes';
                     break;
                 case '1':
                     $checkbox_subscription_type = 'replies';
                     break;
             }
             $checkbox_field = "<input{$checkbox_inline_style} type='checkbox' name='subscribe-reloaded' id='subscribe-reloaded' value='{$checkbox_subscription_type}'" . (get_option('subscribe_reloaded_checked_by_default', 'no') == 'yes' ? " checked='checked'" : '') . " />";
         } else {
             $checkbox_field = "<select name='subscribe-reloaded' id='subscribe-reloaded'>\n\t\t\t\t\t\t\t\t\t<option value='none' " . (get_option('subscribe_reloaded_default_subscription_type') === '0' ? "selected='selected'" : '') . ">" . __("Don't subscribe", 'subscribe-reloaded') . "</option>\n\t\t\t\t\t\t\t\t\t<option value='yes' " . (get_option('subscribe_reloaded_default_subscription_type') === '1' ? "selected='selected'" : '') . ">" . __("All", 'subscribe-reloaded') . "</option>\n\t\t\t\t\t\t\t\t\t<option value='replies' " . (get_option('subscribe_reloaded_default_subscription_type') === '2' ? "selected='selected'" : '') . ">" . __("Replies to my comments", 'subscribe-reloaded') . "</option>\n\t\t\t\t\t\t\t\t</select>";
         }
         if (empty($checkbox_html_wrap)) {
             $html_to_show = "{$checkbox_field} <label for='subscribe-reloaded'>{$checkbox_label}</label>" . $html_to_show;
         } else {
             $checkbox_html_wrap = str_replace('[checkbox_field]', $checkbox_field, $checkbox_html_wrap);
             $html_to_show = str_replace('[checkbox_label]', $checkbox_label, $checkbox_html_wrap) . $html_to_show;
         }
     }
     if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         $html_to_show = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($html_to_show);
     }
     // Check for the Comment Form location
     if (get_option('subscribe_reloaded_commentbox_place') == 'yes') {
         echo "<div class='stcr-form hidden'>";
         echo "<!-- Subscribe to Comments Reloaded version" . $wp_subscribe_reloaded->stcr->current_version . " -->";
         echo "<!-- BEGIN: subscribe to comments reloaded -->" . $html_to_show . "<!-- END: subscribe to comments reloaded -->";
         echo "</div>";
     } else {
         echo "<!-- Subscribe to Comments Reloaded version" . $wp_subscribe_reloaded->stcr->current_version . " -->";
         echo "<!-- BEGIN: subscribe to comments reloaded -->" . $html_to_show . "<!-- END: subscribe to comments reloaded -->";
     }
 }
示例#16
0
 /**
  * 
  * put creative layer
  */
 private function putCreativeLayer(RevSlide $slide, $static_slide = false)
 {
     $layers = $slide->getLayers();
     $customAnimations = RevOperations::getCustomAnimations('customin');
     //get all custom animations
     $customEndAnimations = RevOperations::getCustomAnimations('customout');
     //get all custom animations
     $startAnimations = RevOperations::getArrAnimations(false);
     //only get the standard animations
     $endAnimations = RevOperations::getArrEndAnimations(false);
     //only get the standard animations
     $lazyLoad = $this->slider->getParam("lazy_load", "off");
     $isTemplate = $this->slider->getParam("template", "false");
     if (empty($layers)) {
         return false;
     }
     $zIndex = 5;
     foreach ($layers as $layer) {
         $type = UniteFunctionsRev::getVal($layer, "type", "text");
         //set if video full screen
         $videoclass = '';
         $isFullWidthVideo = false;
         if ($type == "video") {
             $videoclass = ' tp-videolayer';
             $videoData = UniteFunctionsRev::getVal($layer, "video_data");
             if (!empty($videoData)) {
                 $videoData = (array) $videoData;
                 $isFullWidthVideo = UniteFunctionsRev::getVal($videoData, "fullwidth");
                 $isFullWidthVideo = UniteFunctionsRev::strToBool($isFullWidthVideo);
             } else {
                 $videoData = array();
             }
         }
         $class = UniteFunctionsRev::getVal($layer, "style");
         if (trim($class) !== '') {
             $this->class_include['.' . trim($class)] = true;
         }
         //add classname for style inclusion
         $animation = UniteFunctionsRev::getVal($layer, "animation", "tp-fade");
         if ($animation == "fade") {
             $animation = "tp-fade";
         }
         $customin = '';
         if (!array_key_exists($animation, $startAnimations) && array_key_exists($animation, $customAnimations)) {
             //if true, add custom animation
             $customin .= 'data-customin="';
             $animArr = RevOperations::getCustomAnimationByHandle($customAnimations[$animation]);
             if ($animArr !== false) {
                 $customin .= RevOperations::parseCustomAnimationByArray($animArr);
             }
             $customin .= '"';
             $animation = 'customin';
         }
         if (strpos($animation, 'customin-') !== false || strpos($animation, 'customout-') !== false) {
             $animation = "tp-fade";
         }
         //set output class:
         $layer_2d_rotation = intval(UniteFunctionsRev::getVal($layer, "2d_rotation", '0'));
         $layer_2d_origin_x = intval(UniteFunctionsRev::getVal($layer, "2d_origin_x", '50'));
         $layer_2d_origin_y = intval(UniteFunctionsRev::getVal($layer, "2d_origin_y", '50'));
         if ($layer_2d_rotation == 0) {
             $outputClass = "tp-caption " . trim($class);
         } else {
             $outputClass = "tp-caption ";
         }
         $outputClass = trim($outputClass) . " ";
         $outputClass .= trim($animation);
         $left = UniteFunctionsRev::getVal($layer, "left", 0);
         $top = UniteFunctionsRev::getVal($layer, "top", 0);
         $speed = UniteFunctionsRev::getVal($layer, "speed", 300);
         $time = UniteFunctionsRev::getVal($layer, "time", 0);
         $easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo");
         $randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false");
         $randomRotate = UniteFunctionsRev::boolToStr($randomRotate);
         $splitin = UniteFunctionsRev::getVal($layer, "split", "none");
         $splitout = UniteFunctionsRev::getVal($layer, "endsplit", "none");
         $elementdelay = intval(UniteFunctionsRev::getVal($layer, "splitdelay", 0));
         $endelementdelay = intval(UniteFunctionsRev::getVal($layer, "endsplitdelay", 0));
         if ($elementdelay > 0) {
             $elementdelay /= 100;
         }
         if ($endelementdelay > 0) {
             $endelementdelay /= 100;
         }
         $text = UniteFunctionsRev::getVal($layer, "text");
         if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate
             $text = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
         }
         $htmlVideoAutoplay = "";
         $htmlVideoAutoplayOnlyFirstTime = "";
         $htmlVideoNextSlide = "";
         $htmlVideoThumbnail = "";
         $htmlMute = '';
         $htmlCover = '';
         $htmlDotted = '';
         $htmlRatio = '';
         $htmlRewind = '';
         $htmlDisableOnMobile = '';
         $ids = UniteFunctionsRev::getVal($layer, "attrID");
         $classes = UniteFunctionsRev::getVal($layer, "attrClasses");
         $title = UniteFunctionsRev::getVal($layer, "attrTitle");
         $rel = UniteFunctionsRev::getVal($layer, "attrRel");
         $ids = $ids != '' ? ' id="' . $ids . '"' : '';
         $classes = $classes != '' ? ' ' . $classes : '';
         $title = $title != '' ? ' title="' . $title . '"' : '';
         $rel = $rel != '' ? ' rel="' . $rel . '"' : '';
         $max_width = UniteFunctionsRev::getVal($layer, "max_width", 'auto');
         $max_height = UniteFunctionsRev::getVal($layer, "max_height", 'auto');
         $white_space = UniteFunctionsRev::getVal($layer, "whitespace", 'nowrap');
         $inline_styles = '';
         $layer_rotation = '';
         $do_rotation = false;
         $add_data = '';
         $videoType = '';
         $cover = false;
         //set html:
         $html = "";
         switch ($type) {
             default:
             case "text":
                 $html = $text;
                 $inline_styles .= ' max-width: ' . $max_width . '; max-height: ' . $max_height . '; white-space: ' . $white_space . ';';
                 if ($layer_2d_rotation !== 0) {
                     $do_rotation = true;
                 }
                 break;
             case "image":
                 $alt = UniteFunctionsRev::getVal($layer, "alt");
                 if (isset($slide->ignore_alt)) {
                     $alt = '';
                 }
                 $urlImage = UniteFunctionsRev::getVal($layer, "image_url");
                 $additional = "";
                 $scaleX = UniteFunctionsRev::getVal($layer, "scaleX");
                 $scaleY = UniteFunctionsRev::getVal($layer, "scaleY");
                 if ($scaleX != '') {
                     $additional .= ' data-ww="' . $scaleX . '"';
                 }
                 if ($scaleY != '') {
                     $additional .= ' data-hh="' . $scaleY . '"';
                 }
                 if (is_ssl()) {
                     $urlImage = str_replace("http://", "https://", $urlImage);
                 }
                 $imageAddParams = "";
                 if ($lazyLoad == "on") {
                     $imageAddParams .= " data-lazyload=\"{$urlImage}\"";
                     $urlImage = GlobalsRevSlider::$url_media . "assets/images/dummy.png";
                 }
                 $urlImage = UniteFunctionJoomlaRev::urlToFull($urlImage);
                 $html = '<img src="' . $urlImage . '" alt="' . $alt . '"' . $additional . $imageAddParams . '>';
                 $imageLink = UniteFunctionsRev::getVal($layer, "link", "");
                 if (!empty($imageLink)) {
                     $openIn = UniteFunctionsRev::getVal($layer, "link_open_in", "same");
                     $target = "";
                     if ($openIn == "new") {
                         $target = ' target="_blank"';
                     }
                     $linkID = UniteFunctionsRev::getVal($layer, "link_id", "");
                     $linkClass = UniteFunctionsRev::getVal($layer, "link_class", "");
                     $linkTitle = UniteFunctionsRev::getVal($layer, "link_title", "");
                     $linkRel = UniteFunctionsRev::getVal($layer, "link_rel", "");
                     $linkIDHtml = "";
                     $linkClassHtml = "";
                     $linkTitleHtml = "";
                     $linkRelHtml = "";
                     if (!empty($linkID)) {
                         $linkIDHtml = ' id="' . $linkID . '"';
                     }
                     if (!empty($linkClass)) {
                         $linkClassHtml = ' class="' . $linkClass . '"';
                     }
                     if (!empty($linkTitle)) {
                         $linkTitleHtml = ' title="' . $linkTitle . '"';
                     }
                     if (!empty($linkRel)) {
                         $linkRelHtml = ' rel="' . $linkRel . '"';
                     }
                     $html = '<a href="' . $imageLink . '"' . $target . $linkIDHtml . $linkClassHtml . $linkTitleHtml . $linkRelHtml . '>' . $html . '</a>';
                 }
                 if ($layer_2d_rotation !== 0) {
                     $do_rotation = true;
                 }
                 break;
             case "video":
                 $videoType = trim(UniteFunctionsRev::getVal($layer, "video_type"));
                 $videoID = trim(UniteFunctionsRev::getVal($layer, "video_id"));
                 $videoWidth = trim(UniteFunctionsRev::getVal($layer, "video_width"));
                 $videoHeight = trim(UniteFunctionsRev::getVal($layer, "video_height"));
                 $videoArgs = trim(UniteFunctionsRev::getVal($layer, "video_args"));
                 $v_controls = UniteFunctionsRev::getVal($videoData, "controls");
                 $v_controls = UniteFunctionsRev::strToBool($v_controls);
                 $rewind = UniteFunctionsRev::getVal($videoData, "forcerewind");
                 $rewind = UniteFunctionsRev::strToBool($rewind);
                 $htmlRewind = $rewind == true ? ' data-forcerewind="on"' : '';
                 $only_poster_on_mobile = UniteFunctionsRev::getVal($layer, "use_poster_on_mobile");
                 $only_poster_on_mobile = UniteFunctionsRev::strToBool($only_poster_on_mobile);
                 if ($isFullWidthVideo == true) {
                     // || $cover == true
                     $videoWidth = "100%";
                     $videoHeight = "100%";
                 }
                 $setBase = is_ssl() ? "https://" : "http://";
                 $cover = UniteFunctionsRev::getVal($videoData, "cover");
                 $cover = UniteFunctionsRev::strToBool($cover);
                 switch ($videoType) {
                     case "youtube":
                         if (empty($videoArgs)) {
                             $videoArgs = GlobalsRevSlider::DEFAULT_YOUTUBE_ARGUMENTS;
                         }
                         //check if full URL
                         if (strpos($videoID, 'http') !== false) {
                             //we have full URL, split it to ID
                             parse_str(parse_url($videoID, PHP_URL_QUERY), $my_v_ret);
                             $videoID = $my_v_ret['v'];
                         }
                         $videospeed = UniteFunctionsRev::getVal($videoData, "videospeed", '1');
                         //$ytBase = 'https://';
                         //if($v_controls) $videoArgs.='controls=0;';
                         $videoArgs .= ';origin=' . $setBase . $_SERVER['SERVER_NAME'] . ';';
                         $add_data = ' data-ytid="' . $videoID . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '" data-videoattributes="version=3&amp;enablejsapi=1&amp;html5=1&amp;' . $videoArgs . '" data-videorate="' . $videospeed . '"';
                         $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         //$html = "<iframe src='".$ytBase."www.youtube.com/embed/".$videoID."?enablejsapi=1&amp;html5=1&amp;".$videoArgs."' allowfullscreen='true' width='".$videoWidth."' height='".$videoHeight."' style='width:".$videoWidth."px;height:".$videoHeight."px;'></iframe>";
                         break;
                     case "vimeo":
                         if (empty($videoArgs)) {
                             $videoArgs = GlobalsRevSlider::DEFAULT_VIMEO_ARGUMENTS;
                         }
                         //check if full URL
                         if (strpos($videoID, 'http') !== false) {
                             //we have full URL, split it to ID
                             $videoID = (int) substr(parse_url($videoID, PHP_URL_PATH), 1);
                         }
                         $add_data = ' data-vimeoid="' . $videoID . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '" data-videoattributes="' . $videoArgs . '"';
                         //no controls for vimeo $add_data .= ($v_controls) ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         //$html = "<iframe src='".$setBase."player.vimeo.com/video/".$videoID."?".$videoArgs."' width='".$videoWidth."' height='".$videoHeight."' style='width:".$videoWidth."px;height:".$videoHeight."px;'></iframe>";
                         break;
                     case "html5":
                         $urlPoster = UniteFunctionsRev::getVal($videoData, "urlPoster");
                         $urlMp4 = UniteFunctionsRev::getVal($videoData, "urlMp4");
                         $urlWebm = UniteFunctionsRev::getVal($videoData, "urlWebm");
                         $urlOgv = UniteFunctionsRev::getVal($videoData, "urlOgv");
                         $videopreload = UniteFunctionsRev::getVal($videoData, "preload");
                         $videoloop = UniteFunctionsRev::getVal($videoData, "videoloop");
                         $add_data = ' data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         if (!empty($urlPoster)) {
                             $add_data .= ' data-videoposter="' . $urlPoster . '"';
                         }
                         if (!empty($urlOgv)) {
                             $add_data .= ' data-videoogv="' . $urlOgv . '"';
                         }
                         if (!empty($urlWebm)) {
                             $add_data .= ' data-videowebm="' . $urlWebm . '"';
                         }
                         if (!empty($urlMp4)) {
                             $add_data .= ' data-videomp4="' . $urlMp4 . '"';
                         }
                         if (!empty($urlPoster)) {
                             if ($only_poster_on_mobile === true) {
                                 $add_data .= ' data-posterOnMObile="on"';
                             } else {
                                 $add_data .= ' data-posterOnMObile="off"';
                             }
                         }
                         if (!empty($videopreload)) {
                             $add_data .= ' data-videopreload="' . $videopreload . '"';
                         }
                         if (UniteFunctionsRev::strToBool($videoloop) == true) {
                             //fallback
                             $add_data .= ' data-videoloop="loop"';
                         } else {
                             $add_data .= ' data-videoloop="' . $videoloop . '"';
                         }
                         break;
                     default:
                         UniteFunctionsRev::throwError("wrong video type: {$videoType}");
                         break;
                 }
                 if ($cover == true) {
                     $dotted = UniteFunctionsRev::getVal($videoData, "dotted");
                     if ($dotted !== 'none') {
                         $add_data .= ' data-dottedoverlay="' . $dotted . '"';
                     }
                     $add_data .= ' data-forceCover="1"';
                     $ratio = UniteFunctionsRev::getVal($videoData, "ratio");
                     if (!empty($ratio)) {
                         $add_data .= ' data-aspectratio="' . $ratio . '"';
                     }
                 }
                 //set video autoplay, with backward compatability
                 if (array_key_exists("autoplay", $videoData)) {
                     $videoAutoplay = UniteFunctionsRev::getVal($videoData, "autoplay");
                 } else {
                     //backword compatability
                     $videoAutoplay = UniteFunctionsRev::getVal($layer, "video_autoplay");
                 }
                 //set video autoplayonlyfirsttime, with backward compatability
                 if (array_key_exists("autoplayonlyfirsttime", $videoData)) {
                     $videoAutoplayOnlyFirstTime = UniteFunctionsRev::getVal($videoData, "autoplayonlyfirsttime");
                 } else {
                     $videoAutoplayOnlyFirstTime = "";
                 }
                 $videoAutoplay = UniteFunctionsRev::strToBool($videoAutoplay);
                 $videoAutoplayOnlyFirstTime = UniteFunctionsRev::strToBool($videoAutoplayOnlyFirstTime);
                 $mute = UniteFunctionsRev::getVal($videoData, "mute");
                 $mute = UniteFunctionsRev::strToBool($mute);
                 $htmlMute = $mute ? ' data-volume="mute"' : '';
                 if ($videoAutoplay == true) {
                     $htmlVideoAutoplay = '			data-autoplay="true"' . "\n";
                 } else {
                     $htmlVideoAutoplay = '			data-autoplay="false"' . "\n";
                 }
                 if ($videoAutoplayOnlyFirstTime == true && $videoAutoplay == true) {
                     $htmlVideoAutoplayOnlyFirstTime = '			data-autoplayonlyfirsttime="true"' . "\n";
                 } else {
                     $htmlVideoAutoplayOnlyFirstTime = '			data-autoplayonlyfirsttime="false"' . "\n";
                 }
                 $videoNextSlide = UniteFunctionsRev::getVal($videoData, "nextslide");
                 $videoNextSlide = UniteFunctionsRev::strToBool($videoNextSlide);
                 if ($videoNextSlide == true) {
                     $htmlVideoNextSlide = '			data-nextslideatend="true"' . "\n";
                 }
                 $videoThumbnail = @$videoData["previewimage"];
                 if (trim($videoThumbnail) !== '') {
                     $htmlVideoThumbnail = '			data-videoposter="' . $videoThumbnail . '"' . "\n";
                 }
                 if (!empty($videoThumbnail)) {
                     if ($only_poster_on_mobile === true) {
                         $htmlVideoThumbnail .= '			data-posterOnMObile="on"' . " \n";
                     } else {
                         $htmlVideoThumbnail .= '			data-posterOnMObile="off"' . " \n";
                     }
                 }
                 $disable_on_mobile = UniteFunctionsRev::getVal($videoData, "disable_on_mobile");
                 $disable_on_mobile = UniteFunctionsRev::strToBool($disable_on_mobile);
                 $htmlDisableOnMobile = $disable_on_mobile ? '			data-disablevideoonmobile="1"' . "\n" : '';
                 break;
         }
         if ($do_rotation) {
             $layer_rotation = ' -moz-transform: rotate(' . $layer_2d_rotation . 'deg); -ms-transform: rotate(' . $layer_2d_rotation . 'deg); -o-transform: rotate(' . $layer_2d_rotation . 'deg); -webkit-transform: rotate(' . $layer_2d_rotation . 'deg); transform: rotate(' . $layer_2d_rotation . 'deg);';
             $layer_rotation .= ' -moz-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; -ms-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; -o-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; -webkit-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%;';
         }
         //handle end transitions:
         $endTime = trim(UniteFunctionsRev::getVal($layer, "endtime"));
         $realEndTime = trim(UniteFunctionsRev::getVal($layer, "realEndTime"));
         $endWithSlide = UniteFunctionsRev::getVal($layer, "endWithSlide", false);
         $endSpeed = trim(UniteFunctionsRev::getVal($layer, "endspeed"));
         $calcSpeed = !empty($endSpeed) ? $endSpeed : $speed;
         if (!empty($calcSpeed) && $realEndTime - $calcSpeed !== $endTime) {
             $endTime = $realEndTime - $calcSpeed;
         }
         $htmlEnd = "";
         $customout = '';
         if (!empty($endTime) && $endWithSlide !== true) {
             $htmlEnd = " data-end=\"{$endTime}\"" . "\n";
         }
         if (!empty($endSpeed)) {
             $htmlEnd .= " data-endspeed=\"{$endSpeed}\"" . "\n";
         }
         $endEasing = trim(UniteFunctionsRev::getVal($layer, "endeasing"));
         if (!empty($endSpeed) && $endEasing != "nothing") {
             $htmlEnd .= "\t\t\tdata-endeasing=\"{$endEasing}\"" . "\n";
         }
         //add animation to class
         $endAnimation = trim(UniteFunctionsRev::getVal($layer, "endanimation"));
         if ($endAnimation == "fade") {
             $endAnimation = "tp-fade";
         }
         if (!array_key_exists($endAnimation, $endAnimations) && array_key_exists($endAnimation, $customEndAnimations)) {
             //if true, add custom animation
             $customout = 'data-customout="';
             $animArr = RevOperations::getCustomAnimationByHandle($customEndAnimations[$endAnimation]);
             if ($animArr !== false) {
                 $customout .= RevOperations::parseCustomAnimationByArray($animArr);
             }
             $customout .= '"';
             $endAnimation = 'customout';
         }
         if (strpos($endAnimation, 'customin-') !== false || strpos($endAnimation, 'customout-') !== false) {
             $endAnimation = "";
         }
         if (!empty($endAnimation) && $endAnimation != "auto") {
             $outputClass .= " " . $endAnimation;
         }
         //slide link
         $htmlLink = "";
         $slideLink = UniteFunctionsRev::getVal($layer, "link_slide");
         if (!empty($slideLink) && $slideLink != "nothing" && $slideLink != "scroll_under") {
             //get slide index from id
             if (is_numeric($slideLink)) {
                 $slideLink = UniteFunctionsRev::getVal($this->slidesNumIndex, $slideLink);
             }
             if (!empty($slideLink)) {
                 $htmlLink = "data-linktoslide=\"{$slideLink}\"" . "\n";
             }
         }
         //scroll under the slider
         if ($slideLink == "scroll_under") {
             $outputClass .= " tp-scrollbelowslider";
             $scrollUnderOffset = intval(UniteFunctionsRev::getVal($layer, "scrollunder_offset"));
             $htmlLink .= " data-scrolloffset=\"" . $scrollUnderOffset . "\"" . "\n";
         }
         //hidden under resolution
         $htmlHidden = "";
         $layerHidden = UniteFunctionsRev::getVal($layer, "hiddenunder");
         if ($layerHidden == "true" || $layerHidden == "1") {
             $htmlHidden = '			data-captionhidden="on"' . "\n";
         }
         $htmlParams = $add_data . $htmlEnd . $htmlLink . $htmlVideoAutoplay . $htmlVideoAutoplayOnlyFirstTime . $htmlVideoNextSlide . $htmlVideoThumbnail . $htmlHidden . $htmlMute . $htmlDisableOnMobile . $htmlCover . $htmlDotted . $htmlRatio . $htmlRewind . "\n";
         //set positioning options
         $alignHor = UniteFunctionsRev::getVal($layer, "align_hor", "left");
         $alignVert = UniteFunctionsRev::getVal($layer, "align_vert", "top");
         $htmlPosX = "";
         $htmlPosY = "";
         switch ($alignHor) {
             default:
             case "left":
                 $htmlPosX = "data-x=\"" . $left . "\"";
                 break;
             case "center":
                 $htmlPosX = "data-x=\"center\" data-hoffset=\"" . $left . "\"";
                 break;
             case "right":
                 $left = (int) $left * -1;
                 $htmlPosX = "data-x=\"right\" data-hoffset=\"" . $left . "\"";
                 break;
         }
         switch ($alignVert) {
             default:
             case "top":
                 $htmlPosY = "data-y=\"" . $top . "\" ";
                 break;
             case "middle":
                 $htmlPosY = "data-y=\"center\" data-voffset=\"" . $top . "\"";
                 break;
             case "bottom":
                 $top = (int) $top * -1;
                 $htmlPosY = "data-y=\"bottom\" data-voffset=\"" . $top . "\"";
                 break;
         }
         //set corners
         $htmlCorners = "";
         if ($type == "text") {
             $cornerLeft = UniteFunctionsRev::getVal($layer, "corner_left");
             $cornerRight = UniteFunctionsRev::getVal($layer, "corner_right");
             switch ($cornerLeft) {
                 case "curved":
                     $htmlCorners .= "<div class='frontcorner'></div>";
                     break;
                 case "reverced":
                     $htmlCorners .= "<div class='frontcornertop'></div>";
                     break;
             }
             switch ($cornerRight) {
                 case "curved":
                     $htmlCorners .= "<div class='backcorner'></div>";
                     break;
                 case "reverced":
                     $htmlCorners .= "<div class='backcornertop'></div>";
                     break;
             }
             //add resizeme class
             $resizeme = UniteFunctionsRev::getVal($layer, "resizeme");
             if ($resizeme == "true" || $resizeme == "1") {
                 $outputClass .= ' tp-resizeme';
             }
         }
         //end text related layer
         //make some modifications for the full screen video
         if ($isFullWidthVideo == true) {
             $htmlPosX = "data-x=\"0\"";
             $htmlPosY = "data-y=\"0\"";
             $outputClass .= " fullscreenvideo";
         }
         //parallax part
         $use_parallax = $this->slider->getParam("use_parallax", "off");
         $parallax_class = '';
         if ($use_parallax == 'on') {
             $slide_level = intval(UniteFunctionsRev::getVal($layer, "parallax_level", '-'));
             if ($slide_level !== '-') {
                 $parallax_class = ' rs-parallaxlevel-' . $slide_level;
             }
         }
         //check for loop animation here
         $do_loop = UniteFunctionsRev::getVal($layer, "loop_animation", "none");
         $loop_data = '';
         $loop_class = '';
         if ($do_loop !== 'none') {
             $loop_class = ' ' . $do_loop;
             switch ($do_loop) {
                 case 'rs-pendulum':
                     $loop_data .= ' data-easing="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"';
                     $loop_data .= ' data-startdeg="' . UniteFunctionsRev::getVal($layer, "loop_startdeg", "-20") . '"';
                     $loop_data .= ' data-enddeg="' . UniteFunctionsRev::getVal($layer, "loop_enddeg", "20") . '"';
                     $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "2") . '"';
                     $loop_data .= ' data-origin="' . UniteFunctionsRev::getVal($layer, "loop_xorigin", "50") . '% ' . UniteFunctionsRev::getVal($layer, "loop_yorigin", "50") . '%"';
                     break;
                 case 'rs-rotate':
                     $loop_data .= ' data-easing="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"';
                     $loop_data .= ' data-startdeg="' . UniteFunctionsRev::getVal($layer, "loop_startdeg", "-20") . '"';
                     $loop_data .= ' data-enddeg="' . UniteFunctionsRev::getVal($layer, "loop_enddeg", "20") . '"';
                     $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "2") . '"';
                     $loop_data .= ' data-origin="' . UniteFunctionsRev::getVal($layer, "loop_xorigin", "50") . '% ' . UniteFunctionsRev::getVal($layer, "loop_yorigin", "50") . '%"';
                     break;
                 case 'rs-slideloop':
                     $loop_data .= ' data-easing="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"';
                     $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "1") . '"';
                     $loop_data .= ' data-xs="' . UniteFunctionsRev::getVal($layer, "loop_xstart", "0") . '"';
                     $loop_data .= ' data-xe="' . UniteFunctionsRev::getVal($layer, "loop_xend", "0") . '"';
                     $loop_data .= ' data-ys="' . UniteFunctionsRev::getVal($layer, "loop_ystart", "0") . '"';
                     $loop_data .= ' data-ye="' . UniteFunctionsRev::getVal($layer, "loop_yend", "0") . '"';
                     break;
                 case 'rs-pulse':
                     $loop_data .= ' data-easing="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"';
                     $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "1") . '"';
                     $loop_data .= ' data-zoomstart="' . UniteFunctionsRev::getVal($layer, "loop_zoomstart", "1") . '"';
                     $loop_data .= ' data-zoomend="' . UniteFunctionsRev::getVal($layer, "loop_zoomend", "1") . '"';
                     break;
                 case 'rs-wave':
                     $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "1") . '"';
                     $loop_data .= ' data-angle="' . UniteFunctionsRev::getVal($layer, "loop_angle", "0") . '"';
                     $loop_data .= ' data-radius="' . UniteFunctionsRev::getVal($layer, "loop_radius", "10") . '"';
                     $loop_data .= ' data-origin="' . UniteFunctionsRev::getVal($layer, "loop_xorigin", "50") . '% ' . UniteFunctionsRev::getVal($layer, "loop_yorigin", "50") . '%"';
                     break;
             }
         }
         echo "\n\t\t<!-- LAYER NR. ";
         echo $zIndex - 4;
         echo " -->\n";
         echo "\t\t<div class=\"" . $outputClass;
         echo $classes != '' ? ' ' . $classes : '';
         echo $parallax_class;
         if ($static_slide) {
             echo ' tp-static-layer';
         }
         echo $videoclass;
         echo "\"\n";
         echo $ids != '' ? '			' . $ids . "\n" : '';
         echo $title != '' ? '			' . $title . "\n" : '';
         echo $rel != '' ? '			' . $rel . "\n" : '';
         if ($htmlPosX != "") {
             echo "\t\t\t" . $htmlPosX . "\n";
         }
         if ($htmlPosY != "") {
             echo "\t\t\t" . $htmlPosY . "\n";
         }
         if ($customin != "") {
             echo "\t\t\t" . $customin . "\n";
         }
         if ($customout != "") {
             echo "\t\t\t" . $customout . "\n";
         }
         echo "\t\t\tdata-speed=\"" . $speed . "\"\n";
         echo "\t\t\tdata-start=\"" . $time . "\"\n";
         echo "\t\t\tdata-easing=\"" . $easing . "\"\n";
         if ($type == "text") {
             //only output if we are a text layer
             echo "\t\t\tdata-splitin=\"" . $splitin . "\"\n";
             echo "\t\t\tdata-splitout=\"" . $splitout . "\"\n";
         }
         //check if static layer and if yes, set values for it.
         if ($static_slide) {
             if ($isTemplate != "true") {
                 $start_on_slide = intval(UniteFunctionsRev::getVal($layer, "static_start", 1)) - 1;
                 $end_on_slide = intval(UniteFunctionsRev::getVal($layer, "static_end", 2)) - 1;
             } else {
                 $start_on_slide = '-1';
                 $end_on_slide = '-1';
             }
             echo '			data-startslide="' . $start_on_slide . '"' . "\n";
             echo '			data-endslide="' . $end_on_slide . '"' . "\n";
         }
         echo "\t\t\tdata-elementdelay=\"" . $elementdelay . "\"\n";
         echo "\t\t\tdata-endelementdelay=\"" . $endelementdelay . "\"\n";
         if ($htmlParams != "") {
             echo "\t\t\t" . $htmlParams;
         }
         echo "\t\t\tstyle=\"z-index: " . $zIndex . ";" . $inline_styles . "\"";
         echo ">";
         if ($do_loop !== 'none') {
             echo "\n" . '				<div style="' . $layer_rotation . '" class="tp-layer-inner-rotation ';
             $rotationClass = trim($class);
             $rotationClass = trim($rotationClass) . " ";
             echo $rotationClass;
             echo $loop_class;
             echo '" ';
             echo $loop_data;
             echo '>';
         } elseif ($layer_rotation != '') {
             $rotationClass = trim($class);
             $rotationClass = trim($rotationClass) . " ";
             echo '<div class="tp-layer-inner-rotation ' . $rotationClass . '" style="' . $layer_rotation . '">' . "\n";
         }
         echo stripslashes($html) . "\n";
         if ($htmlCorners != "") {
             echo $htmlCorners . "\n";
         }
         if ($do_loop !== 'none' || $layer_rotation != '') {
             echo "\t\t\t\t</div>\n";
         }
         echo "\t\t</div>\n";
         $zIndex++;
     }
 }
示例#17
0
function qtrans_convertFormat($format, $default_format)
{
    global $q_config;
    // check for multilang formats
    $format = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($format);
    $default_format = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($default_format);
    switch ($q_config['use_strftime']) {
        case QT_DATE:
            if ($format == '') {
                $format = $default_format;
            }
            return qtrans_convertDateFormatToStrftimeFormat($format);
        case QT_DATE_OVERRIDE:
            return qtrans_convertDateFormatToStrftimeFormat($default_format);
        case QT_STRFTIME:
            return $format;
        case QT_STRFTIME_OVERRIDE:
            return $default_format;
    }
}
示例#18
0
/**
* Function to show the shoutbox. Can be used in the template files.
*
* @access private
*/
function sk_format_text($comment_text)
{
    remove_filter('comment_text', 'commentimage_comment_text');
    $comment_text = apply_filters('comment_text', $comment_text);
    if (function_exists('commentimage_comment_text')) {
        add_filter('comment_text', 'commentimage_comment_text');
    }
    if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
        $comment_text = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($comment_text);
    }
    return $comment_text;
}
示例#19
0
function sb_cl_render_child_list($template_id = 1, $id = false, $nest_level = 0, $orderby = false, $order = false, $thumb_size = false, $category = false, $limit = false)
{
    global $wpdb;
    global $wp_query;
    $this_page_id = $wp_query->get_queried_object_id();
    $return = false;
    $nest_level++;
    $settings = sb_cl_get_settings();
    //for legacy
    if (in_array(strtoupper(trim($orderby)), array('ASC', 'DESC'))) {
        //because the name of the shortcode arguments have now been reversed we need this to correct them. In time it will be removed.
        $order_temp = $orderby;
        $orderby = $order;
        $order = $order_temp;
    }
    //end for legacy
    //legacy conversion
    if ($orderby == 'post_title') {
        $orderby = 'title';
    }
    //end legacy conversion
    if (!$order) {
        $order = 'ASC';
    }
    if (!$limit) {
        $limit = -1;
    }
    if (!$thumb_size) {
        $thumb_size = 'thumb';
    }
    if (!trim($orderby)) {
        $orderby = 'menu_order';
    }
    if ($template_id <= 1) {
        $template_start = $settings->child_list_start;
        $template_start_loop = $settings->child_list_loop_start;
        $template_content = $settings->child_list_loop_content;
        $template_end_loop = $settings->child_list_loop_end;
        $template_end = $settings->child_list_end;
    } else {
        $func = 'child_list_start_' . $template_id;
        $template_start = $settings->{$func};
        $func = 'child_list_loop_start_' . $template_id;
        $template_start_loop = $settings->{$func};
        $func = 'child_list_loop_content_' . $template_id;
        $template_content = $settings->{$func};
        $func = 'child_list_loop_end_' . $template_id;
        $template_end_loop = $settings->{$func};
        $func = 'child_list_end_' . $template_id;
        $template_end = $settings->{$func};
    }
    if (!$id) {
        $id = get_the_ID();
    }
    if (!$id) {
        return;
        //in the event the $id variable is still empty.
    }
    //	global $wp_query;
    //	$temp_query = $wp_query;
    $args = array('post_type' => 'page', 'post_status' => 'publish', 'posts_per_page' => $limit, 'post_parent' => $id, 'orderby' => $orderby, 'order' => $order);
    $cat_id = sb_cl_get_cat_id_from_name($category);
    if ($category && $cat_id) {
        $args['cat'] = $cat_id;
    }
    if (isset($_GET['debug'])) {
        echo '<pre>';
        print_r(func_get_args());
        print_r($args);
        echo '</pre>';
    }
    $child_posts = new WP_Query($args);
    if ($child_posts->have_posts()) {
        $return .= $template_start;
        while ($child_posts->have_posts()) {
            $child_posts->the_post();
            global $post;
            $p = $post;
            $post_class = '';
            $return .= $template_start_loop;
            if ($p->ID == $this_page_id) {
                $post_class = 'current_page_item sb_cl_current_page';
            }
            $title = $p->post_title;
            if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
                $title = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($title);
            }
            $template = $template_content;
            $template = str_replace('[post_title]', $title, $template);
            $template = str_replace('[post_class]', $post_class, $template);
            $template = str_replace('[post_excerpt]', sb_cl_get_the_excerpt($p->ID), $template);
            $post_image = get_post_meta($p->ID, 'post_image', true);
            $post_image2 = get_post_meta($p->ID, 'post_image2', true);
            $template = str_replace('[post_image]', $post_image ? '<img class="list_post_item" src="' . $post_image . '" />' : '', $template);
            $template = str_replace('[post_image2]', $post_image2 ? '<img class="list_post_item" src="' . $post_image2 . '" />' : '', $template);
            $template = str_replace('[post_permalink]', get_permalink($p->ID), $template);
            //if (function_exists('get_the_post_thumbnail')) {
            //$template = str_replace('[post_thumb]', get_the_post_thumbnail( $child->ID, 'thumbnail', array('class' => 'alignleft')), $template);
            //}
            $thumb = $large_image_url = '';
            if (has_post_thumbnail($p->ID)) {
                if ($large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($p->ID), 'large')) {
                    $large_image_url = $large_image_url[0];
                }
                $thumb .= get_the_post_thumbnail($p->ID, $thumb_size, array('class' => 'alignleft'));
            }
            $template = str_replace('[post_thumb]', $thumb, $template);
            $template = str_replace('[post_thumb_url]', $large_image_url, $template);
            if ($fields = sb_cl_str_pos_all($template, '[custom_field:')) {
                $custom_fields = array();
                foreach ($fields as $pos) {
                    $custom_field_string = substr($template, $pos);
                    $bracket_pos = strpos($custom_field_string, ']');
                    $custom_field_instance = str_replace('[custom_field:', '', substr($custom_field_string, 0, $bracket_pos));
                    $custom_fields[] = $custom_field_instance;
                }
                foreach ($custom_fields as $custom_field) {
                    $template = str_replace('[custom_field:' . $custom_field . ']', get_post_meta($p->ID, $custom_field, true), $template);
                }
            }
            $return .= $template;
            if (!$settings->child_list_nesting_level || $nest_level < $settings->child_list_nesting_level) {
                $return .= sb_cl_render_child_list($template_id, $p->ID, $nest_level, $orderby);
            }
            $return .= $template_end_loop;
        }
        wp_reset_postdata();
        wp_reset_query();
        $return .= $template_end;
    } else {
        if (!@$settings->no_siblings_on_bottom_level && $nest_level == 1) {
            $parent = get_page($id);
            if ($parent->post_parent) {
                $return .= sb_cl_render_child_list($template_id, $parent->post_parent, $nest_level, $orderby);
            }
        }
    }
    return $return;
}
示例#20
0
function qs_service()
{
    global $q_config, $qs_public_key, $qs_error_messages;
    if (!isset($_REQUEST['post'])) {
        echo '<script type="text/javascript">document.location="edit.php";</script>';
        printf(__('To translate a post, please go to the <a href="%s">edit posts overview</a>.', 'qtranslate'), 'edit.php');
        exit;
    }
    $post_id = intval($_REQUEST['post']);
    $translate_from = '';
    if (isset($_REQUEST['source_language']) && qtrans_isEnabled($_REQUEST['source_language'])) {
        $translate_from = $_REQUEST['source_language'];
    }
    if (isset($_REQUEST['target_language']) && qtrans_isEnabled($_REQUEST['target_language'])) {
        $translate_to = $_REQUEST['target_language'];
    }
    if ($translate_to == $translate_from) {
        $translate_to = '';
    }
    $post =& get_post($post_id);
    if (!$post) {
        printf(__('Post with id "%s" not found!', 'qtranslate'), $post_id);
        return;
    }
    $default_service = intval(get_option('qs_default_service'));
    $service_settings = get_option('qs_service_settings');
    // Detect available Languages and possible target languages
    $available_languages = qtrans_getAvailableLanguages($post->post_content);
    if (sizeof($available_languages) == 0) {
        $error = __('The requested Post has no content, no Translation possible.', 'qtranslate');
    }
    // try to guess source and target language
    if (!in_array($translate_from, $available_languages)) {
        $translate_from = '';
    }
    $missing_languages = array_diff($q_config['enabled_languages'], $available_languages);
    if (empty($translate_from) && in_array($q_config['default_language'], $available_languages) && $translate_to != $q_config['default_language']) {
        $translate_from = $q_config['default_language'];
    }
    if (empty($translate_to) && sizeof($missing_languages) == 1) {
        $translate_to = $missing_languages[0];
    }
    if (in_array($translate_to, $available_languages)) {
        $message = __('The Post already has content for the selected target language. If a translation request is send, the current text for the target language will be overwritten.', 'qtranslate');
    }
    if (sizeof($available_languages) == 1) {
        if ($available_languages[0] == $translate_to) {
            $translate_to = '';
        }
        $translate_from = $available_languages[0];
    } elseif ($translate_from == '' && sizeof($available_languages) > 1) {
        $languages = qtrans_getSortedLanguages();
        foreach ($languages as $language) {
            if ($language != $translate_to && in_array($language, $available_languages)) {
                $translate_from = $language;
                break;
            }
        }
    }
    // link to current page with get variables
    $url_link = add_query_arg('post', $post_id);
    if (!empty($translate_to)) {
        $url_link = add_query_arg('target_language', $translate_to, $url_link);
    }
    if (!empty($translate_from)) {
        $url_link = add_query_arg('source_language', $translate_from, $url_link);
    }
    // get correct title and content
    $post_title = qtrans_use($translate_from, $post->post_title);
    $post_content = qtrans_use($translate_from, $post->post_content);
    if (isset($translate_from) && isset($translate_to)) {
        $title = sprintf('Translate &quot;%1$s&quot; from %2$s to %3$s', htmlspecialchars($post_title), $q_config['language_name'][$translate_from], $q_config['language_name'][$translate_to]);
    } elseif (isset($translate_from)) {
        $title = sprintf('Translate &quot;%1$s&quot; from %2$s', htmlspecialchars($post_title), $q_config['language_name'][$translate_from]);
    } else {
        $title = sprintf('Translate &quot;%1$s&quot;', htmlspecialchars($post_title));
    }
    // Check data
    if (isset($_POST['service_id'])) {
        $service_id = intval($_POST['service_id']);
        $default_service = $service_id;
        update_option('qs_default_service', $service_id);
        $order_key = substr(md5(time() . AUTH_KEY), 0, 20);
        $request = array('order_service_id' => $service_id, 'order_url' => get_option('home'), 'order_key' => $order_key, 'order_title' => $post_title, 'order_text' => $post_content, 'order_source_language' => $translate_from, 'order_source_locale' => $q_config['locale'][$translate_from], 'order_target_language' => $translate_to, 'order_target_locale' => $q_config['locale'][$translate_to]);
        // check for additional fields
        if (is_array($service_settings[$service_id])) {
            $request['order_required_field'] = array();
            foreach ($service_settings[$service_id] as $setting => $value) {
                $request['order_required_field'][$setting] = $value;
            }
        }
        $answer = qs_queryQS(QS_INIT_TRANSLATION, $request);
        if (isset($answer['error'])) {
            $error = sprintf(__('An error occured: %s', 'qtranslate'), $qs_error_messages[$answer['error']]);
            if ($answer['message'] != '') {
                $error .= '<br />' . sprintf(__('Additional information: %s', 'qtranslate'), qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($answer['message']));
            }
        }
        if (isset($answer['order_id'])) {
            $orders = get_option('qs_orders');
            if (!is_array($orders)) {
                $orders = array();
            }
            $orders[] = array('post_id' => $post_id, 'service_id' => $service_id, 'source_language' => $translate_from, 'target_language' => $translate_to, 'order' => array('order_key' => $order_key, 'order_id' => $answer['order_id']));
            update_option('qs_orders', $orders);
            if (empty($answer['message'])) {
                $order_completed_message = '';
            } else {
                $order_completed_message = htmlspecialchars($answer['message']);
            }
            qs_UpdateOrder($answer['order_id']);
        }
    }
    if (isset($error)) {
        ?>
<div class="wrap">
<h2><?php 
        _e('qTranslate Services', 'qtranslate');
        ?>
</h2>
<div id="message" class="error fade"><p><?php 
        echo $error;
        ?>
</p></div>
<p><?php 
        printf(__('An serious error occured and qTranslate Services cannot proceed. For help, please visit the <a href="%s">Support Forum</a>', 'qtranslate'), 'http://www.qianqin.de/qtranslate/forum/');
        ?>
</p>
</div>
<?php 
        return;
    }
    if (isset($order_completed_message)) {
        ?>
<div class="wrap">
<h2><?php 
        _e('qTranslate Services', 'qtranslate');
        ?>
</h2>
<div id="message" class="updated fade"><p><?php 
        _e('Order successfully sent.', 'qtranslate');
        ?>
</p></div>
<p><?php 
        _e('Your translation order has been successfully transfered to the selected service.', 'qtranslate');
        ?>
</p>
<?php 
        if (!empty($order_completed_message)) {
            ?>
<p><?php 
            printf(__('The service returned this message: %s', 'qtranslate'), $order_completed_message);
            ?>
</p>
<?php 
        }
        ?>
<p><?php 
        _e('Feel free to choose an action:', 'qtranslate');
        ?>
</p>
<ul>
	<li><a href="<?php 
        echo add_query_arg('target_language', null, $url_link);
        ?>
"><?php 
        _e('Translate this post to another language.', 'qtranslate');
        ?>
</a></li>
	<li><a href="edit.php"><?php 
        _e('Translate a different post.', 'qtranslate');
        ?>
</a></li>
	<li><a href="options-general.php?page=qtranslate#qtranslate_service_settings"><?php 
        _e('View all open orders.', 'qtranslate');
        ?>
</a></li>
	<li><a href="options-general.php?page=qtranslate&qs_cron=true#qtranslate_service_settings"><?php 
        _e('Let qTranslate Services check if any open orders are finished.', 'qtranslate');
        ?>
</a></li>
	<li><a href="<?php 
        echo get_permalink($post_id);
        ?>
 "><?php 
        _e('View this post.', 'qtranslate');
        ?>
</a></li>
</ul>
</div>
<?php 
        return;
    }
    ?>
<div class="wrap">
<h2><?php 
    _e('qTranslate Services', 'qtranslate');
    ?>
</h2>
<?php 
    if (!empty($message)) {
        ?>
<div id="message" class="updated fade"><p><?php 
        echo $message;
        ?>
</p></div>
<?php 
    }
    ?>
<h3><?php 
    echo $title;
    ?>
</h3>
<form action="edit.php?page=qtranslate_services" method="post" id="qtranslate-services-translate">
<p><?php 
    if (sizeof($available_languages) > 1) {
        $available_languages_name = array();
        foreach (array_diff($available_languages, array($translate_from)) as $language) {
            $available_languages_name[] = '<a href="' . add_query_arg('source_language', $language, $url_link) . '">' . $q_config['language_name'][$language] . '</a>';
        }
        $available_languages_names = join(", ", $available_languages_name);
        printf(__('Your article is available in multiple languages. If you do not want to translate from %1$s, you can switch to one of the following languages: %2$s', 'qtranslate'), $q_config['language_name'][$translate_from], $available_languages_names);
    }
    ?>
</p>
<input type="hidden" name="post" value="<?php 
    echo $post_id;
    ?>
"/>
<input type="hidden" name="source_language" value="<?php 
    echo $translate_from;
    ?>
"/>
<?php 
    if (empty($translate_to)) {
        ?>
<p><?php 
        _e('Please choose the language you want to translate to:', 'qtranslate');
        ?>
</p>
<ul>
<?php 
        foreach ($q_config['enabled_languages'] as $language) {
            if ($translate_from == $language) {
                continue;
            }
            ?>
	<li><label><input type="radio" name="target_language" value="<?php 
            echo $language;
            ?>
" /> <?php 
            echo $q_config['language_name'][$language];
            ?>
</li>
<?php 
        }
        ?>
</ul>
	<p class="submit">
		<input type="submit" name="submit" class="button-primary" value="<?php 
        _e('Continue', 'qtranslate');
        ?>
" />
	</p>
<?php 
    } else {
        ?>
<p><?php 
        printf(__('Please review your article and <a href="%s">edit</a> it if needed.', 'qtranslate'), 'post.php?action=edit&post=' . $post_id);
        ?>
</p>
<textarea name="qs_content_preview" id="qs_content_preview" readonly="readonly"><?php 
        echo $post_content;
        ?>
</textarea>
<?php 
        $timestamp = time();
        if ($timestamp != qs_queryQS(QS_VERIFY, $timestamp)) {
            ?>
<p class="error"><?php 
            _e('ERROR: Could not connect to qTranslate Services. Please try again later.', 'qtranslate');
            ?>
</p>
<?php 
            return;
        }
        ?>
<h4><?php 
        _e('Use the following Translation Service:', 'qtranslate');
        ?>
</h4>
<ul>
<?php 
        if ($services = qs_queryQS(QS_GET_SERVICES)) {
            foreach ($services as $service_id => $service) {
                // check if we have data for all required fields
                $requirements_matched = true;
                foreach ($service['service_required_fields'] as $field) {
                    if (!isset($service_settings[$service_id][$field['name']]) || $service_settings[$service_id][$field['name']] == '') {
                        $requirements_matched = false;
                    }
                }
                if (!$requirements_matched) {
                    ?>
<li>
	<label><input type="radio" name="service_id" disabled="disabled" /> <b><?php 
                    echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($service['service_name']);
                    ?>
</b> ( <a href="<?php 
                    echo $service['service_url'];
                    ?>
" target="_blank"><?php 
                    _e('Website', 'qtranslate');
                    ?>
</a> )</label>
	<p class="error"><?php 
                    printf(__('Cannot use this service, not all <a href="%s">required fields</a> filled in for this service.', 'qtranslate'), 'options-general.php?page=qtranslate#qs_service_' . $service_id);
                    ?>
</p>
	<p class="service_description"><?php 
                    echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($service['service_description']);
                    ?>
</p>
</li>
<?php 
                } else {
                    ?>
<li><label><input type="radio" name="service_id" <?php 
                    if ($default_service == $service['service_id']) {
                        echo 'checked="checked"';
                    }
                    ?>
 value="<?php 
                    echo $service['service_id'];
                    ?>
" /> <b><?php 
                    echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($service['service_name']);
                    ?>
</b> ( <a href="<?php 
                    echo $service['service_url'];
                    ?>
" target="_blank"><?php 
                    _e('Website', 'qtranslate');
                    ?>
</a> )</label><p class="service_description"><?php 
                    echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($service['service_description']);
                    ?>
</p></li>
<?php 
                }
            }
            ?>
</ul>
<p><?php 
            _e('Your article will be SSL encrypted and securly sent to qTranslate Services, which will forward your text to the chosen Translation Service. Once qTranslate Services receives the translated text, it will automatically appear on your blog.', 'qtranslate');
            ?>
</p>
	<p class="submit">
		<input type="hidden" name="target_language" value="<?php 
            echo $translate_to;
            ?>
"/>
		<input type="submit" name="submit" class="button-primary" value="<?php 
            _e('Request Translation', 'qtranslate');
            ?>
" />
	</p>
<?php 
        }
    }
    ?>
</div>
</form>
<?php 
}
示例#21
0
    if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
        $message = str_replace('[post_title]', qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($target_post->post_title), $message);
        $message = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($message);
    } else {
        $message = str_replace('[post_title]', $target_post->post_title, $message);
    }
    echo "<p>{$message}</p>";
} else {
    $email = isset($_COOKIE['comment_author_email_' . COOKIEHASH]) ? $_COOKIE['comment_author_email_' . COOKIEHASH] : 'email';
    ?>

	<p><?php 
    $message = str_replace('[post_permalink]', $post_permalink, __(html_entity_decode(stripslashes(get_option('subscribe_reloaded_subscribe_without_commenting')), ENT_QUOTES, 'UTF-8'), 'subscribe-reloaded'));
    if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
        $message = str_replace('[post_title]', qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($target_post->post_title), $message);
        $message = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($message);
    } else {
        $message = str_replace('[post_title]', $target_post->post_title, $message);
    }
    echo $message;
    ?>
</p>
	<form action="<?php 
    if ($helper->verifyXSS($_SERVER['REQUEST_URI'])) {
        echo "#";
    } else {
        echo $_SERVER['REQUEST_URI'];
    }
    ?>
" method="post" onsubmit="if(this.sre.value=='' || this.sre.indexOf('@')==0) return false">
		<fieldset style="border:0">
示例#22
0
/**
 * Used when getting some option value from serialized array saved in a custom place
 * and that option is unreachable for standard WordPress filters by other plugins
 * For e.g. that option cannot be translated by plugins, so we pass its value through this function and do the fixes
 * @param $value
 * @return array
 */
function fw_prepare_option_value($value)
{
    if (empty($value)) {
        return $value;
    }
    if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
        $value = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
    }
    return $value;
}
示例#23
0
 /**
  * Translate with a qTranslate compatible plugin.
  *
  * @since 2.0.0
  * @param  string $text        The original text
  * @return string $translation The translated text
  */
 public function qtranslation($text)
 {
     if (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         $translation = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
     } else {
         $translation = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
     }
     return $translation;
 }
 /**
  * Builds post's excerpt
  *
  * @since	1.4.6
  * @global	object	wpdb
  * @param	int	post ID
  * @param	array	widget instance
  * @return	string
  */
 protected function _get_summary($id, $instance)
 {
     if (!$this->__is_numeric($id)) {
         return false;
     }
     global $wpdb;
     $excerpt = "";
     // WPML support, get excerpt for current language
     if (defined('ICL_LANGUAGE_CODE') && function_exists('icl_object_id')) {
         $current_id = icl_object_id($id, get_post_type($id), true, ICL_LANGUAGE_CODE);
         $the_post = get_post($current_id);
         $excerpt = empty($the_post->post_excerpt) ? $the_post->post_content : $the_post->post_excerpt;
     } else {
         $the_post = get_post($id);
         $excerpt = empty($the_post->post_excerpt) ? $the_post->post_content : $the_post->post_excerpt;
         // RRR added call to the_content filters, allows qTranslate to hook in.
         if ($this->qTrans) {
             $excerpt = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($excerpt);
         }
     }
     // remove caption tags
     $excerpt = preg_replace("/\\[caption.*\\[\\/caption\\]/", "", $excerpt);
     // remove Flash objects
     $excerpt = preg_replace("/<object[0-9 a-z_?*=\":\\-\\/\\.#\\,\\n\\r\\t]+/smi", "", $excerpt);
     // remove Iframes
     $excerpt = preg_replace("/<iframe.*?\\/iframe>/i", "", $excerpt);
     // remove WP shortcodes
     $excerpt = strip_shortcodes($excerpt);
     // remove HTML tags if requested
     if ($instance['post-excerpt']['keep_format']) {
         $excerpt = strip_tags($excerpt, '<a><b><i><em><strong>');
     } else {
         $excerpt = strip_tags($excerpt);
         // remove URLs, too
         $excerpt = preg_replace('_^(?:(?:https?|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\x{00a1}-\\x{ffff}0-9]+-?)*[a-z\\x{00a1}-\\x{ffff}0-9]+)(?:\\.(?:[a-z\\x{00a1}-\\x{ffff}0-9]+-?)*[a-z\\x{00a1}-\\x{ffff}0-9]+)*(?:\\.(?:[a-z\\x{00a1}-\\x{ffff}]{2,})))(?::\\d{2,5})?(?:/[^\\s]*)?$_iuS', '', $excerpt);
     }
     // Fix RSS CDATA tags
     $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
     // do we still have something to display?
     if (!empty($excerpt)) {
         // truncate excerpt
         if (isset($instance['post-excerpt']['words']) && $instance['post-excerpt']['words']) {
             // by words
             $words = explode(" ", $excerpt, $instance['post-excerpt']['length'] + 1);
             if (count($words) > $instance['post-excerpt']['length']) {
                 array_pop($words);
                 $excerpt = implode(" ", $words) . "...";
             }
         } else {
             // by characters
             if (strlen($excerpt) > $instance['post-excerpt']['length']) {
                 $excerpt = mb_substr($excerpt, 0, $instance['post-excerpt']['length'], $this->charset) . "...";
             }
         }
     }
     // Balance tags, if needed
     if ($instance['post-excerpt']['keep_format']) {
         $excerpt = force_balance_tags($excerpt);
     }
     return $excerpt;
 }
示例#25
0
function eme_translate($value, $lang = '')
{
    //if (empty($lang))
    //   $lang=eme_detect_lang();
    if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage') && function_exists('qtrans_use')) {
        if (empty($lang)) {
            return qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
        } else {
            return qtrans_use($lang, $value);
        }
    } elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage') && function_exists('ppqtrans_use')) {
        if (empty($lang)) {
            return ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
        } else {
            return ppqtrans_use($lang, $value);
        }
    } elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage') && function_exists('qtranxf_use')) {
        if (empty($lang)) {
            return qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
        } else {
            return qtranxf_use($lang, $value);
        }
    } elseif (function_exists('pll_translate_string') && function_exists('pll__')) {
        if (empty($lang)) {
            return pll__($value);
        } else {
            return pll_translate_string($value, $lang);
        }
    } else {
        return $value;
    }
}
 function internationalize($in)
 {
     if (function_exists('langswitch_filter_langs_with_message')) {
         $in = langswitch_filter_langs_with_message($in);
     }
     if (function_exists('polyglot_filter')) {
         $in = polyglot_filter($in);
     }
     if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
         $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
     }
     $in = apply_filters('localization', $in);
     return $in;
 }
 function format_value_for_api($value, $post_id, $field)
 {
     $value = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
     return parent::format_value_for_api($value, $post_id, $field);
 }
/**
 * render purchased posts
 *
 * @param int $user_id
 * @param bool $sidebar
 * @param bool $return
 * @return string $html
 * @since 1.0
 */
function mgm_render_my_purchased_posts($user_id, $sidebar = true, $return = false)
{
    global $wpdb;
    $html = '';
    $prefix = $wpdb->prefix;
    $sql = 'SELECT pp.post_id, p.post_title AS title
			FROM `' . TBL_MGM_POST_PURCHASES . '` pp 
			JOIN ' . $prefix . 'posts p ON (p.id = pp.post_id)
			WHERE pp.user_id = ' . $user_id;
    //echo $sql;
    $results = $wpdb->get_results($sql, 'ARRAY_A');
    if (!$sidebar) {
        if (count($results[0])) {
            $html .= '<div class="div_table"><div class="row"><div class="cell">Post Title</div></div>';
            foreach ($results as $result) {
                $link = get_permalink($result['post_id']);
                $title = $result['title'];
                if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
                    $title = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($title);
                }
                $html .= '<div class="row"><div class="cell"><a href="' . $link . '">' . $title . '</a></div></div>';
            }
            $html .= '</div>';
        }
    } else {
        if (isset($results[0]) && count($results[0]) > 0) {
            $html .= '<div class="mgm_render_my_purchased_posts_div">Purchased Posts</div>';
            foreach ($results as $result) {
                $link = get_permalink($result['post_id']);
                $title = $result['title'];
                if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
                    $title = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($title);
                }
                $html .= '<div><a href="' . $link . '">' . $title . '</a></div>';
            }
        }
    }
    if ($return) {
        return $html;
    } else {
        echo $html;
    }
}
示例#29
0
 /**
  * put creative layer
  */
 private function putCreativeLayer(RevSliderSlide $slide, $static_slide = false)
 {
     $layers = $slide->getLayers();
     $slider_type = $this->slider->getParam('slider-type');
     $icon_sets = RevSliderBase::set_icon_sets(array());
     $ignore_styles = array('font-family', 'color', 'font-weight', 'font-style', 'text-decoration');
     $customAnimations = RevSliderOperations::getCustomAnimations('customin');
     //get all custom animations
     $customEndAnimations = RevSliderOperations::getCustomAnimations('customout');
     //get all custom animations
     $startAnimations = RevSliderOperations::getArrAnimations(false);
     //only get the standard animations
     $endAnimations = RevSliderOperations::getArrEndAnimations(false);
     //only get the standard animations
     $lazyLoad = $this->slider->getParam('lazy_load_type', false);
     if ($lazyLoad === false) {
         //do fallback checks to removed lazy_load value since version 5.0 and replaced with an enhanced version
         $old_ll = $this->slider->getParam('lazy_load', 'off');
         $lazyLoad = $old_ll == 'on' ? 'all' : 'none';
     }
     $isTemplate = $this->slider->getParam('template', 'false');
     $enable_custom_size_notebook = $this->slider->getParam('enable_custom_size_notebook', 'off');
     $enable_custom_size_tablet = $this->slider->getParam('enable_custom_size_tablet', 'off');
     $enable_custom_size_iphone = $this->slider->getParam('enable_custom_size_iphone', 'off');
     $enabled_sizes = array('desktop' => 'on', 'notebook' => $enable_custom_size_notebook, 'tablet' => $enable_custom_size_tablet, 'mobile' => $enable_custom_size_iphone);
     $adv_resp_sizes = $enable_custom_size_notebook == 'on' || $enable_custom_size_tablet == 'on' || $enable_custom_size_iphone == 'on' ? true : false;
     $slider_selectable = $this->slider->getParam('def-layer_selection', 'off');
     $image_source_type = $this->slider->getParam('def-image_source_type', 'full');
     if (empty($layers)) {
         return false;
     }
     $zIndex = 5;
     $slideID = $slide->getID();
     $in_class_usage = array();
     foreach ($layers as $layer) {
         $unique_id = RevSliderFunctions::getVal($layer, 'unique_id');
         if ($unique_id == '') {
             $unique_id = $zIndex - 4;
         }
         //$visible = RevSliderFunctions::getVal($layer, 'visible', true);
         //if($visible == false) continue;
         $type = RevSliderFunctions::getVal($layer, 'type', 'text');
         $svg_val = '';
         //set if video full screen
         $videoclass = '';
         $isFullWidthVideo = false;
         if ($type == 'video') {
             $videoclass = ' tp-videolayer';
             $videoData = RevSliderFunctions::getVal($layer, 'video_data');
             if (!empty($videoData)) {
                 $videoData = (array) $videoData;
                 $isFullWidthVideo = RevSliderFunctions::getVal($videoData, 'fullwidth');
                 $isFullWidthVideo = RevSliderFunctions::strToBool($isFullWidthVideo);
             } else {
                 $videoData = array();
             }
         } elseif ($type == 'audio') {
             $videoclass = ' tp-audiolayer';
             $videoData = RevSliderFunctions::getVal($layer, 'video_data');
             if (!empty($videoData)) {
                 $videoData = (array) $videoData;
             } else {
                 $videoData = array();
             }
         }
         $class = RevSliderFunctions::getVal($layer, 'style');
         if (trim($class) !== '') {
             $this->class_include['.' . trim($class)] = true;
             //add classname for style inclusion
             //get class styles for further compare usage
             if (!isset($in_class_usage[trim($class)])) {
                 $in_class_usage[trim($class)] = RevSliderOperations::getCaptionsContentArray(trim($class));
             }
         }
         //set defaults for stylings
         $dff = '';
         $dta = 'left';
         $dttr = 'none';
         $dfs = 'normal';
         $dtd = 'none';
         $dpa = '0px 0px 0px 0px';
         $dbs = 'none';
         $dbw = '0px';
         $dbr = '0px 0px 0px 0px';
         $dc = 'auto';
         $dfos = false;
         $dlh = false;
         $dfw = false;
         $dco = false;
         $dcot = 1;
         $dbc = 'transparent';
         $dbt = 1;
         $dboc = 'transparent';
         $dbot = 1;
         /**
          * remove this following to get back to 5.0.4.1 in terms of output styling
          **/
         $do_remove_inline = apply_filters('revslider_remove_inline', true);
         if ($do_remove_inline) {
             if (isset($in_class_usage[trim($class)]) && isset($in_class_usage[trim($class)]['params'])) {
                 //defaults get set here
                 $dfos = isset($in_class_usage[trim($class)]['params']->{'font-size'}) ? $in_class_usage[trim($class)]['params']->{'font-size'} : $dfos;
                 $dlh = isset($in_class_usage[trim($class)]['params']->{'line-height'}) ? $in_class_usage[trim($class)]['params']->{'line-height'} : $dlh;
                 $dfw = isset($in_class_usage[trim($class)]['params']->{'font-weight'}) ? $in_class_usage[trim($class)]['params']->{'font-weight'} : $dfw;
                 $dco = isset($in_class_usage[trim($class)]['params']->{'color'}) ? $in_class_usage[trim($class)]['params']->{'color'} : $dco;
                 $dcot = isset($in_class_usage[trim($class)]['params']->{'color-transparency'}) ? $in_class_usage[trim($class)]['params']->{'color-transparency'} : $dcot;
                 $dbc = isset($in_class_usage[trim($class)]['params']->{'background-color'}) ? $in_class_usage[trim($class)]['params']->{'background-color'} : $dbc;
                 $dbt = isset($in_class_usage[trim($class)]['params']->{'background-transparency'}) ? $in_class_usage[trim($class)]['params']->{'background-transparency'} : $dbt;
                 $dboc = isset($in_class_usage[trim($class)]['params']->{'border-color'}) ? $in_class_usage[trim($class)]['params']->{'border-color'} : $dboc;
                 $dbot = isset($in_class_usage[trim($class)]['params']->{'border-transparency'}) ? $in_class_usage[trim($class)]['params']->{'border-transparency'} : $dbot;
                 $dff = isset($in_class_usage[trim($class)]['params']->{'font-family'}) ? $in_class_usage[trim($class)]['params']->{'font-family'} : $dff;
                 $dta = isset($in_class_usage[trim($class)]['params']->{'text-align'}) ? $in_class_usage[trim($class)]['params']->{'text-align'} : $dta;
                 $dttr = isset($in_class_usage[trim($class)]['params']->{'text-transform'}) ? $in_class_usage[trim($class)]['params']->{'text-transform'} : $dttr;
                 $dfs = isset($in_class_usage[trim($class)]['params']->{'font-styles'}) ? $in_class_usage[trim($class)]['params']->{'font-styles'} : $dfs;
                 $dtd = isset($in_class_usage[trim($class)]['params']->{'text-decoration'}) ? $in_class_usage[trim($class)]['params']->{'text-decoration'} : $dtd;
                 $dpa = isset($in_class_usage[trim($class)]['params']->{'padding'}) ? $in_class_usage[trim($class)]['params']->{'padding'} : $dpa;
                 if (is_array($dpa)) {
                     $dpa = implode(' ', $dpa);
                 }
                 $dbs = isset($in_class_usage[trim($class)]['params']->{'border-style'}) ? $in_class_usage[trim($class)]['params']->{'border-style'} : $dbs;
                 $dbw = isset($in_class_usage[trim($class)]['params']->{'border-width'}) ? $in_class_usage[trim($class)]['params']->{'border-width'} : $dbw;
                 $dbr = isset($in_class_usage[trim($class)]['params']->{'border-radius'}) ? $in_class_usage[trim($class)]['params']->{'border-radius'} : $dbr;
                 if (is_array($dbr)) {
                     $dbr = implode(' ', $dbr);
                 }
                 $dc = isset($in_class_usage[trim($class)]['params']->{'css_cursor'}) ? $in_class_usage[trim($class)]['params']->{'css_cursor'} : $dc;
             }
         }
         $animation = RevSliderFunctions::getVal($layer, 'animation', 'tp-fade');
         //if($animation == "fade") $animation = "tp-fade";
         $customin = '';
         $maskin = '';
         if (!array_key_exists($animation, $startAnimations) && array_key_exists($animation, $customAnimations)) {
             //if true, add custom animation
             //check with custom values, if same, we do not need to write all down and just refer
         }
         $tcin = RevSliderOperations::parseCustomAnimationByArray($layer, 'start');
         if ($tcin !== '') {
             $customin = ' data-transform_in="' . $tcin . '"';
         }
         $do_mask_in = RevSliderFunctions::getVal($layer, 'mask_start', false);
         if ($do_mask_in) {
             $tmask = RevSliderOperations::parseCustomMaskByArray($layer, 'start');
             if ($tmask !== '') {
                 $maskin = ' data-mask_in="' . $tmask . '"';
             }
         }
         //if(strpos($animation, 'customin-') !== false || strpos($animation, 'customout-') !== false) $animation = "tp-fade";
         //set output class:
         $layer_2d_rotation = intval(RevSliderFunctions::getVal($layer, '2d_rotation', '0'));
         $internal_class = RevSliderFunctions::getVal($layer, 'internal_class', '');
         $layer_selectable = RevSliderFunctions::getVal($layer, 'layer-selectable', 'default');
         $outputClass = 'tp-caption ' . trim($class);
         $outputClass = trim($outputClass) . ' ' . $internal_class . ' ';
         if ($layer_selectable !== "default") {
             if ($layer_selectable == 'on') {
                 $outputClass = trim($outputClass) . ' tp-layer-selectable ';
             }
         } else {
             if ($slider_selectable == 'on') {
                 $outputClass = trim($outputClass) . ' tp-layer-selectable ';
             }
         }
         //if($type == 'button') $outputClass .= ' ';
         //$speed = RevSliderFunctions::getVal($layer, "speed",300);
         $time = RevSliderFunctions::getVal($layer, 'time', 0);
         $easing = RevSliderFunctions::getVal($layer, 'easing', 'easeOutExpo');
         $randomRotate = RevSliderFunctions::getVal($layer, 'random_rotation', 'false');
         $randomRotate = RevSliderFunctions::boolToStr($randomRotate);
         $splitin = RevSliderFunctions::getVal($layer, 'split', 'none');
         $splitout = RevSliderFunctions::getVal($layer, 'endsplit', 'none');
         $elementdelay = intval(RevSliderFunctions::getVal($layer, 'splitdelay', 0));
         $endelementdelay = intval(RevSliderFunctions::getVal($layer, 'endsplitdelay', 0));
         $basealign = RevSliderFunctions::getVal($layer, 'basealign', 'grid');
         if ($elementdelay > 0) {
             $elementdelay /= 100;
         }
         if ($endelementdelay > 0) {
             $endelementdelay /= 100;
         }
         $text = RevSliderFunctions::getVal($layer, 'text');
         if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate
             $text = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
         } elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate plus
             $text = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
         } elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate X
             $text = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
         }
         $text_toggle = RevSliderFunctions::getVal($layer, 'texttoggle');
         if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate
             $text_toggle = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
         } elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate plus
             $text_toggle = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
         } elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate X
             $text_toggle = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
         }
         $htmlVideoAutoplay = '';
         $htmlVideoAutoplayOnlyFirstTime = '';
         $htmlVideoNextSlide = '';
         $htmlVideoThumbnail = '';
         $htmlMute = '';
         $htmlCover = '';
         $htmlDotted = '';
         $htmlRatio = '';
         $htmlRewind = '';
         $htmlStartAt = '';
         $htmlEndAt = '';
         $htmlCoverPause = '';
         $htmlDisableOnMobile = '';
         $ids = RevSliderFunctions::getVal($layer, 'attrID');
         $classes = RevSliderFunctions::getVal($layer, 'attrClasses');
         $title = RevSliderFunctions::getVal($layer, 'attrTitle');
         $rel = RevSliderFunctions::getVal($layer, 'attrRel');
         if (trim($ids) == '') {
             if ($static_slide) {
                 $ids = 'slider-' . preg_replace("/[^\\w]+/", "", $this->slider->getID()) . '-layer-' . $unique_id;
             } else {
                 $ids = 'slide-' . preg_replace("/[^\\w]+/", "", $slideID) . '-layer-' . $unique_id;
             }
         }
         $ids = $ids != '' ? ' id="' . $ids . '"' : '';
         $classes = $classes != '' ? ' ' . $classes : '';
         $title = $title != '' ? ' title="' . $title . '"' : '';
         $rel = $rel != '' ? ' rel="' . $rel . '"' : '';
         $inline_styles = '';
         $do_rotation = false;
         $add_data = '';
         $videoType = '';
         $cover = false;
         $toggle_allow = RevSliderFunctions::getVal($layer, 'toggle', false);
         //set html:
         $html = '';
         $html_toggle = '';
         switch ($type) {
             case 'shape':
                 break;
             case 'svg':
                 $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
                 $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
                 $max_width = is_object($max_width) ? RevSliderFunctions::get_biggest_device_setting($max_width, $enabled_sizes) : $max_width;
                 $max_height = is_object($max_height) ? RevSliderFunctions::get_biggest_device_setting($max_height, $enabled_sizes) : $max_height;
                 if ($max_width !== 'auto') {
                     $max_width = $max_width !== 'none' ? RevSliderFunctions::add_missing_val($max_width) : $max_width;
                     $inline_styles .= ' min-width: ' . $max_width . '; max-width: ' . $max_width . ';';
                 }
                 if ($max_height !== 'auto') {
                     $max_height = $max_height !== 'none' ? RevSliderFunctions::add_missing_val($max_height) : $max_height;
                     $inline_styles .= ' max-width: ' . $max_height . '; max-width: ' . $max_height . ';';
                 }
                 $svg_val = RevSliderFunctions::getVal($layer, 'svg', false);
                 $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
                 if (!empty($static_styles)) {
                     $static_styles = (array) $static_styles;
                     if (!empty($static_styles['color'])) {
                         if (is_object($static_styles['color'])) {
                             $use_color = RevSliderFunctions::get_biggest_device_setting($static_styles['color'], $enabled_sizes);
                         } else {
                             $use_color = $static_styles['color'];
                         }
                         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
                         $color_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                         if ($color_trans != $dcot || $use_color != $dco) {
                             if ($color_trans > 0) {
                                 $color_trans *= 100;
                             }
                             $color_trans = intval($color_trans);
                             $use_color = RevSliderFunctions::hex2rgba($use_color, $color_trans);
                             $inline_styles .= ' color: ' . $use_color . ';';
                         }
                     }
                 }
                 break;
             default:
                 //case 'no_edit':
             //case 'no_edit':
             case 'text':
             case 'button':
                 $html = $text;
                 $html = do_shortcode(stripslashes($html));
                 $html_toggle = $text_toggle;
                 $html_toggle = do_shortcode(stripslashes($html_toggle));
                 global $fa_icon_var, $pe_7s_var;
                 foreach ($icon_sets as $is) {
                     if (strpos($html, $is) !== false) {
                         //include default Icon Sets if used
                         $font_var = str_replace("-", "_", $is) . "var";
                         ${$font_var} = true;
                         //wp_enqueue_style('rs-icon-set-'.$is);
                     }
                 }
                 $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
                 $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
                 $white_space = RevSliderFunctions::getVal($layer, 'whitespace', 'nowrap');
                 $max_width = is_object($max_width) ? RevSliderFunctions::get_biggest_device_setting($max_width, $enabled_sizes) : $max_width;
                 $max_height = is_object($max_height) ? RevSliderFunctions::get_biggest_device_setting($max_height, $enabled_sizes) : $max_height;
                 $white_space = is_object($white_space) ? RevSliderFunctions::get_biggest_device_setting($white_space, $enabled_sizes) : $white_space;
                 if ($max_width !== 'auto') {
                     $max_width = $max_width !== 'none' ? RevSliderFunctions::add_missing_val($max_width) : $max_width;
                     $inline_styles .= ' min-width: ' . $max_width . '; max-width: ' . $max_width . ';';
                 }
                 if ($max_height !== 'auto') {
                     $max_height = $max_height !== 'none' ? RevSliderFunctions::add_missing_val($max_height) : $max_height;
                     $inline_styles .= ' max-width: ' . $max_height . '; max-width: ' . $max_height . ';';
                 }
                 $inline_styles .= ' white-space: ' . $white_space . ';';
                 //$inline_styles .= ' min-width: '.$max_width.'; min-height: '.$max_height.'; white-space: '.$white_space.';';
                 //$inline_styles .= ' max-width: '.$max_width.'; max-height: '.$max_height.';';
                 //add more inline styling
                 $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
                 if (!empty($static_styles)) {
                     $static_styles = (array) $static_styles;
                     if (!empty($static_styles['font-size'])) {
                         $static_styles['font-size'] = RevSliderFunctions::add_missing_val($static_styles['font-size'], 'px');
                         if (is_object($static_styles['font-size'])) {
                             $mcfs = RevSliderFunctions::get_biggest_device_setting($static_styles['font-size'], $enabled_sizes);
                         } else {
                             $mcfs = $static_styles['font-size'];
                         }
                         if ($mcfs !== $dfos) {
                             $inline_styles .= ' font-size: ' . $mcfs . ';';
                         }
                     }
                     if (!empty($static_styles['line-height'])) {
                         $static_styles['line-height'] = RevSliderFunctions::add_missing_val($static_styles['line-height'], 'px');
                         if (is_object($static_styles['line-height'])) {
                             $mclh = RevSliderFunctions::get_biggest_device_setting($static_styles['line-height'], $enabled_sizes);
                         } else {
                             $mclh = $static_styles['line-height'];
                         }
                         if ($mclh !== $dlh) {
                             $inline_styles .= ' line-height: ' . $mclh . ';';
                         }
                     }
                     if (!empty($static_styles['font-weight'])) {
                         if (is_object($static_styles['font-weight'])) {
                             $mcfw = RevSliderFunctions::get_biggest_device_setting($static_styles['font-weight'], $enabled_sizes);
                         } else {
                             $mcfw = $static_styles['font-weight'];
                         }
                         if ($mcfw !== $dfw) {
                             $inline_styles .= ' font-weight: ' . $mcfw . ';';
                         }
                     }
                     if (!empty($static_styles['color'])) {
                         if (is_object($static_styles['color'])) {
                             $use_color = RevSliderFunctions::get_biggest_device_setting($static_styles['color'], $enabled_sizes);
                         } else {
                             $use_color = $static_styles['color'];
                         }
                         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
                         $color_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                         if ($color_trans != $dcot || $use_color != $dco) {
                             if ($color_trans > 0) {
                                 $color_trans *= 100;
                             }
                             $color_trans = intval($color_trans);
                             $use_color = RevSliderFunctions::hex2rgba($use_color, $color_trans);
                             $inline_styles .= ' color: ' . $use_color . ';';
                         }
                     }
                 }
                 if ($layer_2d_rotation !== 0) {
                     $do_rotation = true;
                 }
                 break;
             case 'image':
                 $additional = '';
                 $urlImage = RevSliderFunctions::getVal($layer, 'image_url');
                 $do_image_change = RevSliderFunctions::getVal($layer, 'image-size', 'auto');
                 $img_size = 'full';
                 switch ($do_image_change) {
                     case 'auto':
                         $img_size = $image_source_type;
                         break;
                     default:
                         $img_size = $do_image_change;
                         break;
                 }
                 $cur_img_id = RevSliderFunctionsWP::get_image_id_by_url($urlImage);
                 if ($img_size !== 'full') {
                     if ($cur_img_id !== false) {
                         $urlImage = wp_get_attachment_image_src($cur_img_id, $img_size);
                         $urlImage = $urlImage[0];
                     }
                 }
                 $img_w = '';
                 $img_h = '';
                 if ($cur_img_id !== false) {
                     $img_data = wp_get_attachment_metadata($cur_img_id);
                     if ($img_data !== false && !empty($img_data)) {
                         if ($img_size !== 'full') {
                             if (isset($img_data['sizes']) && isset($img_data['sizes'][$img_size])) {
                                 $img_w = $img_data['sizes'][$img_size]['width'];
                                 $img_h = $img_data['sizes'][$img_size]['height'];
                             }
                         }
                         if ($img_w == '' || $img_h == '') {
                             $img_w = $img_data['width'];
                             $img_h = $img_data['height'];
                         }
                         $additional .= ' width="' . $img_w . '" height="' . $img_h . '"';
                     }
                 }
                 $alt = '';
                 $alt_option = RevSliderFunctions::getVal($layer, 'alt_option', 'media_library');
                 switch ($alt_option) {
                     case 'media_library':
                         if ($cur_img_id !== false) {
                             $alt = get_post_meta($cur_img_id, '_wp_attachment_image_alt', true);
                         }
                         break;
                     case 'file_name':
                         $info = pathinfo($urlImage);
                         $alt = $info['filename'];
                         break;
                     case 'custom':
                         $alt = RevSliderFunctions::getVal($layer, 'alt');
                         break;
                 }
                 if (isset($slide->ignore_alt)) {
                     $alt = '';
                 }
                 $scaleX = RevSliderFunctions::getVal($layer, 'scaleX');
                 $scaleY = RevSliderFunctions::getVal($layer, 'scaleY');
                 $cover_mode = RevSliderFunctions::getVal($layer, 'cover_mode', array());
                 if (is_string($cover_mode)) {
                     $cover_mode = array('desktop' => $cover_mode, 'notebook' => $cover_mode, 'tablet' => $cover_mode, 'mobile' => $cover_mode);
                 } else {
                     //change to array
                     $cover_mode = (array) $cover_mode;
                 }
                 if ($adv_resp_sizes == true) {
                     $y_is_single = true;
                     $x_is_single = true;
                     if ($scaleX !== '') {
                         if (!is_object($scaleX)) {
                             if (trim($scaleX) == '' || $scaleX == 'NaNpx') {
                                 $scaleX = 'auto';
                             }
                             $myScaleX = $scaleX;
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $myScaleX = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $myScaleX = 'full-proportional';
                                 }
                                 break;
                             }
                         } else {
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $scaleX->{$cvmk} = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $scaleX->{$cvmk} = 'full-proportional';
                                 }
                             }
                             $myScaleX = RevSliderFunctions::normalize_device_settings($scaleX, $enabled_sizes, 'html-array', array('NaNpx' => '', 'auto' => ''));
                             if ($myScaleX == "['','','','']") {
                                 $myScaleX = '';
                             }
                             if (strpos($myScaleX, '[') !== false) {
                                 $y_is_single = false;
                             }
                         }
                         if ($y_is_single) {
                             //force to array if voffset is also array
                             if (!isset($myScaleX)) {
                                 $myScaleX = RevSliderFunctions::get_biggest_device_setting($scaleX, $enabled_sizes);
                             }
                             if (trim($myScaleX) == '' || $myScaleX == 'NaNpx' || $myScaleX == 'auto') {
                                 $myScaleX = '';
                             } else {
                                 $myScaleX = "['" . $myScaleX . "','" . $myScaleX . "','" . $myScaleX . "','" . $myScaleX . "']";
                             }
                         }
                     }
                     if ($scaleY !== '') {
                         if (!is_object($scaleY)) {
                             if (trim($scaleY) == '' || $scaleY == 'NaNpx') {
                                 $scaleY = 'auto';
                             }
                             $myScaleY = $scaleY;
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $myScaleY = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $myScaleY = 'full-proportional';
                                 }
                                 break;
                             }
                         } else {
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $scaleY->{$cvmk} = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $scaleY->{$cvmk} = 'full-proportional';
                                 }
                             }
                             $myScaleY = RevSliderFunctions::normalize_device_settings($scaleY, $enabled_sizes, 'html-array', array('NaNpx' => '', 'auto' => ''));
                             if ($myScaleY == "['','','','']") {
                                 $myScaleY = '';
                             }
                             if (strpos($myScaleY, '[') !== false) {
                                 $y_is_single = false;
                             }
                         }
                         if ($y_is_single) {
                             //force to array if voffset is also array
                             if (!isset($myScaleY)) {
                                 $myScaleY = RevSliderFunctions::get_biggest_device_setting($scaleY, $enabled_sizes);
                             }
                             if (trim($myScaleY) == '' || $myScaleY == 'NaNpx' || $myScaleY == 'auto') {
                                 $myScaleY = '';
                             } else {
                                 $myScaleY = "['" . $myScaleY . "','" . $myScaleY . "','" . $myScaleY . "','" . $myScaleY . "']";
                             }
                         }
                     }
                 } else {
                     $myScaleX = is_object($scaleX) ? RevSliderFunctions::get_biggest_device_setting($scaleX, $enabled_sizes) : $scaleX;
                     if (trim($myScaleX) == '' || $myScaleX == 'NaNpx') {
                         $myScaleX = 'auto';
                     }
                     $myScaleY = is_object($scaleY) ? RevSliderFunctions::get_biggest_device_setting($scaleY, $enabled_sizes) : $scaleY;
                     if (trim($myScaleY) == '' || $myScaleY == 'NaNpx') {
                         $myScaleY = 'auto';
                     }
                     foreach ($cover_mode as $cvmk => $cvmv) {
                         if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                             $myScaleX = 'full';
                         }
                         if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                             $myScaleY = 'full';
                         }
                         if ($cvmv == 'cover-proportional') {
                             $myScaleX = 'full-proportional';
                         }
                         if ($cvmv == 'cover-proportional') {
                             $myScaleY = 'full-proportional';
                         }
                         break;
                     }
                 }
                 if ($scaleX != '') {
                     $additional .= ' data-ww="' . $myScaleX . '"';
                 }
                 if ($scaleY != '') {
                     $additional .= ' data-hh="' . $myScaleY . '"';
                 }
                 if (is_ssl()) {
                     $urlImage = str_replace("http://", "https://", $urlImage);
                 }
                 $do_ll = RevSliderFunctions::getVal($layer, "lazy-load", 'auto');
                 $imageAddParams = "";
                 if ($lazyLoad != 'none' || $do_ll == 'force' && $do_ll !== 'ignore') {
                     $seo_opti = RevSliderFunctions::getVal($layer, 'seo-optimized', false);
                     if ($seo_opti === 'false' || $seo_opti === false) {
                         $imageAddParams .= ' data-lazyload="' . $urlImage . '"';
                         $urlImage = RS_PLUGIN_URL . "admin/assets/images/dummy.png";
                     } else {
                         $additional .= ' class="forceseo"';
                     }
                 }
                 $html = '<img src="' . $urlImage . '" alt="' . $alt . '"' . $additional . $imageAddParams . ' data-no-retina>';
                 $imageLink = RevSliderFunctions::getVal($layer, "link", "");
                 //add more inline styling
                 $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
                 if (!empty($static_styles) && trim($class) !== '') {
                     $static_styles = (array) $static_styles;
                     if (!empty($static_styles['line-height'])) {
                         $static_styles['line-height'] = RevSliderFunctions::add_missing_val($static_styles['line-height'], 'px');
                         if (is_object($static_styles['line-height'])) {
                             $mclh = RevSliderFunctions::get_biggest_device_setting($static_styles['line-height'], $enabled_sizes);
                         } else {
                             $mclh = $static_styles['line-height'];
                         }
                         if ($mclh !== $dlh) {
                             $inline_styles .= ' line-height: ' . $mclh . ';';
                         }
                     }
                 }
                 if ($layer_2d_rotation !== 0) {
                     $do_rotation = true;
                 }
                 break;
             case 'audio':
                 $videoType = trim(RevSliderFunctions::getVal($layer, 'video_type'));
                 $videoWidth = RevSliderFunctions::getVal($layer, 'video_width');
                 $videoHeight = RevSliderFunctions::getVal($layer, 'video_height');
                 $videoArgs = trim(RevSliderFunctions::getVal($videoData, 'args'));
                 $v_controls = RevSliderFunctions::getVal($videoData, 'controls');
                 $v_controls = RevSliderFunctions::strToBool($v_controls);
                 $v_visible = RevSliderFunctions::getVal($videoData, 'video_show_visibility');
                 $v_visible = RevSliderFunctions::strToBool($v_visible);
                 $videopreload = RevSliderFunctions::getVal($videoData, "preload_audio");
                 $videopreloadwait = RevSliderFunctions::getVal($videoData, "preload_wait");
                 $start_at = RevSliderFunctions::getVal($videoData, 'start_at');
                 $htmlStartAt = $start_at !== '' ? ' data-videostartat="' . $start_at . '"' : '';
                 $end_at = RevSliderFunctions::getVal($videoData, 'end_at');
                 $htmlEndAt = $end_at !== '' ? ' data-videoendat="' . $end_at . '"' : '';
                 $rewind = RevSliderFunctions::getVal($videoData, 'forcerewind');
                 $rewind = RevSliderFunctions::strToBool($rewind);
                 $htmlRewind = $rewind == true ? ' data-forcerewind="on"' : '';
                 $volume = RevSliderFunctions::getVal($videoData, "volume", '100');
                 $htmlMute = '			data-volume="' . intval($volume) . '"';
                 if ($v_visible === true) {
                     $videoclass .= ' tp-hiddenaudio';
                 }
                 if ($adv_resp_sizes == true) {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::normalize_device_settings($videoWidth, $enabled_sizes, 'html-array');
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::normalize_device_settings($videoHeight, $enabled_sizes, 'html-array');
                     }
                 } else {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::get_biggest_device_setting($videoWidth, $enabled_sizes);
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::get_biggest_device_setting($videoHeight, $enabled_sizes);
                     }
                 }
                 $videoloop = RevSliderFunctions::getVal($videoData, "videoloop");
                 $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                 $add_data .= ' data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                 if (!empty($videopreload)) {
                     $add_data .= ' data-videopreload="' . $videopreload . '"';
                     $add_data .= ' data-videopreloadwait="' . intval($videopreloadwait) . '"';
                 }
                 $add_data .= ' data-audio="html5"';
                 $urlAudio = esc_attr(RevSliderFunctions::getVal($videoData, 'urlAudio'));
                 if (!empty($urlAudio)) {
                     $add_data .= ' data-videomp4="' . $urlAudio . '"';
                 }
                 if (RevSliderFunctions::strToBool($videoloop) == true) {
                     //fallback
                     $add_data .= ' data-videoloop="loop"';
                 } else {
                     $add_data .= ' data-videoloop="' . $videoloop . '"';
                 }
                 $videoAutoplay = false;
                 if (array_key_exists("autoplayonlyfirsttime", $videoData)) {
                     $autoplayonlyfirsttime = RevSliderFunctions::strToBool(RevSliderFunctions::getVal($videoData, "autoplayonlyfirsttime"));
                     if ($autoplayonlyfirsttime == true) {
                         $videoAutoplay = '1sttime';
                     }
                 }
                 if ($videoAutoplay == false) {
                     if (array_key_exists("autoplay", $videoData)) {
                         $videoAutoplay = RevSliderFunctions::getVal($videoData, "autoplay");
                     } else {
                         //backword compatability
                         $videoAutoplay = RevSliderFunctions::getVal($layer, "video_autoplay");
                     }
                 }
                 if ($videoAutoplay !== false && $videoAutoplay !== 'false') {
                     if ($videoAutoplay === true || $videoAutoplay === 'true') {
                         $videoAutoplay = 'on';
                     }
                     $htmlVideoAutoplay = '			data-autoplay="' . $videoAutoplay . '"' . " \n";
                 } else {
                     $htmlVideoAutoplay = '			data-autoplay="off"' . " \n";
                 }
                 $videoNextSlide = RevSliderFunctions::getVal($videoData, "nextslide");
                 $videoNextSlide = RevSliderFunctions::strToBool($videoNextSlide);
                 if ($videoNextSlide == true) {
                     $htmlVideoNextSlide = '			data-nextslideatend="true"' . " \n";
                 }
                 $stopallvideo = RevSliderFunctions::getVal($videoData, "stopallvideo");
                 $stopallvideo = RevSliderFunctions::strToBool($stopallvideo);
                 $htmlDisableOnMobile .= $stopallvideo ? '			data-stopallvideos="true"' . " \n" : '';
                 break;
             case 'video':
                 $videoType = trim(RevSliderFunctions::getVal($layer, 'video_type'));
                 $videoID = trim(RevSliderFunctions::getVal($layer, 'video_id'));
                 $videoWidth = RevSliderFunctions::getVal($layer, 'video_width');
                 $videoHeight = RevSliderFunctions::getVal($layer, 'video_height');
                 $videoArgs = trim(RevSliderFunctions::getVal($layer, 'video_args'));
                 $v_controls = RevSliderFunctions::getVal($videoData, 'controls');
                 $v_controls = RevSliderFunctions::strToBool($v_controls);
                 $start_at = RevSliderFunctions::getVal($videoData, 'start_at');
                 $htmlStartAt = $start_at !== '' ? ' data-videostartat="' . $start_at . '"' : '';
                 $end_at = RevSliderFunctions::getVal($videoData, 'end_at');
                 $htmlEndAt = $end_at !== '' ? ' data-videoendat="' . $end_at . '"' : '';
                 $show_cover_pause = RevSliderFunctions::getVal($videoData, 'show_cover_pause');
                 $show_cover_pause = RevSliderFunctions::strToBool($show_cover_pause);
                 $htmlCoverPause = $show_cover_pause == true ? ' data-showcoveronpause="on"' : '';
                 $rewind = RevSliderFunctions::getVal($videoData, 'forcerewind');
                 $rewind = RevSliderFunctions::strToBool($rewind);
                 $htmlRewind = $rewind == true ? ' data-forcerewind="on"' : '';
                 $only_poster_on_mobile = isset($layer['video_data']->use_poster_on_mobile) ? $layer['video_data']->use_poster_on_mobile : '';
                 $only_poster_on_mobile = RevSliderFunctions::strToBool($only_poster_on_mobile);
                 if ($isFullWidthVideo == true) {
                     // || $cover == true
                     $videoWidth = '100%';
                     $videoHeight = '100%';
                 }
                 if ($adv_resp_sizes == true) {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::normalize_device_settings($videoWidth, $enabled_sizes, 'html-array');
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::normalize_device_settings($videoHeight, $enabled_sizes, 'html-array');
                     }
                 } else {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::get_biggest_device_setting($videoWidth, $enabled_sizes);
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::get_biggest_device_setting($videoHeight, $enabled_sizes);
                     }
                 }
                 $setBase = is_ssl() ? 'https://' : 'http://';
                 $cover = RevSliderFunctions::getVal($videoData, 'cover');
                 $cover = RevSliderFunctions::strToBool($cover);
                 $videoloop = RevSliderFunctions::getVal($videoData, "videoloop");
                 $mute = RevSliderFunctions::getVal($videoData, "mute");
                 $mute = RevSliderFunctions::strToBool($mute);
                 $htmlMute = $mute ? '			data-volume="mute"' : '';
                 switch ($videoType) {
                     case 'streamyoutube':
                     case 'streamyoutubeboth':
                     case 'youtube':
                         if ($videoType == 'streamyoutube' || $videoType == 'streamyoutubeboth') {
                             //change $videoID to the stream!
                             $videoID = $slide->getParam('slide_bg_youtube', '');
                         }
                         if (empty($videoArgs)) {
                             $videoArgs = RevSliderGlobals::DEFAULT_YOUTUBE_ARGUMENTS;
                         }
                         if (!$mute) {
                             $volume = RevSliderFunctions::getVal($videoData, "volume", '100');
                             $htmlMute = '			data-volume="' . intval($volume) . '"';
                             $videoArgs = 'volume=' . intval($volume) . '&' . $videoArgs;
                         }
                         if ($start_at !== '') {
                             $start_raw = explode(':', $start_at);
                             if (count($start_raw) == 2) {
                                 if (intval($start_raw[0]) > 0) {
                                     $start_at = $start_raw[0] * 60 + $start_raw[1];
                                 } else {
                                     $start_at = $start_raw[1];
                                 }
                             }
                             $videoArgs .= $start_at !== '' ? '&start=' . $start_at : '';
                         }
                         if ($end_at !== '') {
                             $end_raw = explode(':', $end_at);
                             if (count($end_raw) == 2) {
                                 if (intval($end_raw[0]) > 0) {
                                     $end_at = $end_raw[0] * 60 + $end_raw[1];
                                 } else {
                                     $end_at = $end_raw[1];
                                 }
                             }
                             $videoArgs .= $end_at !== '' ? '&end=' . $end_at : '';
                         }
                         //check if full URL
                         if (strpos($videoID, 'http') !== false) {
                             //we have full URL, split it to ID
                             parse_str(parse_url($videoID, PHP_URL_QUERY), $my_v_ret);
                             $videoID = $my_v_ret['v'];
                         }
                         $videospeed = RevSliderFunctions::getVal($videoData, 'videospeed', '1');
                         $videoArgs .= ';origin=' . $setBase . $_SERVER['SERVER_NAME'] . ';';
                         $add_data = ' data-ytid="' . $videoID . '" data-videoattributes="version=3&amp;enablejsapi=1&amp;html5=1&amp;' . $videoArgs . '" data-videorate="' . $videospeed . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         break;
                     case 'streamvimeo':
                     case 'streamvimeoboth':
                     case 'vimeo':
                         if ($videoType == 'streamvimeo' || $videoType == 'streamvimeoboth') {
                             //change $videoID
                             $videoID = $slide->getParam('slide_bg_vimeo', '');
                         }
                         if (empty($videoArgs)) {
                             $videoArgs = RevSliderGlobals::DEFAULT_VIMEO_ARGUMENTS;
                         }
                         if ($v_controls) {
                             $videoArgs = 'background=1&' . $videoArgs;
                         }
                         //check if full URL
                         if (strpos($videoID, 'http') !== false) {
                             //we have full URL, split it to ID
                             $videoID = (int) substr(parse_url($videoID, PHP_URL_PATH), 1);
                         }
                         if (!$mute) {
                             $volume = RevSliderFunctions::getVal($videoData, "volume", '100');
                             $htmlMute = '			data-volume="' . intval($volume) . '"';
                         }
                         $add_data = ' data-vimeoid="' . $videoID . '" data-videoattributes="' . $videoArgs . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         break;
                     case 'streaminstagram':
                     case 'streaminstagramboth':
                     case 'html5':
                         $urlPoster = RevSliderFunctions::getVal($videoData, "urlPoster");
                         $urlMp4 = RevSliderFunctions::getVal($videoData, "urlMp4");
                         $urlWebm = RevSliderFunctions::getVal($videoData, "urlWebm");
                         $urlOgv = RevSliderFunctions::getVal($videoData, "urlOgv");
                         $videopreload = RevSliderFunctions::getVal($videoData, "preload");
                         $leave_on_pause = RevSliderFunctions::getVal($videoData, "leave_on_pause");
                         $leave_on_pause = RevSliderFunctions::strToBool($leave_on_pause);
                         if (!$leave_on_pause) {
                             $add_data .= ' data-exitfullscreenonpause="off"';
                             //nur wenn off, standard on
                         }
                         if ($videoType == 'streaminstagram' || $videoType == 'streaminstagramboth') {
                             //change $videoID
                             $urlMp4 = $slide->getParam('slide_bg_instagram', '');
                             $urlWebm = '';
                             $urlOgv = '';
                         }
                         $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         $add_data .= ' data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         if (is_ssl()) {
                             $urlPoster = str_replace("http://", "https://", $urlPoster);
                         }
                         if (!empty($urlPoster)) {
                             $add_data .= ' data-videoposter="' . $urlPoster . '"';
                         }
                         if (!empty($urlOgv)) {
                             $add_data .= ' data-videoogv="' . $urlOgv . '"';
                         }
                         if (!empty($urlWebm)) {
                             $add_data .= ' data-videowebm="' . $urlWebm . '"';
                         }
                         if (!empty($urlMp4)) {
                             $add_data .= ' data-videomp4="' . $urlMp4 . '"';
                         }
                         if (!empty($urlPoster)) {
                             if ($only_poster_on_mobile === true) {
                                 //$add_data .= ' data-posterOnMobile="on"';
                                 $add_data .= ' data-noposteronmobile="on"';
                             } else {
                                 //$add_data .= ' data-posterOnMobile="off"';
                                 $add_data .= ' data-noposteronmobile="off"';
                             }
                         }
                         if (!empty($videopreload)) {
                             $add_data .= ' data-videopreload="' . $videopreload . '"';
                         }
                         break;
                     default:
                         RevSliderFunctions::throwError("wrong video type: {$videoType}");
                         break;
                 }
                 if (RevSliderFunctions::strToBool($videoloop) == true) {
                     //fallback
                     $add_data .= ' data-videoloop="loop"';
                 } else {
                     $add_data .= ' data-videoloop="' . $videoloop . '"';
                 }
                 if ($cover == true) {
                     $dotted = RevSliderFunctions::getVal($videoData, "dotted");
                     if ($dotted !== 'none') {
                         $add_data .= ' data-dottedoverlay="' . $dotted . '"';
                     }
                     $add_data .= ' data-forceCover="1"';
                     $ratio = RevSliderFunctions::getVal($videoData, "ratio");
                     if (!empty($ratio)) {
                         $add_data .= ' data-aspectratio="' . $ratio . '"';
                     }
                 }
                 $videoAutoplay = false;
                 if (array_key_exists("autoplayonlyfirsttime", $videoData)) {
                     $autoplayonlyfirsttime = RevSliderFunctions::strToBool(RevSliderFunctions::getVal($videoData, "autoplayonlyfirsttime"));
                     if ($autoplayonlyfirsttime == true) {
                         $videoAutoplay = '1sttime';
                     }
                 }
                 if ($videoAutoplay == false) {
                     if (array_key_exists("autoplay", $videoData)) {
                         $videoAutoplay = RevSliderFunctions::getVal($videoData, "autoplay");
                     } else {
                         //backword compatability
                         $videoAutoplay = RevSliderFunctions::getVal($layer, "video_autoplay");
                     }
                 }
                 if ($videoAutoplay !== false && $videoAutoplay !== 'false') {
                     if ($videoAutoplay === true || $videoAutoplay === 'true') {
                         $videoAutoplay = 'on';
                     }
                     $htmlVideoAutoplay = '			data-autoplay="' . $videoAutoplay . '"' . " \n";
                 } else {
                     $htmlVideoAutoplay = '			data-autoplay="off"' . " \n";
                 }
                 $large_controls = RevSliderFunctions::strToBool(RevSliderFunctions::getVal($videoData, "large_controls"));
                 if (!$large_controls) {
                     $add_data .= ' data-viodelargecontrols="off"';
                 }
                 $videoNextSlide = RevSliderFunctions::getVal($videoData, "nextslide");
                 $videoNextSlide = RevSliderFunctions::strToBool($videoNextSlide);
                 if ($videoNextSlide == true) {
                     $htmlVideoNextSlide = '			data-nextslideatend="true"' . " \n";
                 }
                 $videoThumbnail = isset($videoData["previewimage"]) ? $videoData["previewimage"] : '';
                 if (is_ssl()) {
                     $videoThumbnail = str_replace("http://", "https://", $videoThumbnail);
                 } else {
                     $videoThumbnail = str_replace("https://", "http://", $videoThumbnail);
                 }
                 if (trim($videoThumbnail) !== '') {
                     $htmlVideoThumbnail = '			data-videoposter="' . $videoThumbnail . '"' . " \n";
                 }
                 if (!empty($videoThumbnail)) {
                     if ($only_poster_on_mobile === true) {
                         //$htmlVideoThumbnail .= '			data-posterOnMobile="on"'." \n";
                         $htmlVideoThumbnail .= '			data-noposteronmobile="on"' . " \n";
                     } else {
                         //$htmlVideoThumbnail .= '			data-posterOnMobile="off"'." \n";
                         $htmlVideoThumbnail .= '			data-noposteronmobile="off"' . " \n";
                     }
                 }
                 $disable_on_mobile = RevSliderFunctions::getVal($videoData, "disable_on_mobile");
                 $disable_on_mobile = RevSliderFunctions::strToBool($disable_on_mobile);
                 $htmlDisableOnMobile = $disable_on_mobile ? '			data-disablevideoonmobile="1"' . " \n" : '';
                 $stopallvideo = RevSliderFunctions::getVal($videoData, "stopallvideo");
                 $stopallvideo = RevSliderFunctions::strToBool($stopallvideo);
                 $allowfullscreenvideo = RevSliderFunctions::getVal($videoData, "allowfullscreen");
                 $allowfullscreenvideo = RevSliderFunctions::strToBool($allowfullscreenvideo);
                 $htmlDisableOnMobile .= $stopallvideo ? '			data-stopallvideos="true"' . " \n" : '';
                 $htmlDisableOnMobile .= $allowfullscreenvideo ? '			data-allowfullscreenvideo="true"' . " \n" : '';
                 break;
         }
         $has_trigger = false;
         foreach ($layers as $cl) {
             if ($has_trigger) {
                 break;
             }
             $all_actions = RevSliderFunctions::getVal($cl, 'layer_action', array());
             if (!empty($all_actions)) {
                 $a_action = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'action', array()));
                 $a_layer_target = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'layer_target', array()));
                 foreach ($a_action as $ak => $aa) {
                     switch ($aa) {
                         case 'start_in':
                         case 'start_out':
                         case 'toggle_layer':
                             /*case 'stop_video':
                             		case 'start_video':
                             		case 'toggle_video':*/
                             if ($unique_id == $a_layer_target[$ak]) {
                                 $has_trigger = true;
                                 break;
                             }
                             break;
                     }
                 }
             }
         }
         $last_trigger_state = '';
         $animation_overwrite = 'default';
         $trigger_memory = 'keep';
         if ($has_trigger) {
             $animation_overwrite = RevSliderFunctions::getVal($layer, 'animation_overwrite', 'wait');
             $trigger_memory = RevSliderFunctions::getVal($layer, 'trigger_memory', 'keep');
             $last_trigger_state = '			data-lasttriggerstate="' . esc_attr($trigger_memory) . '"';
         }
         if ($animation_overwrite == 'waitin' || $animation_overwrite == 'wait') {
             $time = 'bytrigger';
         }
         if ($animation_overwrite == 'waitout' || $animation_overwrite == 'wait') {
             $htmlEnd = ' data-end="bytrigger"' . "\n";
         } else {
             //handle end transitions:
             $endTime = trim(RevSliderFunctions::getVal($layer, 'endtime', 0));
             $endWithSlide = RevSliderFunctions::getVal($layer, 'endWithSlide', false);
             //backwards compatibility
             $realEndTime = UniteFunctionsRev::getVal($layer, "realEndTime", false);
             if ($realEndTime !== false) {
                 $endSpeed = trim(UniteFunctionsRev::getVal($layer, "endspeed"));
                 $speed = UniteFunctionsRev::getVal($layer, "speed", 300);
                 $calcSpeed = !empty($endSpeed) ? $endSpeed : $speed;
                 if (!empty($calcSpeed) && $realEndTime - $calcSpeed !== $endTime) {
                     $endTime = $realEndTime - $calcSpeed;
                 }
             }
             //backwards compatibility end
             $htmlEnd = '';
             //endtime - endspeed
             $es = RevSliderFunctions::getVal($layer, 'endspeed', 0);
             if (!empty($endTime) && $endTime - $es < 0) {
                 $endTime = 0;
             } else {
                 $endTime = $endTime - $es;
             }
         }
         $show_on_hover = RevSliderFunctions::getVal($layer, 'show-on-hover', false);
         if ($show_on_hover === 'show-on-hover' || is_array($show_on_hover) && $show_on_hover[0] == 'show-on-hover') {
             $show_on_hover = false;
         }
         //fix for layers that occured in version 5.2.2 and 5.2.3
         if ($show_on_hover == true) {
             $time = 'sliderenter';
             $htmlEnd = ' data-end="sliderleave"' . " \n";
         } else {
             if (!empty($endTime) && $endWithSlide !== true) {
                 $htmlEnd = ' data-end="' . $endTime . '"' . " \n";
             }
         }
         $customout = '';
         $maskout = '';
         //add animation to class
         $endAnimation = trim(RevSliderFunctions::getVal($layer, "endanimation"));
         if ($endAnimation == "fade") {
             $endAnimation = "tp-fade";
         }
         if (!array_key_exists($endAnimation, $endAnimations) && array_key_exists($endAnimation, $customEndAnimations)) {
             //if true, add custom animation
             //check with custom values, if same, we do not need to write all down and just refer
         }
         $tcout = '';
         if ($endAnimation !== 'auto') {
             $tcout = RevSliderOperations::parseCustomAnimationByArray($layer, 'end');
         } else {
             //automatic reverse
             $tcout .= 'auto:auto;';
         }
         if ($endAnimation == 'auto') {
             $es = RevSliderFunctions::getVal($layer, 'endspeed');
             $ee = trim(RevSliderFunctions::getVal($layer, 'endeasing'));
             if (!empty($es)) {
                 $tcout .= 's:' . $es . ';';
             }
             if (!empty($ee) && $ee !== 'nothing') {
                 $tcout .= 'e:' . $ee . ';';
             }
         }
         if ($tcout !== '') {
             $customout = ' data-transform_out="' . $tcout . '"';
         }
         $do_mask_out = RevSliderFunctions::getVal($layer, 'mask_end', false);
         if ($do_mask_out) {
             $tmask = RevSliderOperations::parseCustomMaskByArray($layer, 'end');
             if ($tmask !== '') {
                 $maskout = ' data-mask_out="' . $tmask . '"';
             }
         }
         //slide link
         $html_simple_link = '';
         //hidden under resolution
         $htmlHidden = '';
         $layerHidden = RevSliderFunctions::getVal($layer, 'hiddenunder');
         if ($layerHidden == 'true' || $layerHidden == '1') {
             $htmlHidden = '			data-captionhidden="on"' . " \n";
         }
         $htmlParams = $add_data . $htmlEnd . $last_trigger_state . $htmlVideoAutoplay . $htmlVideoNextSlide . $htmlVideoThumbnail . $htmlHidden . $htmlMute . $htmlDisableOnMobile . $htmlCover . $htmlDotted . $htmlRatio . $htmlRewind . $htmlStartAt . $htmlEndAt . $htmlCoverPause . "\n";
         //.$htmlVideoAutoplayOnlyFirstTime
         //set positioning options
         $alignHor = RevSliderFunctions::getVal($layer, 'align_hor', 'left');
         $alignVert = RevSliderFunctions::getVal($layer, 'align_vert', 'top');
         $left = RevSliderFunctions::getVal($layer, 'left', 0);
         $top = RevSliderFunctions::getVal($layer, 'top', 0);
         $htmlPosX = '';
         $htmlPosY = '';
         $static_data = '';
         $extra_data = '';
         if ($adv_resp_sizes == true) {
             $do_x_full = false;
             $do_y_full = false;
             $x_is_single = true;
             $y_is_single = true;
             if (!is_object($left)) {
                 $myLeft = $left;
                 $myLeft = "['" . $myLeft . "','" . $myLeft . "','" . $myLeft . "','" . $myLeft . "']";
             } else {
                 $myLeft = RevSliderFunctions::normalize_device_settings($left, $enabled_sizes, 'html-array');
                 if (strpos($myLeft, '[') !== false) {
                     $do_x_full = true;
                 } else {
                     $myLeft = "['" . $myLeft . "','" . $myLeft . "','" . $myLeft . "','" . $myLeft . "']";
                 }
             }
             if (!is_object($top)) {
                 $myTop = $top;
                 $myTop = "['" . $myTop . "','" . $myTop . "','" . $myTop . "','" . $myTop . "']";
             } else {
                 $myTop = RevSliderFunctions::normalize_device_settings($top, $enabled_sizes, 'html-array');
                 if (strpos($myTop, '[') !== false) {
                     $do_y_full = true;
                 } else {
                     $myTop = "['" . $myTop . "','" . $myTop . "','" . $myTop . "','" . $myTop . "']";
                 }
             }
             if (!is_object($alignHor)) {
                 $myHor = $alignHor;
                 $myHor = "['" . $myHor . "','" . $myHor . "','" . $myHor . "','" . $myHor . "']";
             } else {
                 $myHor = RevSliderFunctions::normalize_device_settings($alignHor, $enabled_sizes, 'html-array');
                 if (strpos($myHor, '[') !== false) {
                     $x_is_single = false;
                 } else {
                     $myHor = "['" . $myHor . "','" . $myHor . "','" . $myHor . "','" . $myHor . "']";
                 }
             }
             if (!is_object($alignVert)) {
                 $myVer = $alignVert;
                 $myVer = "['" . $myVer . "','" . $myVer . "','" . $myVer . "','" . $myVer . "']";
             } else {
                 $myVer = RevSliderFunctions::normalize_device_settings($alignVert, $enabled_sizes, 'html-array');
                 if (strpos($myVer, '[') !== false) {
                     $y_is_single = false;
                 } else {
                     $myVer = "['" . $myVer . "','" . $myVer . "','" . $myVer . "','" . $myVer . "']";
                 }
             }
             $htmlPosX = ' data-x="' . $myHor . '" data-hoffset="' . $myLeft . '"';
             $htmlPosY = ' data-y="' . $myVer . '" data-voffset="' . $myTop . '"';
             $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
             if (!empty($static_styles)) {
                 $static_styles = (array) $static_styles;
                 if (!empty($static_styles['font-size'])) {
                     if (is_object($static_styles['font-size'])) {
                         $ss_fs = RevSliderFunctions::normalize_device_settings($static_styles['font-size'], $enabled_sizes, 'html-array');
                         if (strpos($ss_fs, '[') !== false) {
                             $static_data .= str_replace('px', '', '			data-fontsize="' . $ss_fs . '"') . "\n";
                         }
                     }
                 }
                 if (!empty($static_styles['line-height'])) {
                     if (is_object($static_styles['line-height'])) {
                         $ss_lh = RevSliderFunctions::normalize_device_settings($static_styles['line-height'], $enabled_sizes, 'html-array');
                         if (strpos($ss_lh, '[') !== false) {
                             $static_data .= str_replace('px', '', '			data-lineheight="' . $ss_lh . '"') . "\n";
                         }
                     }
                 }
                 if (!empty($static_styles['font-weight'])) {
                     if (is_object($static_styles['font-weight'])) {
                         $ss_fw = RevSliderFunctions::normalize_device_settings($static_styles['font-weight'], $enabled_sizes, 'html-array');
                         if (strpos($ss_fw, '[') !== false) {
                             $static_data .= str_replace('px', '', '			data-fontweight="' . $ss_fw . '"') . "\n";
                         }
                     }
                 }
                 if (!empty($static_styles['color'])) {
                     if (is_object($static_styles['color'])) {
                         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
                         foreach ($static_styles['color'] as $sk => $sv) {
                             if (strpos($sv, 'rgb') !== false) {
                                 $static_styles['color']->{$sk} = RevSliderFunctions::rgba2hex($sv);
                             }
                             $color_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                             if ($color_trans > 0) {
                                 $color_trans *= 100;
                             }
                             $color_trans = intval($color_trans);
                             $static_styles['color']->{$sk} = RevSliderFunctions::hex2rgba($static_styles['color']->{$sk}, $color_trans);
                         }
                         $ss_c = RevSliderFunctions::normalize_device_settings($static_styles['color'], $enabled_sizes, 'html-array');
                         if (strpos($ss_c, '[') !== false) {
                             $static_data .= '			data-color="' . $ss_c . '"' . "\n";
                         }
                     }
                 }
             }
             $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
             $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
             $white_space = RevSliderFunctions::getVal($layer, 'whitespace', 'nowrap');
             $cover_mode = RevSliderFunctions::getVal($layer, 'cover_mode', array());
             if (is_string($cover_mode)) {
                 $cover_mode = array('desktop' => $cover_mode, 'notebook' => $cover_mode, 'tablet' => $cover_mode, 'mobile' => $cover_mode);
             } else {
                 //change to array
                 $cover_mode = (array) $cover_mode;
             }
             if (is_object($max_width)) {
                 $max_width = RevSliderFunctions::normalize_device_settings($max_width, $enabled_sizes);
                 if ($max_width->desktop == 'auto') {
                     $max_width->desktop = 'none';
                 }
                 if ($max_width->notebook == 'auto') {
                     $max_width->notebook = 'none';
                 }
                 if ($max_width->tablet == 'auto') {
                     $max_width->tablet = 'none';
                 }
                 if ($max_width->mobile == 'auto') {
                     $max_width->mobile = 'none';
                 }
                 if ($max_width->desktop == $max_width->notebook && $max_width->desktop == $max_width->tablet && $max_width->desktop == $max_width->mobile) {
                     $max_width = $max_width->desktop;
                 }
             }
             if (is_object($max_height)) {
                 $max_height = RevSliderFunctions::normalize_device_settings($max_height, $enabled_sizes);
                 if ($max_height->desktop == 'auto') {
                     $max_height->desktop = 'none';
                 }
                 if ($max_height->notebook == 'auto') {
                     $max_height->notebook = 'none';
                 }
                 if ($max_height->tablet == 'auto') {
                     $max_height->tablet = 'none';
                 }
                 if ($max_height->mobile == 'auto') {
                     $max_height->mobile = 'none';
                 }
                 if ($max_height->desktop == $max_height->notebook && $max_height->desktop == $max_height->tablet && $max_height->desktop == $max_height->mobile) {
                     $max_height = $max_height->desktop;
                 }
             }
             if (is_object($white_space)) {
                 $white_space = RevSliderFunctions::normalize_device_settings($white_space, $enabled_sizes);
                 if ($white_space->desktop == $white_space->notebook && $white_space->desktop == $white_space->tablet && $white_space->desktop == $white_space->mobile) {
                     $white_space = $white_space->desktop;
                 }
             }
             switch ($type) {
                 case 'shape':
                 case 'image':
                     if (is_object($max_width)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                 $max_width->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_width->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_width->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 } else {
                                     $max_width = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     if (is_object($max_height)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                 $max_height->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_height->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_height->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 } else {
                                     $max_height = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     break;
                 case 'svg':
                     break;
             }
             if ($type !== 'video') {
                 //$static_data .= (is_object($max_width)) ? str_replace('px', '', "			data-minwidth=\"['".implode("','", (array)$max_width)."']\"")."\n" : str_replace('px', '', '			data-minwidth="'.$max_width.'"')."\n";
                 $static_data .= is_object($max_width) ? str_replace('px', '', "\t\t\tdata-width=\"['" . implode("','", (array) $max_width) . "']\"") . "\n" : str_replace('px', '', '			data-width="' . $max_width . '"') . "\n";
                 //$static_data .= (is_object($max_height)) ? str_replace('px', '', "			data-minheight=\"['".implode("','", (array)$max_height)."']\"")."\n" : str_replace('px', '', '			data-minheight="'.$max_height.'"')."\n";
                 $static_data .= is_object($max_height) ? str_replace('px', '', "\t\t\tdata-height=\"['" . implode("','", (array) $max_height) . "']\"") . "\n" : str_replace('px', '', '			data-height="' . $max_height . '"') . "\n";
             }
             $static_data .= is_object($white_space) ? str_replace('px', '', "\t\t\tdata-whitespace=\"['" . implode("','", (array) $white_space) . "']\"") . "\n" : str_replace('px', '', '			data-whitespace="' . $white_space . '"') . "\n";
         } else {
             if (is_object($alignHor)) {
                 $alignHor = RevSliderFunctions::get_biggest_device_setting($alignHor, $enabled_sizes);
             }
             if (is_object($alignVert)) {
                 $alignVert = RevSliderFunctions::get_biggest_device_setting($alignVert, $enabled_sizes);
             }
             if (is_object($left)) {
                 $left = RevSliderFunctions::get_biggest_device_setting($left, $enabled_sizes);
             }
             if (is_object($top)) {
                 $top = RevSliderFunctions::get_biggest_device_setting($top, $enabled_sizes);
             }
             switch ($alignHor) {
                 default:
                 case 'left':
                     $htmlPosX = ' data-x="' . $left . '"';
                     break;
                 case 'center':
                     $htmlPosX = ' data-x="center" data-hoffset="' . $left . '"';
                     break;
                 case 'right':
                     //$left = (int)$left*-1;
                     $htmlPosX = ' data-x="right" data-hoffset="' . $left . '"';
                     break;
             }
             switch ($alignVert) {
                 default:
                 case 'top':
                     $htmlPosY = ' data-y="' . $top . '"';
                     break;
                 case 'middle':
                     $htmlPosY = ' data-y="center" data-voffset="' . $top . '"';
                     break;
                 case 'bottom':
                     //$top = (int)$top*-1;
                     $htmlPosY = ' data-y="bottom" data-voffset="' . $top . '"';
                     break;
             }
             $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
             $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
             $cover_mode = RevSliderFunctions::getVal($layer, 'cover_mode', array());
             if (is_string($cover_mode)) {
                 $cover_mode = array('desktop' => $cover_mode, 'notebook' => $cover_mode, 'tablet' => $cover_mode, 'mobile' => $cover_mode);
             } else {
                 //change to array
                 $cover_mode = (array) $cover_mode;
             }
             switch ($type) {
                 case 'shape':
                 case 'image':
                     if (is_object($max_width)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                 $max_width->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_width->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_width->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 } else {
                                     $max_width = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     if (is_object($max_height)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                 $max_height->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_height->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_height->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 } else {
                                     $max_height = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     break;
                 case 'svg':
                     break;
             }
             if ($type !== 'video') {
                 $static_data .= is_object($max_width) ? str_replace('px', '', "\t\t\tdata-width=\"['" . implode("','", (array) $max_width) . "']\"") . "\n" : str_replace('px', '', '			data-width="' . $max_width . '"') . "\n";
                 $static_data .= is_object($max_height) ? str_replace('px', '', "\t\t\tdata-height=\"['" . implode("','", (array) $max_height) . "']\"") . "\n" : str_replace('px', '', '			data-height="' . $max_height . '"') . "\n";
             }
         }
         $style_string = '';
         $vis_desktop = RevSliderFunctions::getVal($layer, 'visible-desktop', true);
         $vis_notebook = RevSliderFunctions::getVal($layer, 'visible-notebook', true);
         $vis_tablet = RevSliderFunctions::getVal($layer, 'visible-tablet', true);
         $vis_mobile = RevSliderFunctions::getVal($layer, 'visible-mobile', true);
         $vis_notebook = $vis_notebook === true ? 'on' : 'off';
         $vis_desktop = $vis_desktop === true ? 'on' : 'off';
         $vis_tablet = $vis_tablet === true ? 'on' : 'off';
         $vis_mobile = $vis_mobile === true ? 'on' : 'off';
         if ($vis_notebook == 'off' || $vis_desktop == 'off' || $vis_tablet == 'off' || $vis_mobile == 'off') {
             $static_data .= "\t\t\tdata-visibility=\"['" . $vis_desktop . "','" . $vis_notebook . "','" . $vis_tablet . "','" . $vis_mobile . "']\"\n";
         }
         $il_style = (array) RevSliderFunctions::getVal($layer, 'inline', array());
         $adv_style = (array) RevSliderFunctions::getVal($layer, 'advanced', array());
         //add deformation and hover deformation to the layers
         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
         $def = array();
         $st_idle = array();
         $def['o'] = array(RevSliderFunctions::getVal($def_val, 'opacity', '0'), '0');
         $def['sX'] = array(RevSliderFunctions::getVal($def_val, 'scalex', '1'), '1');
         $def['sY'] = array(RevSliderFunctions::getVal($def_val, 'scaley', '1'), '1');
         $def['skX'] = array(RevSliderFunctions::getVal($def_val, 'skewx', '0'), '0');
         $def['skY'] = array(RevSliderFunctions::getVal($def_val, 'skewy', '0'), '0');
         $def['rX'] = array(RevSliderFunctions::getVal($def_val, 'xrotate', '0'), '0');
         $def['rY'] = array(RevSliderFunctions::getVal($def_val, 'yrotate', '0'), '0');
         $def['rZ'] = array(RevSliderFunctions::getVal($layer, '2d_rotation', '0'), '0');
         $orix = RevSliderFunctions::getVal($def_val, '2d_origin_x', '50%');
         if (strpos($orix, '%') === false) {
             $orix .= '%';
         }
         $oriy = RevSliderFunctions::getVal($def_val, '2d_origin_y', '50%');
         if (strpos($oriy, '%') === false) {
             $oriy .= '%';
         }
         $def['tO'] = array($orix . ' ' . $oriy, '50% 50%');
         $def['tP'] = array(RevSliderFunctions::getVal($def_val, 'pers', '600'), '600');
         $def['z'] = array(RevSliderFunctions::getVal($def_val, 'z', '0'), '0');
         $st_idle['font-family'] = array(str_replace('"', "'", RevSliderFunctions::getVal($def_val, 'font-family', '')), str_replace('"', "'", $dff));
         $st_idle['text-align'] = array(RevSliderFunctions::getVal($def_val, 'text-align', 'left'), $dta);
         $st_idle['text-transform'] = array(RevSliderFunctions::getVal($def_val, 'text-transform', 'left'), $dttr);
         //styling
         $mfs = RevSliderFunctions::getVal($def_val, 'font-style', 'off');
         $font_style = $mfs == 'on' || $mfs == 'italic' ? 'italic' : 'normal';
         $st_idle['font-style'] = array($font_style, $dfs);
         $st_idle['text-decoration'] = array(RevSliderFunctions::getVal($def_val, 'text-decoration', 'none'), $dtd);
         $bg_color = RevSliderFunctions::getVal($def_val, 'background-color', $dbc);
         if ($bg_color !== 'transparent') {
             $bg_trans = RevSliderFunctions::getVal($def_val, 'background-transparency', $dbt);
             if ($bg_trans > 0) {
                 $bg_trans *= 100;
             }
             if ($dbt > 0) {
                 $dbt *= 100;
             }
             $bg_trans = intval($bg_trans);
             $dbt = intval($dbt);
             $st_idle['background-color'] = array(RevSliderFunctions::hex2rgba($bg_color, $bg_trans), RevSliderFunctions::hex2rgba($dbc, $dbt));
             //'ALWAYS'
         }
         $my_padding = RevSliderFunctions::getVal($def_val, 'padding', array('0px', '0px', '0px', '0px'));
         if (!empty($my_padding)) {
             if (is_array($my_padding)) {
                 $my_padding = implode(' ', $my_padding);
             }
             if (trim($my_padding) != '') {
                 $st_idle['padding'] = array($my_padding, $dpa);
             }
         }
         $border_color = RevSliderFunctions::getVal($def_val, 'border-color', $dboc);
         if ($border_color !== 'transparent') {
             $border_trans = RevSliderFunctions::getVal($def_val, 'border-transparency', $dbot);
             if ($border_trans > 0) {
                 $border_trans *= 100;
             }
             if ($dbot > 0) {
                 $dbot *= 100;
             }
             $border_trans = intval($border_trans);
             $dbot = intval($dbot);
             $st_idle['border-color'] = array(RevSliderFunctions::hex2rgba($border_color, $border_trans), RevSliderFunctions::hex2rgba($dboc, $dbot));
             //'ALWAYS'
         }
         $st_idle['border-style'] = array(RevSliderFunctions::getVal($def_val, 'border-style', 'none'), $dbs);
         $bdw = RevSliderFunctions::getVal($def_val, 'border-width', '0px');
         $bdw = RevSliderFunctions::add_missing_val($bdw, 'px');
         if ($bdw == '0px') {
             unset($st_idle['border-style']);
         }
         $st_idle['border-width'] = array($bdw, $dbw);
         $my_border = RevSliderFunctions::getVal($def_val, 'border-radius', array('0px', '0px', '0px', '0px'));
         if (!empty($my_border)) {
             $my_border = implode(' ', $my_border);
             if (trim($my_border) != '') {
                 $st_idle['border-radius'] = array($my_border, $dbr);
             }
         }
         //Advanced Styles here:
         if (isset($adv_style['idle'])) {
             $adv_style['idle'] = (array) $adv_style['idle'];
             if (!empty($adv_style['idle'])) {
                 foreach ($adv_style['idle'] as $n => $v) {
                     $st_idle[$n] = array($v, 'ALWAYS');
                 }
             }
         }
         //Advanced Styles here:
         if (isset($il_style['idle'])) {
             $il_style['idle'] = (array) $il_style['idle'];
             if (!empty($il_style['idle'])) {
                 foreach ($il_style['idle'] as $n => $v) {
                     $st_idle[$n] = array($v, 'ALWAYS');
                 }
             }
         }
         //get hover stuff, because of css_cursor
         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation-hover', array());
         //add the css_cursor to the idle styles
         $css_cursor = RevSliderFunctions::getVal($def_val, 'css_cursor', 'auto');
         if (trim($css_cursor) !== '' && $css_cursor !== 'auto') {
             if ($css_cursor == 'zoom-in') {
                 $css_cursor = '-webkit-zoom-in; cursor: -moz-zoom-in';
             }
             if ($css_cursor == 'zoom-out') {
                 $css_cursor = '-webkit-zoom-out; cursor: -moz-zoom-out';
             }
             $st_idle['cursor'] = array($css_cursor, 'auto');
         }
         $def_string = '';
         foreach ($def as $key => $value) {
             if (trim($value[0]) == '' || $value[0] == $value[1]) {
                 continue;
             }
             if (str_replace('px', '', $value[0]) == str_replace('px', '', $value[1])) {
                 continue;
             }
             $def_string .= $key . ':' . $value[0] . ';';
         }
         foreach ($st_idle as $key => $value) {
             if ($type == 'image' || $type == 'video') {
                 //do not print unneeded styles
                 if (in_array($key, $ignore_styles)) {
                     continue;
                 }
             }
             if (trim($value[0]) == '' || $value[0] == $value[1]) {
                 continue;
             }
             if (str_replace('px', '', $value[0]) == str_replace('px', '', $value[1])) {
                 continue;
             }
             $style_string .= $key . ':' . $value[0] . ';';
         }
         $deform = '			data-transform_idle="' . str_replace('"', "'", $def_string) . '"' . "\n";
         $idle_style = $style_string;
         //check if hover is active for the layer
         $is_hover_active = RevSliderFunctions::getVal($layer, 'hover', '0');
         $deform_hover = '';
         $style_hover = '';
         $def = array();
         $st_h_string = '';
         if ($is_hover_active) {
             $def['o'] = array(RevSliderFunctions::getVal($def_val, 'opacity', '0'), '0');
             $def['sX'] = array(RevSliderFunctions::getVal($def_val, 'scalex', '1'), '1');
             $def['sY'] = array(RevSliderFunctions::getVal($def_val, 'scaley', '1'), '1');
             $def['skX'] = array(RevSliderFunctions::getVal($def_val, 'skewx', '0'), '0');
             $def['skY'] = array(RevSliderFunctions::getVal($def_val, 'skewy', '0'), '0');
             $def['rX'] = array(RevSliderFunctions::getVal($def_val, 'xrotate', '0'), '0');
             $def['rY'] = array(RevSliderFunctions::getVal($def_val, 'yrotate', '0'), '0');
             $def['rZ'] = array(RevSliderFunctions::getVal($def_val, '2d_rotation', '0'), 'inherit');
             $def['z'] = array(RevSliderFunctions::getVal($def_val, 'z', '0'), '0');
             $def['s'] = array(RevSliderFunctions::getVal($def_val, 'speed', '300'), 'ALWAYS');
             $def['e'] = array(RevSliderFunctions::getVal($def_val, 'easing', 'easeOutExpo'), 'ALWAYS');
             //style
             $st_hover = array();
             $font_color = RevSliderFunctions::getVal($def_val, 'color', '#000');
             if ($font_color !== 'transparent') {
                 $font_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                 if ($font_trans > 0) {
                     $font_trans *= 100;
                 }
                 $font_trans = intval($font_trans);
                 $st_hover['c'] = array(RevSliderFunctions::hex2rgba($font_color, $font_trans), 'ALWAYS');
             } else {
                 $st_hover['c'] = array($font_color, 'ALWAYS');
             }
             $mfs = RevSliderFunctions::getVal($def_val, 'font-style', 'off');
             $font_style = $mfs == 'on' || $mfs == 'italic' ? 'italic' : 'normal';
             $st_hover['fs'] = array($font_style, 'normal');
             $st_hover['td'] = array(RevSliderFunctions::getVal($def_val, 'text-decoration', 'none'), 'none');
             $bg_color = RevSliderFunctions::getVal($def_val, 'background-color', 'transparent');
             if ($bg_color !== 'transparent') {
                 $bg_trans = RevSliderFunctions::getVal($def_val, 'background-transparency', 1);
                 if ($bg_trans > 0) {
                     $bg_trans *= 100;
                 }
                 $bg_trans = intval($bg_trans);
                 $st_hover['bg'] = array(RevSliderFunctions::hex2rgba($bg_color, $bg_trans), 'ALWAYS');
             }
             $my_padding = RevSliderFunctions::getVal($def_val, 'padding', array('0px', '0px', '0px', '0px'));
             if (!empty($my_padding)) {
                 $my_padding = implode(' ', $my_padding);
                 if (trim($my_padding) != '') {
                     $st_hover['p'] = array($my_padding, '0px 0px 0px 0px');
                 }
             }
             $border_color = RevSliderFunctions::getVal($def_val, 'border-color', 'transparent');
             if ($border_color !== 'transparent') {
                 $border_trans = RevSliderFunctions::getVal($def_val, 'border-transparency', 1);
                 if ($border_trans > 0) {
                     $border_trans *= 100;
                 }
                 $border_trans = intval($border_trans);
                 $st_hover['bc'] = array(RevSliderFunctions::hex2rgba($border_color, $border_trans), 'ALWAYS');
             }
             $st_hover['bs'] = array(RevSliderFunctions::getVal($def_val, 'border-style', 'none'), 'none');
             $st_hover['bw'] = array(RevSliderFunctions::add_missing_val(RevSliderFunctions::getVal($def_val, 'border-width', '0px'), 'px'), '0px');
             if ($st_hover['bw'][0] == '0px') {
                 unset($st_hover['bs']);
             }
             $my_border = RevSliderFunctions::getVal($def_val, 'border-radius', array('0px', '0px', '0px', '0px'));
             if (!empty($my_border)) {
                 $my_border = implode(' ', $my_border);
                 if (trim($my_border) != '') {
                     $brsthoverdw = isset($st_idle['border-radius']) && $st_idle['border-radius'] !== '0px 0px 0px 0px' ? 'ALWAYS' : '0px 0px 0px 0px';
                     $st_hover['br'] = array($my_border, $brsthoverdw);
                 }
             }
             $st_trans = array('c' => 'color', 'fs' => 'font-style', 'td' => 'text-decoration', 'bg' => 'background-color', 'p' => 'padding', 'bc' => 'border-color', 'bs' => 'border-style', 'bw' => 'border-width', 'br' => 'border-radius');
             foreach ($st_hover as $sk => $sv) {
                 //do not write values for hover if idle is the same value
                 if (isset($st_idle[$st_trans[$sk]]) && $st_idle[$st_trans[$sk]][0] == $sv[0]) {
                     unset($st_hover[$sk]);
                 }
             }
             //Advanced Styles here:
             if (isset($adv_style['hover'])) {
                 $adv_style['hover'] = (array) $adv_style['hover'];
                 if (!empty($adv_style['hover'])) {
                     foreach ($adv_style['hover'] as $n => $v) {
                         $st_hover[$n] = array($v, 'ALWAYS');
                     }
                 }
             }
             //Advanced Styles here:
             if (isset($il_style['hover'])) {
                 $il_style['hover'] = (array) $il_style['hover'];
                 if (!empty($il_style['hover'])) {
                     foreach ($il_style['hover'] as $n => $v) {
                         $st_hover[$n] = array($v, 'ALWAYS');
                     }
                 }
             }
             $def_string = '';
             foreach ($def as $key => $value) {
                 if (trim($value[0]) == '' || $value[0] === $value[1]) {
                     continue;
                 }
                 $def_string .= $key . ':' . $value[0] . ';';
             }
             foreach ($st_hover as $key => $value) {
                 if (trim($value[0]) == '' || $value[0] === $value[1]) {
                     continue;
                 }
                 $st_h_string .= $key . ':' . $value[0] . ';';
             }
             $deform_hover = '				data-transform_hover="' . $def_string . '"' . "\n";
         }
         if ($st_h_string !== '') {
             $style_hover = '				data-style_hover="' . $st_h_string . '"' . "\n";
         }
         $static_data .= $deform . $deform_hover . $style_hover;
         //set corners
         $htmlCorners = "";
         //if($type == "no_edit"){}
         if ($type == "text" || $type == "button") {
             $cornerdef = RevSliderFunctions::getVal($layer, "deformation");
             $cornerLeft = RevSliderFunctions::getVal($cornerdef, "corner_left");
             $cornerRight = RevSliderFunctions::getVal($cornerdef, "corner_right");
             switch ($cornerLeft) {
                 case "curved":
                     $htmlCorners .= "<div class='frontcorner'></div>";
                     break;
                 case "reverced":
                     $htmlCorners .= "<div class='frontcornertop'></div>";
                     break;
             }
             switch ($cornerRight) {
                 case "curved":
                     $htmlCorners .= "<div class='backcorner'></div>";
                     break;
                 case "reverced":
                     $htmlCorners .= "<div class='backcornertop'></div>";
                     break;
             }
         }
         //add resizeme class
         $resize_full = RevSliderFunctions::getVal($layer, "resize-full", true);
         if ($resize_full === true || $resize_full == 'true' || $resize_full == '1') {
             $resizeme = RevSliderFunctions::getVal($layer, "resizeme", true);
             if ($resizeme == "true" || $resizeme == "1") {
                 $outputClass .= ' tp-resizeme';
             }
         } else {
             //end text related layer
             $extra_data .= '			data-responsive="off"';
         }
         //make some modifications for the full screen video
         if ($isFullWidthVideo == true) {
             $htmlPosX = ' data-x="0"';
             $htmlPosY = ' data-y="0"';
             $outputClass .= ' fullscreenvideo';
         }
         //parallax part
         $use_parallax = $this->slider->getParam('use_parallax', $this->slider->getParam('use_parallax', 'off'));
         $parallax_class = '';
         if ($use_parallax == 'on') {
             $ldef = RevSliderFunctions::getVal($layer, 'deformation', array());
             $slide_level = RevSliderFunctions::getVal($ldef, 'parallax', '-');
             $parallax_ddd = $this->slider->getParam("ddd_parallax", "off");
             $parallax_ddd_bgfreeze = $this->slider->getParam("ddd_parallax_bgfreeze", "off");
             $ddd_z = RevSliderFunctions::getVal($layer, 'parallax_layer_ddd_zlevel', '');
             //bg , layers
             if ($parallax_ddd == "on" && $slide_level == "-" && $ddd_z === "bg") {
                 $slide_level = "tobggroup";
             }
             if ($slide_level !== '-') {
                 $parallax_class = ' rs-parallaxlevel-' . $slide_level;
             }
         }
         //check for actions
         $all_actions = RevSliderFunctions::getVal($layer, 'layer_action', array());
         $a_tooltip_event = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'tooltip_event', array()));
         $a_action = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'action', array()));
         $a_image_link = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'image_link', array()));
         $a_link_open_in = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'link_open_in', array()));
         $a_jump_to_slide = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'jump_to_slide', array()));
         $a_scrolloffset = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'scrollunder_offset', array()));
         $a_actioncallback = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'actioncallback', array()));
         $a_target = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'layer_target', array()));
         $a_action_delay = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'action_delay', array()));
         $a_link_type = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'link_type', array()));
         $a_toggle_layer_type = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'toggle_layer_type', array()));
         $a_toggle_class = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'toggle_class', array()));
         $a_html = '';
         $a_events = array();
         if (!empty($a_action)) {
             $a_html .= "\t\t\tdata-actions='";
             foreach ($a_action as $num => $action) {
                 $layer_attrID = '';
                 switch ($action) {
                     case 'start_in':
                     case 'start_out':
                     case 'start_video':
                     case 'stop_video':
                     case 'toggle_layer':
                     case 'toggle_video':
                     case 'simulate_click':
                     case 'toggle_class':
                     case 'toggle_mute_video':
                     case 'mute_video':
                     case 'unmute_video':
                         //get the ID of the layer with the unique_id that is $a_target[$num]
                         $layer_attrID = $slide->getLayerID_by_unique_id($a_target[$num], $this->static_slide);
                         if ($a_target[$num] == 'backgroundvideo' || $a_target[$num] == 'firstvideo') {
                             $layer_attrID = $a_target[$num];
                         } elseif (trim($layer_attrID) == '') {
                             if (strpos($a_target[$num], 'static-') !== false || $static_slide) {
                                 $layer_attrID = 'slider-' . preg_replace("/[^\\w]+/", "", $this->slider->getID()) . '-layer-' . str_replace('static-', '', $a_target[$num]);
                             } else {
                                 $layer_attrID = 'slide-' . preg_replace("/[^\\w]+/", "", $slideID) . '-layer-' . $a_target[$num];
                             }
                         }
                         break;
                 }
                 switch ($action) {
                     case 'none':
                         continue;
                         break;
                     case 'link':
                         //if post based, replace {{}} with correct info
                         //a_image_link
                         if (isset($a_image_link[$num])) {
                             $a_image_link[$num] = do_shortcode($a_image_link[$num]);
                         }
                         if (isset($a_link_type[$num]) && $a_link_type[$num] == 'jquery') {
                             /*
                             $setBase = (is_ssl()) ? "https://" : "http://";
                             if(strpos($a_image_link[$num], 'http') === false)
                             	$a_image_link[$num] = $setBase .$a_image_link[$num];
                             */
                             $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                             $a_link_open_in[$num] = isset($a_link_open_in[$num]) ? $a_link_open_in[$num] : '';
                             $a_image_link[$num] = isset($a_image_link[$num]) ? $a_image_link[$num] : '';
                             $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'simplelink', 'target' => $a_link_open_in[$num], 'url' => $a_image_link[$num]);
                         } else {
                             if ($html_simple_link == '') {
                                 //adds the link to the layer
                                 /*
                                 $setBase = (is_ssl()) ? "https://" : "http://";
                                 if(strpos($a_image_link[$num], 'http') === false)
                                 	$a_image_link[$num] = $setBase .$a_image_link[$num];
                                 */
                                 $a_image_link[$num] = isset($a_image_link[$num]) ? $a_image_link[$num] : '';
                                 $a_link_open_in[$num] = isset($a_link_open_in[$num]) ? $a_link_open_in[$num] : '';
                                 $html_simple_link = ' href="' . $a_image_link[$num] . '"';
                                 $html_simple_link .= ' target="' . $a_link_open_in[$num] . '"';
                             }
                         }
                         break;
                     case 'jumpto':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_jump_to_slide[$num] = isset($a_jump_to_slide[$num]) ? $a_jump_to_slide[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'jumptoslide', 'slide' => 'rs-' . $a_jump_to_slide[$num], 'delay' => $a_action_delay[$num]);
                         break;
                     case 'next':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'jumptoslide', 'slide' => 'next', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'gofullscreen':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'gofullscreen', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_global_mute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggle_global_mute_video', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'exitfullscreen':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'exitfullscreen', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'togglefullscreen':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'togglefullscreen', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'prev':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'jumptoslide', 'slide' => 'previous', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'pause':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'pauseslider');
                         break;
                     case 'resume':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'playslider');
                         break;
                     case 'toggle_slider':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggleslider');
                         break;
                     case 'callback':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_actioncallback[$num] = isset($a_actioncallback[$num]) ? $a_actioncallback[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'callback', 'callback' => $a_actioncallback[$num]);
                         break;
                     case 'scroll_under':
                         //ok
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_scrolloffset[$num] = isset($a_scrolloffset[$num]) ? $a_scrolloffset[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'scrollbelow', 'offset' => RevSliderFunctions::add_missing_val($a_scrolloffset[$num], 'px'));
                         break;
                     case 'start_in':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'startlayer', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'start_out':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'stoplayer', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_layer':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_toggle_layer_type[$num] = isset($a_toggle_layer_type[$num]) ? $a_toggle_layer_type[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'togglelayer', 'layerstatus' => $a_toggle_layer_type[$num], 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'start_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'playvideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'stop_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'stopvideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'mute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'mutevideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'unmute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'unmutevideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'togglevideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_mute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggle_mute_video', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'simulate_click':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'simulateclick', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_class':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_toggle_class[$num] = isset($a_toggle_class[$num]) ? $a_toggle_class[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggleclass', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num], 'classname' => $a_toggle_class[$num]);
                         break;
                 }
             }
             if (!empty($a_events)) {
                 $a_html .= json_encode($a_events);
             }
             $a_html .= "'\n";
         }
         //check for loop animation here
         $do_loop = RevSliderFunctions::getVal($layer, 'loop_animation', 'none');
         $loop_data = '';
         $loop_class = '';
         if ($do_loop !== 'none') {
             $loop_class = ' ' . $do_loop;
             switch ($do_loop) {
                 case 'rs-pendulum':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-startdeg="' . RevSliderFunctions::getVal($layer, 'loop_startdeg', '-20') . '"';
                     $loop_data .= ' data-enddeg="' . RevSliderFunctions::getVal($layer, 'loop_enddeg', '20') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '2') . '"';
                     $loop_data .= ' data-origin="' . RevSliderFunctions::getVal($layer, 'loop_xorigin', '50') . '% ' . RevSliderFunctions::getVal($layer, 'loop_yorigin', '50') . '%"';
                     break;
                 case 'rs-rotate':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-startdeg="' . RevSliderFunctions::getVal($layer, 'loop_startdeg', '-20') . '"';
                     $loop_data .= ' data-enddeg="' . RevSliderFunctions::getVal($layer, 'loop_enddeg', '20') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '2') . '"';
                     $loop_data .= ' data-origin="' . RevSliderFunctions::getVal($layer, 'loop_xorigin', '50') . '% ' . RevSliderFunctions::getVal($layer, 'loop_yorigin', '50') . '%"';
                     break;
                 case 'rs-slideloop':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '1') . '"';
                     $loop_data .= ' data-xs="' . RevSliderFunctions::getVal($layer, 'loop_xstart', '0') . '"';
                     $loop_data .= ' data-xe="' . RevSliderFunctions::getVal($layer, 'loop_xend', '0') . '"';
                     $loop_data .= ' data-ys="' . RevSliderFunctions::getVal($layer, 'loop_ystart', '0') . '"';
                     $loop_data .= ' data-ye="' . RevSliderFunctions::getVal($layer, 'loop_yend', '0') . '"';
                     break;
                 case 'rs-pulse':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '1') . '"';
                     $loop_data .= ' data-zoomstart="' . RevSliderFunctions::getVal($layer, 'loop_zoomstart', '1') . '"';
                     $loop_data .= ' data-zoomend="' . RevSliderFunctions::getVal($layer, 'loop_zoomend', '1') . '"';
                     break;
                 case 'rs-wave':
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '1') . '"';
                     $loop_data .= ' data-angle="' . RevSliderFunctions::getVal($layer, 'loop_angle', '0') . '"';
                     $loop_data .= ' data-radius="' . RevSliderFunctions::getVal($layer, 'loop_radius', '10') . '"';
                     $loop_data .= ' data-origin="' . RevSliderFunctions::getVal($layer, 'loop_xorigin', '50') . '% ' . RevSliderFunctions::getVal($layer, 'loop_yorigin', '50') . '%"';
                     break;
             }
         }
         if (!empty($svg_val) && sizeof($svg_val) > 0) {
             $outputClass .= ' tp-svg-layer';
         }
         $layer_id = $zIndex - 4;
         $use_tag = RevSliderFunctions::getVal($layer, 'html_tag', 'div');
         if ($html_simple_link !== '') {
             $use_tag = 'a';
         }
         echo "\n\t\t<!-- LAYER NR. ";
         echo $layer_id;
         echo " -->\n";
         echo '		<' . $use_tag . ' class="' . $outputClass;
         echo $classes != '' ? ' ' . $classes : '';
         echo $parallax_class;
         if ($static_slide) {
             echo ' tp-static-layer';
         }
         echo $videoclass;
         echo "\" \n";
         echo $html_simple_link;
         echo $ids != '' ? '			' . $ids . " \n" : '';
         echo $title != '' ? '			' . $title . " \n" : '';
         echo $rel != '' ? '			' . $rel . " \n" : '';
         if ($htmlPosX != '') {
             echo '			' . $htmlPosX . " \n";
         }
         if ($htmlPosY != '') {
             echo '			' . $htmlPosY . " \n";
         }
         if ($static_data != '') {
             echo '			' . $static_data . " \n";
         }
         if ($customin != '') {
             echo '			' . $customin . " \n";
         }
         if ($customout != '') {
             echo '			' . $customout . " \n";
         }
         if ($maskin != '') {
             echo '			' . $maskin . " \n";
         }
         if ($maskout != '') {
             echo '			' . $maskout . " \n";
         }
         echo '			data-start="' . $time . '"' . " \n";
         //if($type == 'no_edit'){}
         if ($type == 'text' || $type == 'button') {
             //only output if we are a text layer
             echo '			data-splitin="' . $splitin . '"' . " \n";
             echo '			data-splitout="' . $splitout . '"' . " \n";
         }
         do_action('revslider_add_layer_attributes', $layer, $slide, $this->slider);
         echo $a_html;
         // SVG OUTPUT
         if (!empty($svg_val) && sizeof($svg_val) > 0) {
             echo '			data-svg_src="' . $svg_val->{'src'} . '"' . " \n";
             echo '			data-svg_idle="sc:' . $svg_val->{'svgstroke-color'} . ';sw:' . $svg_val->{'svgstroke-width'} . ';sda:' . $svg_val->{'svgstroke-dasharray'} . ';sdo:' . $svg_val->{'svgstroke-dashoffset'} . ';"' . " \n";
             if ($is_hover_active) {
                 echo '			data-svg_hover="sc:' . $svg_val->{'svgstroke-hover-color'} . ';sw:' . $svg_val->{'svgstroke-hover-width'} . ';sda:' . $svg_val->{'svgstroke-hover-dasharray'} . ';sdo:' . $svg_val->{'svgstroke-hover-dashoffset'} . ';"' . " \n";
             }
         }
         if ($basealign !== 'grid') {
             echo '			data-basealign="' . $basealign . '"' . " \n";
         }
         $ro = RevSliderFunctions::getVal($layer, 'responsive_offset', true);
         if ($ro != 1) {
             echo '			data-responsive_offset="off"' . " \n";
         } else {
             echo '			data-responsive_offset="on"' . " \n";
         }
         echo $extra_data . "\n";
         //check if static layer and if yes, set values for it.
         if ($static_slide) {
             if ($isTemplate != "true" && $slider_type !== 'hero') {
                 $start_on_slide = intval(RevSliderFunctions::getVal($layer, "static_start", 1)) - 1;
                 $end_on_slide = RevSliderFunctions::getVal($layer, "static_end", 2);
                 if ($end_on_slide !== 'last') {
                     $end_on_slide = intval($end_on_slide) - 1;
                 } else {
                     //change number to the last slide number
                     $end_on_slide = count($this->slider->getArrSlideNames()) - 1;
                 }
             } else {
                 $start_on_slide = '-1';
                 $end_on_slide = '-1';
             }
             echo '			data-startslide="' . $start_on_slide . '"' . " \n";
             echo '			data-endslide="' . $end_on_slide . '"' . " \n";
         }
         if ($splitin !== 'none') {
             echo '			data-elementdelay="' . $elementdelay . '"' . " \n";
         }
         if ($splitout !== 'none') {
             echo '			data-endelementdelay="' . $endelementdelay . '"' . " \n";
         }
         if ($htmlParams != "") {
             echo "\t\t\t" . $htmlParams;
         }
         echo '			style="z-index: ' . $zIndex . ';' . $inline_styles . $idle_style . '"';
         //
         echo '>';
         if ($do_loop !== 'none') {
             echo "\n" . '<div class="rs-looped ' . trim($loop_class) . '" ' . $loop_data . '>';
         }
         if ($toggle_allow != false) {
             echo '<div class="rs-untoggled-content">';
         }
         echo apply_filters('revslider_layer_content', stripslashes($html), $html, $this->slider->getID(), $slide, $layer) . " ";
         if ($toggle_allow != false) {
             echo '</div>';
             echo '<div class="rs-toggled-content">' . stripslashes($html_toggle) . '</div>';
         }
         if ($htmlCorners != "") {
             echo $htmlCorners . " ";
         }
         if ($do_loop !== 'none') {
             echo "</div>";
         }
         echo '</' . $use_tag . '>' . "\n";
         $zIndex++;
     }
 }