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


PHP td_util::vc_is_inline方法代码示例

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


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

示例1: get_block_js

 function get_block_js()
 {
     //get the js for this block - do not load it in inline mode in visual composer
     if (td_util::vc_is_inline()) {
         return '';
     }
     extract(shortcode_atts(array('limit' => 5, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'show_child_cat' => '', 'sub_cat_ajax' => '', 'ajax_pagination' => '', 'header_color' => '', 'ajax_pagination_infinite_stop' => ''), $this->atts));
     if (!empty($this->atts['custom_title'])) {
         $this->atts['custom_title'] = htmlspecialchars($this->atts['custom_title'], ENT_QUOTES);
     }
     if (!empty($this->atts['custom_url'])) {
         $this->atts['custom_url'] = htmlspecialchars($this->atts['custom_url'], ENT_QUOTES);
     }
     $td_column_number = td_util::vc_get_column_number();
     // get the column width of the block so we can sent it to the server
     $block_item = 'block_' . $this->block_uid;
     $buffy = '';
     $buffy .= '<script>';
     $buffy .= 'var ' . $block_item . ' = new td_block();' . "\n";
     $buffy .= $block_item . '.id = "' . $this->block_uid . '";' . "\n";
     $buffy .= $block_item . ".atts = '" . json_encode($this->atts) . "';" . "\n";
     $buffy .= $block_item . '.td_column_number = "' . $td_column_number . '";' . "\n";
     $buffy .= $block_item . '.block_type = "' . $this->block_id . '";' . "\n";
     //wordpress wp query parms
     $buffy .= $block_item . '.post_count = "' . $this->td_query->post_count . '";' . "\n";
     $buffy .= $block_item . '.found_posts = "' . $this->td_query->found_posts . '";' . "\n";
     $buffy .= $block_item . '.max_num_pages = "' . $this->td_query->max_num_pages . '";' . "\n";
     $buffy .= $block_item . '.header_color = "' . $header_color . '";' . "\n";
     $buffy .= $block_item . '.ajax_pagination_infinite_stop = "' . $ajax_pagination_infinite_stop . '";' . "\n";
     $buffy .= 'td_blocks.push(' . $block_item . ');' . "\n";
     $buffy .= '</script>';
     return $buffy;
 }
开发者ID:vikasjain1595,项目名称:wordpresstheme,代码行数:33,代码来源:td_block.php

示例2: get_block_js

    function get_block_js()
    {
        //get the js for this block - do not load it in inline mode in visual composer
        if (td_util::vc_is_inline()) {
            return '';
        }
        extract(shortcode_atts(array('limit' => 5, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'show_child_cat' => '', 'sub_cat_ajax' => '', 'ajax_pagination' => '', 'header_color' => '', 'ajax_pagination_infinite_stop' => '', 'td_column_number' => ''), $this->atts));
        if (!empty($this->atts['custom_title'])) {
            $this->atts['custom_title'] = htmlspecialchars($this->atts['custom_title'], ENT_QUOTES);
        }
        if (!empty($this->atts['custom_url'])) {
            $this->atts['custom_url'] = htmlspecialchars($this->atts['custom_url'], ENT_QUOTES);
        }
        if (empty($td_column_number)) {
            $td_column_number = td_util::vc_get_column_number();
            // get the column width of the block so we can sent it to the server. If the shortcode already has a user defined column number, we use that
        }
        $block_item = 'block_' . $this->block_uid;
        $buffy = '';
        $buffy .= '<script>';
        $buffy .= 'var ' . $block_item . ' = new tdBlock();' . "\n";
        $buffy .= $block_item . '.id = "' . $this->block_uid . '";' . "\n";
        $buffy .= $block_item . ".atts = '" . json_encode($this->atts) . "';" . "\n";
        $buffy .= $block_item . '.td_column_number = "' . $td_column_number . '";' . "\n";
        $buffy .= $block_item . '.block_type = "' . $this->block_id . '";' . "\n";
        //wordpress wp query parms
        $buffy .= $block_item . '.post_count = "' . $this->td_query->post_count . '";' . "\n";
        $buffy .= $block_item . '.found_posts = "' . $this->td_query->found_posts . '";' . "\n";
        $buffy .= $block_item . '.header_color = "' . $header_color . '";' . "\n";
        $buffy .= $block_item . '.ajax_pagination_infinite_stop = "' . $ajax_pagination_infinite_stop . '";' . "\n";
        // The max_num_pages is computed so it considers the offset and the limit atts settings
        // There were necessary these changes because on the user interface there are js scripts that use the max_num_pages js variable to show/hide some ui components
        if (!empty($this->atts['offset'])) {
            if ($this->atts['limit'] != 0) {
                $buffy .= $block_item . '.max_num_pages = "' . ceil(($this->td_query->found_posts - $this->atts['offset']) / $this->atts['limit']) . '";' . "\n";
            } else {
                if (get_option('posts_per_page') != 0) {
                    $buffy .= $block_item . '.max_num_pages = "' . ceil(($this->td_query->found_posts - $this->atts['offset']) / get_option('posts_per_page')) . '";' . "\n";
                }
            }
        } else {
            $buffy .= $block_item . '.max_num_pages = "' . $this->td_query->max_num_pages . '";' . "\n";
        }
        $buffy .= 'tdBlocksArray.push(' . $block_item . ');' . "\n";
        $buffy .= '</script>';
        //print_r($this->td_block_template_data);
        // ajax subcategories preloader
        // @todo preloading "all" filter content should happen regardless of the setting
        if (!empty($this->td_block_template_data['td_pull_down_items']) and !empty($this->atts['td_ajax_preloading'])) {
            /*  -------------------------------------------------------------------------------------
                    add 'ALL' item to the cache
                */
            // pagination - we need to compute the pagination for each cache entry
            $td_hide_next = false;
            if (!empty($this->atts['offset']) && !empty($this->atts['limit']) && $this->atts['limit'] != 0) {
                if (1 >= ceil(($this->td_query->found_posts - $this->atts['offset']) / $this->atts['limit'])) {
                    $td_hide_next = true;
                    //hide link on last page
                }
            } else {
                if (1 >= $this->td_query->max_num_pages) {
                    $td_hide_next = true;
                    //hide link on last page
                }
            }
            // this will be send to JS bellow
            $buffyArray = array('td_data' => $this->inner($this->td_query->posts, $td_column_number), 'td_block_id' => $this->block_uid, 'td_hide_prev' => true, 'td_hide_next' => $td_hide_next);
            /*  -------------------------------------------------------------------------------------
                    add the rest of the items to the local cache
                */
            ob_start();
            // we need to clone the object to set is_ajax_running to true
            // first we set an object for the all filter
            ?>
            <script>
                var tmpObj = JSON.parse(JSON.stringify(<?php 
            echo $block_item;
            ?>
));
                tmpObj.is_ajax_running = true;
                var currentBlockObjSignature = JSON.stringify(tmpObj);
                tdLocalCache.set(currentBlockObjSignature, JSON.stringify(<?php 
            echo json_encode($buffyArray);
            ?>
));
                <?php 
            foreach ($this->td_block_template_data['td_pull_down_items'] as $count => $item) {
                if (empty($item['id'])) {
                    continue;
                }
                // preload only 6 or 20 items depending on the setting
                if ($this->atts['td_ajax_preloading'] == 'preload_all' and $count > 20) {
                    break;
                } else {
                    if ($this->atts['td_ajax_preloading'] == 'preload' and $count > 6) {
                        break;
                    }
                }
                $ajax_parameters = array('td_atts' => $this->atts, 'td_column_number' => $td_column_number, 'td_current_page' => 1, 'td_block_id' => $this->block_uid, 'block_type' => get_class($this), 'td_filter_value' => $item['id']);
                ?>
//.........这里部分代码省略.........
开发者ID:weerapat,项目名称:wp-daily,代码行数:101,代码来源:td_block.php

示例3: get_block_js

 function get_block_js()
 {
     //get the js for this block - do not load it in inline mode in visual composer
     if (td_util::vc_is_inline()) {
         return '';
     }
     extract(shortcode_atts(array('limit' => 5, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'show_child_cat' => '', 'sub_cat_ajax' => '', 'ajax_pagination' => '', 'header_color' => '', 'ajax_pagination_infinite_stop' => '', 'td_column_number' => ''), $this->atts));
     if (!empty($this->atts['custom_title'])) {
         $this->atts['custom_title'] = htmlspecialchars($this->atts['custom_title'], ENT_QUOTES);
     }
     if (!empty($this->atts['custom_url'])) {
         $this->atts['custom_url'] = htmlspecialchars($this->atts['custom_url'], ENT_QUOTES);
     }
     if (empty($td_column_number)) {
         $td_column_number = td_util::vc_get_column_number();
         // get the column width of the block so we can sent it to the server. If the shortcode already has a user defined column number, we use that
     }
     $block_item = 'block_' . $this->block_uid;
     $buffy = '';
     $buffy .= '<script>';
     $buffy .= 'var ' . $block_item . ' = new td_block();' . "\n";
     $buffy .= $block_item . '.id = "' . $this->block_uid . '";' . "\n";
     $buffy .= $block_item . ".atts = '" . json_encode($this->atts) . "';" . "\n";
     $buffy .= $block_item . '.td_column_number = "' . $td_column_number . '";' . "\n";
     $buffy .= $block_item . '.block_type = "' . $this->block_id . '";' . "\n";
     //wordpress wp query parms
     $buffy .= $block_item . '.post_count = "' . $this->td_query->post_count . '";' . "\n";
     $buffy .= $block_item . '.found_posts = "' . $this->td_query->found_posts . '";' . "\n";
     $buffy .= $block_item . '.header_color = "' . $header_color . '";' . "\n";
     $buffy .= $block_item . '.ajax_pagination_infinite_stop = "' . $ajax_pagination_infinite_stop . '";' . "\n";
     // The max_num_pages is computed so it considers the offset and the limit atts settings
     // There were necessary these changes because on the user interface there are js scripts that use the max_num_pages js variable to show/hide some ui components
     if (!empty($this->atts['offset'])) {
         if ($this->atts['limit'] != 0) {
             $buffy .= $block_item . '.max_num_pages = "' . ceil(($this->td_query->found_posts - $this->atts['offset']) / $this->atts['limit']) . '";' . "\n";
         } else {
             if (get_option('posts_per_page') != 0) {
                 $buffy .= $block_item . '.max_num_pages = "' . ceil(($this->td_query->found_posts - $this->atts['offset']) / get_option('posts_per_page')) . '";' . "\n";
             }
         }
     } else {
         $buffy .= $block_item . '.max_num_pages = "' . $this->td_query->max_num_pages . '";' . "\n";
     }
     $buffy .= 'td_blocks.push(' . $block_item . ');' . "\n";
     $buffy .= '</script>';
     return $buffy;
 }
开发者ID:Che234,项目名称:andreatelo,代码行数:47,代码来源:td_block.php


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