/**
  * (non-PHPdoc)
  * @see GalleryHelper::get_markup()
  */
 public function get_markup()
 {
     $this->check_config()->cache_names()->merge_images();
     $tpl = new SubstitutionTemplate();
     $tpl->set_tpl('<div class="slideshow_image" title="%title%" style="%style%"></div>');
     $toret = '<div class="cycle" style="width:' . $this->config['w'] . 'px; height:' . $this->config['h'] . 'px; overflow:hidden;">';
     foreach ($this->images as $index => $image) {
         $toret .= $tpl->set_markup('title', $this->get_image_alt($index))->set_markup('style', $this->get_style($index))->replace_markup();
     }
     $toret .= '</div>';
     return $toret;
 }
 /**
  * (non-PHPdoc)
  * @see GalleryHelper::get_markup()
  */
 public function get_markup()
 {
     $markup_images = '';
     if (count($this->images) > 0) {
         $images_per_line = $this->images_per_row;
         foreach ($this->images as $k => $image) {
             $classes = array($this->single_image_container_class, 'image_' . $k);
             if ($images_per_line == 0) {
                 $images_per_line = $this->images_per_row;
             }
             if ($images_per_line == $this->images_per_row) {
                 $classes[] = 'alpha';
             }
             if ($images_per_line == 1) {
                 $classes[] = 'omega';
             }
             $images_per_line--;
             $big_img_src = wp_get_attachment_image_src($this->get_image_id($k), 'full');
             $big_img_src = $big_img_src[0];
             $markup_images .= '<div class="' . implode(' ', $classes) . '">' . HtmlHelper::anchor($big_img_src, HtmlHelper::image($this->get_image_src($k), array('alt' => $this->get_image_alt($k))), array('rel' => 'group', 'class' => 'fancy', 'title' => $this->get_image_title($k), 'data-description' => $this->get_image_description($k), 'data-caption' => $this->get_image_caption($k))) . '</div>';
         }
     }
     if (!$this->unid) {
         $this->calculate_unique();
     }
     $this->subs->set_markup('gallery-id', $this->unid);
     $this->subs->set_markup('images', $markup_images);
     ThemeHelpers::load_js('jquery-fancybox');
     ThemeHelpers::load_css('jquery-fancybox');
     return $this->subs->replace_markup();
 }
 /**
  * (non-PHPdoc)
  * @see GalleryHelper::get_markup()
  */
 public function get_markup()
 {
     $toret = '';
     if (count($this->images) > 0) {
         $subs = new SubstitutionTemplate();
         $subs->set_tpl($this->tpl)->set_markup('prev', HtmlHelper::anchor('javascript:;', '&lt;', array('class' => 'prev control')))->set_markup('next', HtmlHelper::anchor('javascript:;', '&gt;', array('class' => 'next control')));
         ThemeHelpers::load_js('minigallery-thumbs-link-to-big');
         ThemeHelpers::load_css('jquery-fancybox');
         foreach ($this->images as $index => $image) {
             $image_big = wp_get_attachment_image_src($this->get_image_id($index), $this->media_dimension_big);
             $image_small = wp_get_attachment_image_src($this->get_image_id($index), $this->media_dimension);
             $toret .= HtmlHelper::anchor($image_big[0], HtmlHelper::image($this->get_image_src($index), array('alt' => $this->get_image_alt($index), 'title' => $this->get_image_description($index), 'data-caption' => $this->get_image_caption($index))), array('class' => 'fancybox', 'rel' => 'group', 'title' => $this->get_image_caption($index)));
         }
         $toret = $subs->set_markup('list', $toret)->replace_markup();
     }
     return $toret;
 }
    /**
     * (non-PHPdoc)
     * @see GalleryHelper::get_markup()
     */
    public function get_markup()
    {
        if (empty($this->images)) {
            return '';
        }
        $toret = '';
        $subs = new SubstitutionTemplate();
        $subs->set_tpl(<<<EOF
\t<div class="showcase-slide">
\t\t<div class="showcase-content">
\t\t\t<div class="showcase-content-wrapper">
\t\t\t\t%img%
\t\t\t</div>
\t\t</div>
\t</div>\t
EOF
);
        foreach ($this->images as $id => $image) {
            $toret .= $subs->set_markup('img', wp_get_attachment_image($this->get_image_id($id), $this->media_dimension))->replace_markup();
        }
        return '<div id="showcase" class="showcase">' . $toret . '</div>';
    }
 public function get_markup()
 {
     $slides = '';
     $indicators = '';
     $slide_sub = new SubstitutionTemplate();
     $slide_sub->set_tpl($this->tpl_slide);
     foreach ($this->images as $k => $v) {
         $active = $k == 0 ? 'active' : '';
         $caption = '';
         $style = 'width: 100%; height: 100%; background: url(\'' . $this->get_image_src($k) . '\') no-repeat center center scroll transparent;';
         if ($this->get_image_title($k)) {
             $caption .= HtmlHelper::standard_tag('h2', $this->get_image_title($k));
         }
         if ($this->get_image_caption($k)) {
             $caption .= HtmlHelper::paragraph($this->get_image_caption($k));
         }
         $image = $slide_sub->set_markup('class', implode(' ', array('item', $active)))->set_markup('image', HtmlHelper::div('', array('alt' => $this->get_image_alt($k), 'style' => $style)))->set_markup('caption', HtmlHelper::div($caption, array('class' => 'carousel-caption')))->replace_markup();
         $indicator = HtmlHelper::list_item($inner_html, array('data-target' => '#' . $this->unid, 'data-slide-to' => $k, 'class' => $active));
         $slides .= $image . "\n";
         $indicators .= $indicator . "\n";
     }
     $subs = new SubstitutionTemplate();
     return $subs->set_tpl($this->tpl)->set_markup('id', $this->unid)->set_markup('container_classes', $this->container_classes)->set_markup('indicators', HtmlHelper::ordered_list($indicators, array('class' => 'carousel-indicators')))->set_markup('slides', HtmlHelper::div($slides, array('class' => 'carousel-inner')))->replace_markup();
 }
 /**
  * This is called back by wordpress when a tab shortcode is found
  * @param unknown_type $atts
  * @param string $content the content wrapped into the shortcode
  */
 public function tab_hook($atts, $content = null)
 {
     $parms = shortcode_atts(array('icon' => '', 'class' => '', 'title' => 'tab-entry_' . $this->number_of_entries, 'list' => true, 'from' => '', 'route_type' => '', 'mode' => ''), $atts);
     if ($parms['list'] !== 'false') {
         // let's maintain a list of tabs found in the current post
         // so we don't have to rebuild in the list_hook()
         $this->number_of_entries++;
         $this->list_of_entries[$parms['title']] = $parms;
         $this->list_of_entries[$parms['title']]['content'] = $content;
     }
     ThemeHelpers::load_js('tabs');
     // remove the autop feature that conflicts with inner html structure of a single tab
     remove_filter('the_content', 'wpautop');
     // render the html and return it to WordPress
     $toret = $this->tab_tpl->set_markup('id', ' id="' . sanitize_title($parms['title']) . '" ')->set_markup('class', ' class="tab ' . $parms['class'] . '" ')->set_markup('icon', $this->get_image($parms['icon']))->set_markup('content', wpautop($content))->replace_markup();
     //add_filter('the_content', 'wpautop');
     return $toret;
 }
    /**
     * Returns the <html> opening tag from html5 boilerplate
     * @param string|array $class some additional classes
     */
    public static function open_html($class = '')
    {
        if (is_array($class)) {
            $class = ' ' . join(' ', $class);
        }
        $class = ' ' . trim($class);
        ob_start();
        language_attributes();
        $langs = ob_get_contents();
        ob_end_clean();
        $sub = new SubstitutionTemplate();
        return $sub->set_tpl(<<<EOF
            <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7%class%" %langs%> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8%class%"  %langs%> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9%class%"  %langs%> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js%class%"  %langs%> <!--<![endif]-->\t\t
EOF
)->set_markup('langs', $langs)->set_markup('class', $class)->replace_markup();
    }
    /**
     * Renders the file and line informations.
     * @return string rendered info
     */
    public function get_file_info()
    {
        $db = debug_backtrace();
        $details = $db[2];
        $sub = new SubstitutionTemplate();
        return $sub->set_tpl(<<<EOF
\t<span class="file">%file%</span>: 
\t<span class="line">%line%</span>
EOF
)->set_markup('file', $details['file'])->set_markup('line', $details['line'])->replace_markup();
    }