/**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  */
 public function element_shortcode_full($atts = null, $content = null)
 {
     extract(shortcode_atts($this->config['params'], $atts));
     // tag1,tag2 => tag1 tag2 , to filter
     $tag = str_replace(' ', '_', $tag);
     $tag = str_replace(',', ' ', $tag);
     $inner_content = WR_Pb_Helper_Shortcode::remove_autop($content);
     WR_Pb_Helper_Functions::heading_icon($heading, $icon);
     return "\n\t\t\t<div class='panel panel-default' data-tag='{$tag}'>\n\t\t\t\t<div class='panel-heading'>\n\t\t\t\t\t<h4 class='panel-title'>\n\t\t\t\t\t\t<a data-toggle='collapse' href='#collapse{index}'>\n\t\t\t\t\t\t\t<i class='{$icon}'></i>{$heading}\n\t\t\t\t\t\t\t<i class='wr-icon-accordion'></i>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h4>\n\t\t\t\t</div>\n\t\t\t\t<div id='collapse{index}' class='panel-collapse collapse {show_hide}'>\n\t\t\t\t  <div class='panel-body'>\n\t\t\t\t  {$inner_content}\n\t\t\t\t  </div>\n\t\t\t\t</div>\n\t\t\t</div><!--seperate-->";
 }
Exemple #2
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  */
 public function element_shortcode_full($atts = null, $content = null)
 {
     extract(shortcode_atts($this->config['params'], $atts));
     $content_class = !empty($image_file) ? 'carousel-caption' : 'carousel-content';
     $img = !empty($image_file) ? "<img width='{WIDTH}' height='{HEIGHT}' src='{$image_file}' alt='{$alt}' style='height : {HEIGHT}px;'>" : '';
     // remove image shortcode in content
     $content = WR_Pb_Helper_Shortcode::remove_wr_shortcodes($content, 'wr_image');
     $inner_content = WR_Pb_Helper_Shortcode::remove_autop($content);
     WR_Pb_Helper_Functions::heading_icon($heading, $icon, true);
     $heading = trim($heading);
     $inner_content = trim($inner_content);
     if (empty($heading) && empty($inner_content)) {
         $html_content = "";
     } else {
         $html_content = "<div class='{$content_class}'>";
         $html_content .= !empty($heading) ? "<h4><i class='{$icon}'></i>{$heading}</h4>" : '';
         $html_content .= !empty($inner_content) ? "<p>{$inner_content}</p>" : '';
         $html_content .= "</div>";
     }
     return "<div class='{active} item'>{$img}{$html_content}</div><!--seperate-->";
 }
Exemple #3
0
 /**
  * Generate HTML code from shortcode content.
  *
  * @param   array   $atts     Shortcode attributes.
  * @param   string  $content  Current content.
  *
  * @return  string
  */
 public function element_shortcode_full($atts = null, $content = null)
 {
     $arr_params = shortcode_atts($this->config['params'], $atts);
     $initial_open = intval($arr_params['initial_open']);
     $tab_position = $arr_params['tab_position'];
     $random_id = WR_Pb_Utils_Common::random_string();
     $tab_navigator = array();
     $tab_navigator[] = '<ul class="nav nav-tabs">';
     $sub_shortcode = do_shortcode($content);
     $items = explode('<!--seperate-->', $sub_shortcode);
     $items = array_filter($items);
     $initial_open = $initial_open > count($items) ? 1 : $initial_open;
     $fade_effect = '';
     if ($arr_params['fade_effect'] == 'yes') {
         $fade_effect = 'fade in';
     }
     foreach ($items as $idx => $item) {
         // Extract icon & heading
         $ex_heading = explode('<!--heading-->', $item);
         $ex_icon = explode('<!--icon-->', isset($ex_heading[1]) ? $ex_heading[1] : '');
         $new_key = $random_id . $idx;
         $active = $idx + 1 == $initial_open ? 'active' : '';
         $item = isset($ex_icon[1]) ? $ex_icon[1] : '';
         $item = str_replace('{index}', $new_key, $item);
         $item = str_replace('{active}', $active, $item);
         $item = str_replace('{fade_effect}', $fade_effect, $item);
         $items[$idx] = $item;
         $icon = !empty($ex_icon[0]) ? "<i class='{$ex_icon[0]}'></i>&nbsp;" : '';
         $heading = !empty($ex_heading[0]) ? $ex_heading[0] : __('Tab Item ') . ' ' . $idx;
         WR_Pb_Helper_Functions::heading_icon($heading, $icon);
         $active_li = $idx + 1 == $initial_open ? "class='active'" : '';
         $tab_navigator[] = "<li {$active_li}><a href='#pane{$new_key}'>{$icon}{$heading}</a></li>";
     }
     $sub_shortcode = implode('', $items);
     $tab_content = "<div class='tab-content'>{$sub_shortcode}</div>";
     // update min-height of each tab content in case tap position is left/right
     if (in_array($tab_position, array('left', 'right'))) {
         $min_height = 36 * count($items);
         $tab_content = WR_Pb_Utils_Placeholder::remove_placeholder($tab_content, 'custom_style', "style='min-height: {$min_height}px'");
     }
     $tab_navigator[] = '</ul>';
     $tab_positions = array('top' => '', 'left' => 'tabs-left', 'right' => 'tabs-right', 'bottom' => 'tabs-below');
     $extra_class = $tab_positions[$tab_position];
     if ($tab_position == 'bottom') {
         $tab_content .= implode('', $tab_navigator);
     } else {
         $tab_content = implode('', $tab_navigator) . $tab_content;
     }
     $html_element = "<div class='tabbable {$extra_class}' id='tab_{ID}'>{$tab_content}</div>";
     $html_element = str_replace('{ID}', "{$random_id}", $html_element);
     return $this->element_wrapper($html_element, $arr_params);
 }
Exemple #4
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  */
 public function element_shortcode_full($atts = null, $content = null)
 {
     extract(shortcode_atts($this->config['params'], $atts));
     WR_Pb_Helper_Functions::heading_icon($heading, $icon, true);
     return "\n\t\t\t<li>\n\t\t\t\t[icon]<div class='wr-sub-icons' style='wr-styles'>\n\t\t\t\t\t<i class='{$icon}'></i>\n\t\t\t\t</div>[/icon]\n\t\t\t\t<div class='wr-list-content-wrap'>\n\t\t\t\t\t[heading]<h4 style='wr-list-title'>{$heading}</h4>[/heading]\n\t\t\t\t\t<p>{$content}</p>\n\t\t\t\t</div>\n\t\t\t</li><!--seperate-->";
 }