コード例 #1
0
 /**
  * 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;
 }
 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }