• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP vc_user_access_check_shortcode_all函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中vc_user_access_check_shortcode_all函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_user_access_check_shortcode_all函数的具体用法?PHP vc_user_access_check_shortcode_all怎么用?PHP vc_user_access_check_shortcode_all使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getControls

 /**
  * Get rendered controls
  *
  * @param array $controls
  *
  * @return string
  */
 public function getControls($controls)
 {
     if (!is_array($controls) || empty($controls)) {
         return '';
     }
     $buttons = array();
     $editAccess = vc_user_access_check_shortcode_edit($this->shortcode);
     $allAccess = vc_user_access_check_shortcode_all($this->shortcode);
     foreach ($controls as $control) {
         switch ($control) {
             case 'add':
                 if ($allAccess) {
                     $buttons[] = '<a class="vc_control-btn vc_control-btn-add" href="#" title="' . __('Add to this grid item', 'js_composer') . '" data-vc-control="add"><i class="vc_icon"></i></a>';
                 }
                 break;
             case 'edit':
                 if ($editAccess) {
                     $buttons[] = '<a class="vc_control-btn vc_control-btn-edit" href="#" title="' . __('Edit this grid item', 'js_composer') . '" data-vc-control="edit"><i class="vc_icon"></i></a>';
                 }
                 break;
             case 'delete':
                 if ($allAccess) {
                     $buttons[] = '<a class="vc_control-btn vc_control-btn-delete" href="#" title="' . __('Delete this grid item ', 'js_composer') . '" data-vc-control="delete"><i class="vc_icon"></i></a>';
                 }
                 break;
         }
     }
     $html = '<div class="vc_controls vc_controls-dark vc_controls-visible">' . implode(' ', $buttons) . '</div>';
     return $html;
 }
开发者ID:severnrescue,项目名称:web,代码行数:37,代码来源:vc-gitem.php


示例2: generateGitemUserData

 /**
  * Generates list of shortcodes only for Grid element.
  *
  * This method parses the list of mapped shortcodes and creates categories list for users.
  * Also it checks is 'is_grid_item_element' attribute true.
  *
  * @static
  *
  * @param bool $force - force data generation even data already generated.
  */
 protected static function generateGitemUserData($force = false)
 {
     if (!$force && false !== self::$gitem_user_sc && false !== self::$gitem_user_categories) {
         return;
     }
     self::$gitem_user_sc = self::$gitem_user_categories = self::$gitem_user_sorted_sc = array();
     $deprecated = 'deprecated';
     $add_deprecated = false;
     if (is_array(self::$sc) && !empty(self::$sc)) {
         foreach (self::$sc as $name => $values) {
             if (isset($values['post_type']) && Vc_Grid_Item_Editor::postType() === $values['post_type'] && vc_user_access_check_shortcode_all($name)) {
                 if (!isset($values['content_element']) || true === $values['content_element']) {
                     $categories = isset($values['category']) ? $values['category'] : '_other_category_';
                     $values['_category_ids'] = array();
                     if (isset($values['deprecated']) && false !== $values['deprecated']) {
                         $add_deprecated = true;
                         $values['_category_ids'][] = $deprecated;
                     } else {
                         if (is_array($categories) && !empty($categories)) {
                             foreach ($categories as $c) {
                                 if (false === array_search($c, self::$gitem_user_categories)) {
                                     self::$gitem_user_categories[] = $c;
                                 }
                                 $values['_category_ids'][] = md5($c);
                             }
                         } else {
                             if (false === array_search($categories, self::$gitem_user_categories)) {
                                 self::$gitem_user_categories[] = $categories;
                             }
                             $values['_category_ids'][] = md5($categories);
                         }
                     }
                 }
                 self::$gitem_user_sc[$name] = $values;
                 self::$gitem_user_sorted_sc[] = $values;
             }
         }
     }
     if ($add_deprecated) {
         self::$gitem_user_categories[] = $deprecated;
     }
     $sort = new Vc_Sort(self::$gitem_user_sorted_sc);
     self::$gitem_user_sorted_sc = $sort->sortByKey();
 }
开发者ID:severnrescue,项目名称:web,代码行数:54,代码来源:class-wpb-map-grid-item.php


