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


PHP PBHelper::unsetComponentElementById方法代码示例

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


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

示例1: __construct

 function __construct()
 {
     $this->icon = array();
     $this->social = array();
     $this->style = array('social-icon' => array('use' => 2, 'path' => $this->getStyleURL(), 'file' => 'style.css'));
     $this->script = array('social-icon' => array('use' => 2, 'path' => $this->getScriptURL(), 'file' => 'PB.SocialIcon.js'));
     if (PBComponentData::get($this->getComponentId(), 'icon_type') == 'gr') {
         $this->icon['url'] = PBComponentData::get($this->getComponentId(), 'icon_url');
         $this->icon['path'] = PBComponentData::get($this->getComponentId(), 'icon_path');
         $this->icon['file'] = PBComponentData::setFile($this->getComponentId(), 'icon_file', $this->icon['path']);
         foreach ($this->icon['file'] as $value) {
             $pathinfo = pathinfo($this->icon['path'] . $value);
             $name = ucfirst(preg_replace(array('/-/', '/_/'), ' ', $pathinfo['filename']));
             $this->social[$pathinfo['filename']] = array($name, $value);
         }
     } else {
         $this->social = array('behance' => array('Behance', 'behance'), 'deviantart' => array('Deviantart', 'deviantart'), 'digg' => array('Digg', 'digg'), 'dribbble' => array('DribbBle', 'dribbble'), 'facebook' => array('Facebook', 'facebook'), 'flickr' => array('Flickr', 'flickr'), 'foursquare' => array('Foursquare', 'foursquare'), 'googleplus' => array('Google+', 'google-plus'), 'instagram' => array('Instagram', 'instagram'), 'linkedin' => array('Linkedin', 'linkedin'), 'pinterest' => array('Pinterest', 'pinterest'), 'reddit' => array('Reddit', 'reddit'), 'rss' => array('RSS', 'rss'), 'skype' => array('Skype', 'skype'), 'soundcloud' => array('Soundcloud', 'soundcloud'), 'spotify' => array('Spotify', 'spotify'), 'stumbleupon' => array('Stumbleupon', 'stumbleupon'), 'tumblr' => array('Tumblr', 'tumblr'), 'twitter' => array('Twitter', 'twitter'), 'vimeo' => array('Vimeo', 'vimeo-square'), 'xing' => array('Xing', 'xing'), 'youtube' => array('Youtube', 'youtube'));
     }
     $Window = new PBWindow();
     $group = array(1 => array('header' => __('Dimension', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Dimension of the icon in pixels', PLUGIN_PAGE_BUILDER_DOMAIN)), 2 => array('header' => __('Normal state', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Styles for normal state', PLUGIN_PAGE_BUILDER_DOMAIN)), 3 => array('header' => __('Hover state', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Styles for hover state', PLUGIN_PAGE_BUILDER_DOMAIN)), 4 => array('header' => __('Border radius', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('Border radius in order: top left, top right, bottom right, bottom left', PLUGIN_PAGE_BUILDER_DOMAIN)));
     $start = count($group) + 1;
     $i = $start;
     foreach ($this->social as $index => $value) {
         $group[$i] = array('header' => $value[0], 'subheader' => sprintf(__('Settings for %s', PLUGIN_PAGE_BUILDER_DOMAIN), $value[0]));
         $i++;
     }
     $this->component = array('name' => __('Social Icons', PLUGIN_PAGE_BUILDER_DOMAIN), 'description' => __('Displays Social Icons', PLUGIN_PAGE_BUILDER_DOMAIN), 'structure' => array('window' => array('title' => __('Social Icons', PLUGIN_PAGE_BUILDER_DOMAIN)), 'ui' => array('panel' => array(1 => array('header' => __('General', PLUGIN_PAGE_BUILDER_DOMAIN)), 2 => array('header' => __('Styles', PLUGIN_PAGE_BUILDER_DOMAIN)), 3 => array('header' => __('Profiles', PLUGIN_PAGE_BUILDER_DOMAIN))), 'group' => $group), 'element' => array(array('id' => 'target', 'ui' => array('panel' => 1, 'text' => array('header' => __('Target of the links', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'radio', 'dictionary' => array('source' => PBHelper::extractDictionary($Window->linkTarget)))), 'shortcode' => array('default' => '_blank')), array('id' => 'css_class', 'ui' => array('panel' => 1, 'text' => array('header' => __('CSS class', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => __('List of CSS classes defined in CSS files separated by space', PLUGIN_PAGE_BUILDER_DOMAIN)))), array('id' => 'native_color_enable', 'ui' => array('panel' => 2, 'text' => array('header' => __('Native colors', PLUGIN_PAGE_BUILDER_DOMAIN), 'subheader' => array(__('Use native colors for social icons (for both states: normal and hover)', PLUGIN_PAGE_BUILDER_DOMAIN))), 'element' => array('type' => 'choice-2')), 'shortcode' => array('default' => '0')), array('id' => 'width', 'ui' => array('panel' => 2, 'group' => 1, 'text' => array('label' => __('Width in pixels', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'height', 'ui' => array('panel' => 2, 'group' => 1, 'text' => array('label' => __('Height in pixels', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'font_icon_size', 'ui' => array('panel' => 2, 'group' => 1, 'text' => array('label' => __('Icon size in pixels. Value 0 means that default size for will be used', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'slider', 'value' => 0, 'option' => array('min' => 0, 'max' => 200)))), array('id' => 'border_radius_top_left', 'ui' => array('panel' => 2, 'group' => 4, 'text' => array('label' => __('Top left in pixels:', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'border_radius_top_right', 'ui' => array('panel' => 2, 'group' => 4, 'text' => array('label' => __('Top right in pixels:', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'border_radius_bottom_right', 'ui' => array('panel' => 2, 'group' => 4, 'text' => array('label' => __('Bottom right in pixels:', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'border_radius_bottom_left', 'ui' => array('panel' => 2, 'group' => 4, 'text' => array('label' => __('Bottom left in pixels', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'border_width', 'ui' => array('panel' => 2, 'group' => 2, 'text' => array('label' => __('Border width in pixels', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'border_color', 'ui' => array('panel' => 2, 'group' => 2, 'text' => array('label' => __('Border color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))), array('id' => 'icon_color', 'ui' => array('panel' => 2, 'group' => 2, 'text' => array('label' => __('Icon color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))), array('id' => 'bg_color', 'ui' => array('panel' => 2, 'group' => 2, 'text' => array('label' => __('Background color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))), array('id' => 'border_width_hover', 'ui' => array('panel' => 2, 'group' => 3, 'text' => array('label' => __('Border width in pixels', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '3')))), array('id' => 'border_color_hover', 'ui' => array('panel' => 2, 'group' => 3, 'text' => array('label' => __('Border color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))), array('id' => 'font_icon_color_hover', 'ui' => array('panel' => 2, 'group' => 3, 'text' => array('label' => __('Icon color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))), array('id' => 'bg_color_hover', 'ui' => array('panel' => 2, 'group' => 3, 'text' => array('label' => __('Background color in HEX', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('type' => 'color-picker'))))));
     if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
         PBHelper::unsetComponentElementById($this->component['structure']['element'], array('font_icon_size', 'font_icon_color_hover', 'font_icon_color_hover'));
     }
     $i = $start;
     foreach ($this->social as $index => $value) {
         array_push($this->component['structure']['element'], array('id' => 'profile_' . $index . '_url', 'ui' => array('panel' => 3, 'group' => $i, 'text' => array('label' => __('URL', PLUGIN_PAGE_BUILDER_DOMAIN)))), array('id' => 'profile_' . $index . '_order', 'ui' => array('panel' => 3, 'group' => $i, 'text' => array('label' => __('Order', PLUGIN_PAGE_BUILDER_DOMAIN)), 'element' => array('attribute' => array('maxlength' => '2')))));
         $i++;
     }
     parent::__construct();
 }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:37,代码来源:PB.Component.SocialIcon.class.php


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