示例#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 = shortcode_atts(array('class' => '', 'id' => '', 'circle' => 'yes', 'circlecolor' => '', 'circlebordercolor' => '', 'flip' => '', 'icon' => '', 'iconcolor' => '', 'rotate' => '', 'size' => 'large', 'spin' => 'no', 'animation_type' => '', 'animation_direction' => 'down', 'animation_speed' => '0.1'), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<i %s>%s</i>', FusionCore_Plugin::attributes('fontawesome-shortcode'), do_shortcode($content));
     return $html;
 }
 /**
  * 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;
 }