示例3: __

			<?php 
    if ($templates_total_count > 0 && vc_user_access()->part('templates')->can()->get()) {
        ?>
				<a id="vc_templates-more-layouts"
				   class="vc_general vc_ui-button vc_ui-button-shape-rounded vc_ui-button-warning" href="#">
					<i class="vc_ui-icon-pixel vc_ui-icon-pixel-control-template"></i>
					<?php 
        echo __('Add template', 'js_composer');
        ?>
				</a>
			<?php 
    }
    ?>
		</div>
		<?php 
    if (vc_user_access()->part('shortcodes')->checkStateAny(true, 'custom', null)->get() && vc_user_access_check_shortcode_all('vc_row') && vc_user_access_check_shortcode_all('vc_column')) {
        ?>
			<div class="vc_welcome-visible-ne">
				<a id="vc_not-empty-add-element" class="vc_add-element-not-empty-button"
				   title="<?php 
        _e('Add Element', 'js_composer');
        ?>
" data-vc-element="add-element-action">
				</a>
			</div>
		<?php 
    }
    ?>
		<p class="vc_ui-help-block vc_welcome-visible-e">
			<?php 
    $targetLink = '<a href="http://kb.wpbakery.com" target="_blank">' . __('knowledge base', 'js_composer') . '</a>';
开发者ID:arkev,项目名称:IntelligentMode,代码行数:31,代码来源:vc_welcome_block.tpl.php


示例4: contentAdmin

 public function contentAdmin($atts, $content = null)
 {
     $width = $el_class = $title = '';
     extract(shortcode_atts($this->predefined_atts, $atts));
     $output = '';
     $column_controls = $this->getColumnControls($this->settings('controls'));
     $column_controls_bottom = $this->getColumnControls('add', 'bottom-controls');
     if ('column_14' === $width || '1/4' === $width) {
         $width = array('vc_col-sm-3');
     } elseif ('column_14-14-14-14' === $width) {
         $width = array('vc_col-sm-3', 'vc_col-sm-3', 'vc_col-sm-3', 'vc_col-sm-3');
     } elseif ('column_13' === $width || '1/3' === $width) {
         $width = array('vc_col-sm-4');
     } elseif ('column_13-23' === $width) {
         $width = array('vc_col-sm-4', 'vc_col-sm-8');
     } elseif ('column_13-13-13' === $width) {
         $width = array('vc_col-sm-4', 'vc_col-sm-4', 'vc_col-sm-4');
     } elseif ('column_12' === $width || '1/2' === $width) {
         $width = array('vc_col-sm-6');
     } elseif ('column_12-12' === $width) {
         $width = array('vc_col-sm-6', 'vc_col-sm-6');
     } elseif ('column_23' === $width || '2/3' === $width) {
         $width = array('vc_col-sm-8');
     } elseif ('column_34' === $width || '3/4' === $width) {
         $width = array('vc_col-sm-9');
     } elseif ('column_16' === $width || '1/6' === $width) {
         $width = array('vc_col-sm-2');
     } else {
         $width = array('');
     }
     $sortable = vc_user_access_check_shortcode_all($this->shortcode) ? 'wpb_sortable' : $this->nonDraggableClass;
     for ($i = 0; $i < count($width); $i++) {
         $output .= '<div class="group ' . $sortable . '">';
         $output .= '<h3><span class="tab-label"><%= params.title %></span></h3>';
         $output .= '<div ' . $this->mainHtmlBlockParams($width, $i) . '>';
         $output .= str_replace('%column_size%', wpb_translateColumnWidthToFractional($width[$i]), $column_controls);
         $output .= '<div class="wpb_element_wrapper">';
         $output .= '<div ' . $this->containerHtmlBlockParams($width, $i) . '>';
         $output .= do_shortcode(shortcode_unautop($content));
         $output .= '</div>';
         if (isset($this->settings['params'])) {
             $inner = '';
             foreach ($this->settings['params'] as $param) {
                 $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : '';
                 if (is_array($param_value)) {
                     // Get first element from the array
                     reset($param_value);
                     $first_key = key($param_value);
                     $param_value = $param_value[$first_key];
                 }
                 $inner .= $this->singleParamHtmlHolder($param, $param_value);
             }
             $output .= $inner;
         }
         $output .= '</div>';
         $output .= str_replace('%column_size%', wpb_translateColumnWidthToFractional($width[$i]), $column_controls_bottom);
         $output .= '</div>';
         $output .= '</div>';
     }
     return $output;
 }
开发者ID:arkev,项目名称:IntelligentMode,代码行数:61,代码来源:vc-accordion-tab.php


