Esempio n. 1
0
 /**
  * Render the child shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => '', 'circle' => '', 'circlecolor' => '', 'circlebordercolor' => '', 'icon' => '', 'iconcolor' => '', 'iconflip' => '', 'iconrotate' => '', 'iconspin' => '', 'image' => '', 'image_height' => '35', 'image_width' => '35', 'link' => '', 'linktarget' => '_self', 'linktext' => '', 'textcolor' => '', 'title' => '', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1'), $args);
     extract($defaults);
     self::$child_args = $defaults;
     $output = '';
     $icon_output = '';
     $title_output = '';
     $content_output = '';
     $link_output = '';
     $alt = '';
     if ($image && $image_width && $image_height) {
         $image_id = FusionCore_Plugin::get_attachment_id_from_url($image);
         if ($image_id) {
             $alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
         }
         $icon_output = sprintf('<div %s><img src="%s" width="%s" height="%s" alt="%s" /></div>', FusionCore_Plugin::attributes('content-box-shortcode-icon'), $image, $image_width, $image_height, $alt);
     } elseif ($icon) {
         $icon_output = sprintf('<div %s><i %s></i></div>', FusionCore_Plugin::attributes('icon'), FusionCore_Plugin::attributes('content-box-shortcode-icon'));
     }
     if ($title) {
         $title_output = sprintf('<h2 %s>%s</h2>', FusionCore_Plugin::attributes('content-box-heading'), $title);
     }
     if ((self::$parent_args['layout'] == 'icon-on-side' || self::$parent_args['layout'] == 'icon-with-title') && self::$parent_args['icon_align'] == 'right') {
         $heading_content = $title_output . $icon_output;
     } else {
         $heading_content = $icon_output . $title_output;
     }
     if ($link) {
         $heading_content = sprintf('<a %s %s>%s</a>', FusionCore_Plugin::attributes('heading-link'), FusionCore_Plugin::attributes('content-box-shortcode-link'), $heading_content);
     } else {
     }
     $heading = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('content-box-shortcode-heading-wrapper'), $heading_content);
     if ($link && $linktext) {
         $link_output = sprintf('<a %s %s>%s</a><div class="fusion-clearfix"></div>', FusionCore_Plugin::attributes('read-more'), FusionCore_Plugin::attributes('content-box-shortcode-link'), $linktext);
     }
     $content_output = sprintf('<div class="fusion-clearfix"></div><div %s>%s</div>', FusionCore_Plugin::attributes('content-box-shortcode-content-container'), do_shortcode($content) . $link_output);
     $output = $heading . $content_output;
     $html = sprintf('<div %s><div %s>%s</div></div>', FusionCore_Plugin::attributes('content-box-shortcode'), FusionCore_Plugin::attributes('content-box-shortcode-content-wrapper'), $output);
     $clearfix_test = $this->column_counter / $this->num_of_columns;
     if (is_int($clearfix_test)) {
         $html .= '<div class="fusion-clearfix"></div>';
     }
     $this->column_counter++;
     return $html;
 }
 /**
  * Render the child shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => self::$parent_args['backgroundcolor'], 'circle' => '', 'circlecolor' => self::$parent_args['circlecolor'], 'circlebordercolor' => self::$parent_args['circlebordercolor'], 'circlebordersize' => self::$parent_args['circlebordersize'], 'outercirclebordercolor' => self::$parent_args['outercirclebordercolor'], 'outercirclebordersize' => self::$parent_args['outercirclebordersize'], 'icon' => '', 'iconcolor' => self::$parent_args['iconcolor'], 'iconrotate' => '', 'iconspin' => '', 'image' => '', 'image_height' => '35', 'image_width' => '35', 'link' => '', 'linktarget' => self::$parent_args['linktarget'], 'linktext' => '', 'textcolor' => '', 'title' => '', 'animation_type' => self::$parent_args['animation_type'], 'animation_direction' => self::$parent_args['animation_direction'], 'animation_speed' => self::$parent_args['animation_speed']), $args);
     if ((self::$parent_args['layout'] == 'timeline-vertical' || self::$parent_args['layout'] == 'timeline-horizontal' || self::$parent_args['layout'] == 'clean-vertical' || self::$parent_args['layout'] == 'clean-horizontal') && !$defaults['outercirclebordercolor']) {
         //$defaults['outercirclebordercolor'] = '#f6f6f6';
     }
     if (self::$parent_args['layout'] == 'icon-boxed') {
     }
     if (self::$parent_args['settings_lvl'] == 'parent') {
         $defaults['backgroundcolor'] = self::$parent_args['backgroundcolor'];
         $defaults['circlecolor'] = self::$parent_args['circlecolor'];
         $defaults['circlebordercolor'] = self::$parent_args['circlebordercolor'];
         $defaults['circlebordersize'] = self::$parent_args['circlebordersize'];
         $defaults['outercirclebordercolor'] = self::$parent_args['outercirclebordercolor'];
         $defaults['outercirclebordersize'] = self::$parent_args['outercirclebordersize'];
         $defaults['iconcolor'] = self::$parent_args['iconcolor'];
         $defaults['animation_type'] = self::$parent_args['animation_type'];
         $defaults['animation_direction'] = self::$parent_args['animation_direction'];
         $defaults['animation_speed'] = self::$parent_args['animation_speed'];
     }
     extract($defaults);
     self::$child_args = $defaults;
     $output = '';
     $icon_output = '';
     $title_output = '';
     $content_output = '';
     $link_output = '';
     $alt = '';
     $heading = '';
     if ($image && $image_width && $image_height) {
         $image_id = FusionCore_Plugin::get_attachment_id_from_url($image);
         if ($image_id) {
             $alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
         }
         $icon_output = sprintf('<div %s><img src="%s" width="%s" height="%s" alt="%s" /></div>', FusionCore_Plugin::attributes('content-box-shortcode-icon'), $image, $image_width, $image_height, $alt);
     } elseif ($icon) {
         if ($outercirclebordercolor && $outercirclebordersize) {
             $icon_output = sprintf('<div %s><span %s><i %s></i></span></div>', FusionCore_Plugin::attributes('content-box-shortcode-icon-parent'), FusionCore_Plugin::attributes('content-box-shortcode-icon-wrapper'), FusionCore_Plugin::attributes('content-box-shortcode-icon'));
         } else {
             $icon_output = sprintf('<div %s><i %s></i></div>', FusionCore_Plugin::attributes('content-box-shortcode-icon-parent'), FusionCore_Plugin::attributes('content-box-shortcode-icon'));
         }
     }
     if ($title) {
         $title_output = sprintf('<h2 %s>%s</h2>', FusionCore_Plugin::attributes('content-box-heading'), $title);
     }
     if ((self::$parent_args['layout'] == 'icon-on-side' || self::$parent_args['layout'] == 'icon-with-title' || self::$parent_args['layout'] == 'timeline-vertical' || self::$parent_args['layout'] == 'clean-horizontal') && self::$parent_args['icon_align'] == 'right') {
         $heading_content = $title_output . $icon_output;
     } else {
         $heading_content = $icon_output . $title_output;
     }
     if ($link) {
         $heading_content = sprintf('<a %s %s>%s</a>', FusionCore_Plugin::attributes('heading-link'), FusionCore_Plugin::attributes('content-box-shortcode-link'), $heading_content);
     }
     if ($heading_content) {
         $heading = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('content-box-shortcode-heading-wrapper'), $heading_content);
     }
     if ($link && $linktext) {
         if (self::$parent_args['link_type'] == 'text' || self::$parent_args['link_type'] == 'button-bar') {
             $link_output = sprintf('<div class="fusion-clearfix"></div><a %s %s>%s</a><div class="fusion-clearfix"></div>', FusionCore_Plugin::attributes('fusion-read-more'), FusionCore_Plugin::attributes('content-box-shortcode-link'), $linktext);
         } else {
             if (self::$parent_args['link_type'] == 'button') {
                 $link_output = sprintf('<div class="fusion-clearfix"></div><a %s>%s</a><div class="fusion-clearfix"></div>', FusionCore_Plugin::attributes('content-box-shortcode-link'), $linktext);
             }
         }
     }
     $content_output = sprintf('<div class="fusion-clearfix"></div><div %s>%s</div>', FusionCore_Plugin::attributes('content-box-shortcode-content-container'), do_shortcode($content) . $link_output);
     $output = $heading . $content_output;
     $timeline = '';
     if ($icon && self::$parent_args['icon_circle'] == 'yes' && self::$parent_args['layout'] == 'timeline-horizontal' && self::$parent_args['columns'] != '1') {
         $timeline = sprintf('<div %s></div>', FusionCore_Plugin::attributes('content-box-shortcode-timeline'));
     }
     if ($icon && self::$parent_args['icon_circle'] == 'yes' && self::$parent_args['layout'] == 'timeline-vertical') {
         $timeline = sprintf('<div %s></div>', FusionCore_Plugin::attributes('content-box-shortcode-timeline'));
     }
     $html = sprintf('<div %s><div %s>%s%s</div></div>', FusionCore_Plugin::attributes('content-box-shortcode'), FusionCore_Plugin::attributes('content-box-shortcode-content-wrapper'), $output, $timeline);
     $clearfix_test = $this->column_counter / $this->num_of_columns;
     if (is_int($clearfix_test)) {
         $html .= '<div class="fusion-clearfix"></div>';
     }
     $this->column_counter++;
     return $html;
 }