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


PHP FusionCore_Plugin::strip_unit方法代码示例

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


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

示例1: render

 /**
  * Render the shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render($args, $content = '')
 {
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'circle' => 'yes', 'circlecolor' => '', 'circlebordercolor' => '', 'flip' => '', 'icon' => '', 'iconcolor' => '', 'rotate' => '', 'size' => 'medium', 'spin' => 'no', 'animation_type' => '', 'animation_direction' => 'down', 'animation_speed' => '0.1', 'alignment' => ''), $args);
     extract($defaults);
     // Dertmine line-height and margin from font size
     $defaults['font_size'] = FusionCore_Plugin::strip_unit(self::convert_deprecated_sizes($defaults['size']));
     $defaults['circle_yes_font_size'] = $defaults['font_size'] * 0.88;
     $defaults['line_height'] = $defaults['font_size'] * 1.76;
     $defaults['icon_margin'] = $defaults['font_size'] * 0.5;
     $defaults['icon_margin_position'] = is_rtl() ? 'left' : 'right';
     self::$args = $defaults;
     $html = sprintf('<i %s>%s</i>', FusionCore_Plugin::attributes('fontawesome-shortcode'), do_shortcode($content));
     if ($alignment) {
         $html = sprintf('<div class="align%s">%s</div>', $alignment, $html);
     }
     return $html;
 }
开发者ID:universal-youth,项目名称:www.universal-youth.com,代码行数:24,代码来源:class-fontawesome.php

示例2: divider_candy_arrow_attr

 function divider_candy_arrow_attr($args)
 {
     $attr = array();
     $attr['class'] = 'divider-candy-arrow';
     if ($args) {
         $divider_candy = $args['divider_candy'];
     } else {
         $divider_candy = self::$args['divider_candy'];
     }
     // For borders of size 1, we need to hide the border line on the arrow, thus we set it to 0
     $arrow_position = FusionCore_Plugin::strip_unit(self::$args['bordersize']);
     if ($arrow_position == '1') {
         $arrow_position = 0;
     }
     if ($divider_candy == 'bottom') {
         $attr['class'] .= ' bottom';
         $attr['style'] = sprintf('top:%spx;border-top-color: %s;', $arrow_position, self::$args['backgroundcolor']);
     } elseif ($divider_candy == 'top') {
         $attr['class'] .= ' top';
         $attr['style'] = sprintf('bottom:%spx;border-bottom-color: %s;', $arrow_position, self::$args['backgroundcolor']);
     }
     return $attr;
 }
开发者ID:universal-youth,项目名称:www.universal-youth.com,代码行数:23,代码来源:class-section-separator.php

示例3: content_box_heading_attr

 function content_box_heading_attr()
 {
     $attr['class'] = 'content-box-heading';
     $attr['style'] = '';
     if (self::$parent_args['title_size']) {
         $font_size = FusionCore_Plugin::strip_unit(self::$parent_args['title_size']);
         $attr['style'] = sprintf('font-size: %spx;line-height:%spx;', $font_size, $font_size + 2);
     }
     if (self::$parent_args['title_color']) {
         $attr['style'] .= sprintf('color:%s;', self::$parent_args['title_color']);
     }
     if (self::$parent_args['layout'] == 'icon-on-side' || self::$parent_args['layout'] == 'clean-horizontal') {
         if (self::$child_args['image'] && self::$child_args['image_width'] && self::$child_args['image_height']) {
             if (self::$parent_args['icon_align'] == 'right') {
                 $attr['style'] .= sprintf('padding-right:%spx;', self::$child_args['image_width'] + 20);
             } else {
                 $attr['style'] .= sprintf('padding-left:%spx;', self::$child_args['image_width'] + 20);
             }
         } else {
             if (self::$child_args['icon']) {
                 if (self::$parent_args['icon_circle'] == 'yes') {
                     $full_icon_size = self::$parent_args['icon_size'] * 2 + intval(self::$child_args['circlebordersize']) * 2 + intval(self::$child_args['outercirclebordersize']) * 2;
                 } else {
                     $full_icon_size = self::$parent_args['icon_size'];
                 }
                 if (self::$parent_args['icon_align'] == 'right') {
                     $attr['style'] .= sprintf('padding-right:%spx;', $full_icon_size + 20);
                 } else {
                     $attr['style'] .= sprintf('padding-left:%spx;', $full_icon_size + 20);
                 }
             }
         }
     }
     return $attr;
 }
开发者ID:rvelezc,项目名称:drpelaezgo.com,代码行数:35,代码来源:class-content-boxes.php

示例4: content_box_heading_attr

 function content_box_heading_attr()
 {
     $attr['class'] = 'content-box-heading';
     if (self::$parent_args['title_size']) {
         $font_size = FusionCore_Plugin::strip_unit(self::$parent_args['title_size']);
         $attr['style'] = sprintf('font-size: %spx;line-height:%spx;', $font_size, $font_size + 2);
     }
     return $attr;
 }
开发者ID:mathewdenis,项目名称:avada,代码行数:9,代码来源:class-content-boxes.php


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