示例5: mainHtmlBlockParams

 public function mainHtmlBlockParams($width, $i)
 {
     $sortable = vc_user_access_check_shortcode_all($this->shortcode) ? 'wpb_sortable' : $this->nonDraggableClass;
     return 'data-element_type="' . $this->settings['base'] . '" class="wpb_' . $this->settings['base'] . ' ' . $sortable . ' wpb_content_holder"' . $this->customAdminBlockParams();
 }
开发者ID:hikaram,项目名称:wee,代码行数:5,代码来源:vc-tab.php


示例6: mainHtmlBlockParams

 /**
  * @param $width
  * @param $i
  *
  * @return string
  */
 public function mainHtmlBlockParams($width, $i)
 {
     $sortable = vc_user_access_check_shortcode_all($this->shortcode) ? 'wpb_sortable' : $this->nonDraggableClass;
     return 'data-element_type="' . $this->settings['base'] . '" data-vc-column-width="' . wpb_vc_get_column_width_indent($width[$i]) . '" class="wpb_' . $this->settings['base'] . ' ' . $sortable . ' ' . $this->templateWidth() . ' wpb_content_holder"' . $this->customAdminBlockParams();
 }
开发者ID:hikaram,项目名称:wee,代码行数:11,代码来源:vc-column.php


示例7: getColumnControls

 /**
  * @param $controls
  * @param string $extended_css
  *
  * @return string
  */
 public function getColumnControls($controls = 'full', $extended_css = '')
 {
     $controls_start = '<div class="vc_controls vc_controls-visible controls controls_column' . (!empty($extended_css) ? " {$extended_css}" : '') . '">';
     $controls_end = '</div>';
     if ('bottom-controls' === $extended_css) {
         $control_title = sprintf(__('Append to this %s', 'js_composer'), strtolower($this->settings('name')));
     } else {
         $control_title = sprintf(__('Prepend to this %s', 'js_composer'), strtolower($this->settings('name')));
     }
     $controls_move = '<a class="vc_control column_move" data-vc-control="move" href="#" title="' . sprintf(__('Move this %s', 'js_composer'), strtolower($this->settings('name'))) . '"><span class="vc_icon"></span></a>';
     $controls_add = '<a class="vc_control column_add" data-vc-control="add" href="#" title="' . $control_title . '"><span class="vc_icon"></span></a>';
     $controls_edit = '<a class="vc_control column_edit" data-vc-control="edit" href="#" title="' . sprintf(__('Edit this %s', 'js_composer'), strtolower($this->settings('name'))) . '"><span class="vc_icon"></span></a>';
     $controls_clone = '<a class="vc_control column_clone" data-vc-control="clone" href="#" title="' . sprintf(__('Clone this %s', 'js_composer'), strtolower($this->settings('name'))) . '"><span class="vc_icon"></span></a>';
     $controls_delete = '<a class="vc_control column_delete" data-vc-control="delete" href="#" title="' . sprintf(__('Delete this %s', 'js_composer'), strtolower($this->settings('name'))) . '"><span class="vc_icon"></span></a>';
     $controls_full = $controls_move . $controls_add . $controls_edit . $controls_clone . $controls_delete;
     $editAccess = vc_user_access_check_shortcode_edit($this->shortcode);
     $allAccess = vc_user_access_check_shortcode_all($this->shortcode);
     if (!empty($controls)) {
         if (is_string($controls)) {
             $controls = array($controls);
         }
         $controls_string = $controls_start;
         foreach ($controls as $control) {
             $control_var = 'controls_' . $control;
             if ($editAccess && 'edit' == $control || $allAccess) {
                 if (isset(${$control_var})) {
                     $controls_string .= ${$control_var};
                 }
             }
         }
         return $controls_string . $controls_end;
     }
     if ($allAccess) {
         return $controls_start . $controls_full . $controls_end;
     } elseif ($editAccess) {
         return $controls_start . $controls_edit . $controls_end;
     }
     return $controls_start . $controls_end;
 }
开发者ID:AlchemyMomentum,项目名称:public_html,代码行数:45,代码来源:shortcodes.php


示例8: getControlAddElement

 /**
  * @return string
  */
 public function getControlAddElement()
 {
     if (vc_user_access()->part('shortcodes')->checkStateAny(true, 'custom', null)->get() && vc_user_access_check_shortcode_all('vc_row') && vc_user_access_check_shortcode_all('vc_column')) {
         return '<li class="vc_show-mobile">' . '	<a href="javascript:;" class="vc_icon-btn vc_element-button" data-model-id="vc_element" id="vc_add-new-element" title="' . '' . __('Add new element', 'js_composer') . '">' . '	</a>' . '</li>';
     }
     return '';
 }
开发者ID:hikaram,项目名称:wee,代码行数:10,代码来源:class-vc-navbar.php


示例9: cssAdminClass

 public function cssAdminClass()
 {
     $sortable = vc_user_access_check_shortcode_all($this->shortcode) ? ' wpb_sortable' : ' ' . $this->nonDraggableClass;
     return 'wpb_' . $this->settings['base'] . $sortable;
 }
开发者ID:hikaram,项目名称:wee,代码行数:5,代码来源:vc-row.php


示例10: getAddAllowed

 /**
  * Check is allowed to add another element inside current element.
  *
  * @since 4.8
  *
  * @return bool
  */
 public function getAddAllowed()
 {
     return vc_user_access_check_shortcode_all('vc_tta_section');
 }
开发者ID:k2jysy,项目名称:wedev,代码行数:11,代码来源:vc-tta-accordion.php


示例11: vc_user_access_check_shortcode_edit

<?php

$editAccess = vc_user_access_check_shortcode_edit($shortcode);
$allAccess = vc_user_access_check_shortcode_all($shortcode);
?>
<div class="vc_controls<?php 
echo !empty($extended_css) ? ' ' . $extended_css : '';
?>
">
	<div class="vc_controls-<?php 
echo $position;
?>
">
		<a class="vc_element-name">
			<span class="vc_btn-content"><?php 
echo $name;
?>
</span>
		</a>
			<?php 
foreach ($controls as $control) {
    ?>
				<?php 
    if ('add' === $control && vc_user_access()->part('shortcodes')->checkStateAny(true, 'custom', null)->get()) {
        ?>
					<a class="vc_control-btn vc_control-btn-prepend vc_edit" href="#"
					   title="<?php 
        printf(__('Prepend to %s', 'js_composer'), $name);
        ?>
"><span
							class="vc_btn-content"><span class="icon"></span></span></a>
开发者ID:hikaram,项目名称:wee,代码行数:31,代码来源:backend_controls_tab.tpl.php


示例12: generateUserData

 /**
  * Generates list of shortcodes taking into account the access rules for shortcodes from VC Settings page.
  *
  * This method parses the list of mapped shortcodes and creates categories list for users.
  *
  * @static
  *
  * @param bool $force - force data generation even data already generated.
  */
 protected static function generateUserData($force = false)
 {
     if (!$force && false !== self::$user_sc && false !== self::$user_categories) {
         return;
     }
     //$settings = self::getSettings();
     self::$user_sc = self::$user_categories = self::$user_sorted_sc = array();
     $deprecated = 'deprecated';
     $add_deprecated = false;
     if (is_array(self::$sc) && !empty(self::$sc)) {
         foreach (array_keys(self::$sc) as $name) {
             self::setElementSettings($name);
             if (!isset(self::$sc[$name])) {
                 continue;
             }
             $values = self::$sc[$name];
             if (vc_user_access_check_shortcode_all($name)) {
                 if (!isset($values['content_element']) || true === $values['content_element']) {
                     $categories = isset($values['category']) ? $values['category'] : '_other_category_';
                     $values['_category_ids'] = array();
                     if (isset($values['deprecated']) && false !== $values['deprecated']) {
                         $add_deprecated = true;
                         $values['_category_ids'][] = 'deprecated';
                     } else {
                         if (is_array($categories) && !empty($categories)) {
                             foreach ($categories as $c) {
                                 if (false === array_search($c, self::$user_categories)) {
                                     self::$user_categories[] = $c;
                                 }
                                 $values['_category_ids'][] = md5($c);
                             }
                         } else {
                             if (false === array_search($categories, self::$user_categories)) {
                                 self::$user_categories[] = $categories;
                             }
                             $values['_category_ids'][] = md5($categories);
                         }
                     }
                 }
                 self::$user_sc[$name] = $values;
                 self::$user_sorted_sc[] = $values;
             }
         }
     }
     if ($add_deprecated) {
         self::$user_categories[] = $deprecated;
     }
     $sort = new Vc_Sort(self::$user_sorted_sc);
     self::$user_sorted_sc = $sort->sortByKey();
 }
开发者ID:k2jysy,项目名称:wedev,代码行数:59,代码来源:class-wpb-map.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP vc_value_from_safe函数代码示例发布时间:2022-05-23
下一篇:
PHP vc_user_access函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap