/**
     * (non-PHPdoc)
     * @see GalleryHelper::get_markup()
     */
    public function get_markup()
    {
        if (empty($this->images)) {
            return '';
        }
        ThemeHelpers::load_css('slideshow');
        ThemeHelpers::load_js('slideshow');
        $toret = array();
        foreach ($this->images as $k => $image) {
            $tmp = new stdClass();
            $tmp->src = $this->get_image_src($k);
            $tmp->alt = $this->get_image_alt($k);
            $tmp->desc = $this->get_image_description($k);
            $tmp->caption = $this->get_image_caption($k);
            $tmp->id = $this->get_image_id($k);
            $tmp->width = $this->get_image_width($k);
            $tmp->height = $this->get_image_height($k);
            $toret[] = $tmp;
        }
        $json = json_encode(array('images' => $toret, 'loading' => __('Loading image %number%/%total%', 'theme'), 'uid' => $this->unid));
        return <<<EOF
\t<script>
\t\twindow.preload_images = window.preload_images || {};
\t\twindow.preload_images.{$this->unid} = {$json};
\t</script>
EOF;
    }
 /**
  * (non-PHPdoc)
  * @see ImagePreload::get_markup()
  */
 function get_markup()
 {
     ThemeHelpers::load_css('slideshow');
     ThemeHelpers::load_js('slideshow-oneimageforall');
     $images_list = has_post_thumbnail() ? get_the_post_thumbnail(get_the_ID(), $this->get_slideshow_dimension()) : parent::get_markup();
     $this->set_markup('images_list', $images_list);
     return $this->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;
 }
 /**
  * Set the class to get map datas from the Simple fields plugin
  * Checks if the plugin is enabled.
  * @return GMapDataRetriever $this for chainability
  */
 public function use_simple_fields()
 {
     if (!function_exists('simple_fields_get_post_group_values')) {
         wp_die('You need Simple Fields to be Up And Running!');
     }
     $default = array('Map' => array(array('lat' => 0, 'lng' => 0)), 'Title' => array(''), 'Description' => array(''), 'Balloon Text' => array(''));
     $map_data = simple_fields_get_post_group_values(get_the_ID(), 'Map Data');
     if (!empty($map_data)) {
         ThemeHelpers::load_js('map');
     }
     $map_data = wp_parse_args($map_data, $default);
     if (function_exists('simple_fields_field_googlemaps_register')) {
         //vd($map_data);
         $data = array('center' => array('lat' => floatval($map_data['Map'][0]['lat']), 'lng' => floatval($map_data['Map'][0]['lng'])), 'point' => array('lat' => floatval($map_data['Map'][0]['lat']), 'lng' => floatval($map_data['Map'][0]['lng'])), 'zoom' => intval($map_data['Map'][0]['preferred_zoom']), 'type' => $map_data['Map Type'][0], 'title' => $map_data['Title'][0], 'content' => str_replace(array('%book%'), array('<a class="book-action" href="javascript:;">' . __('book', 'theme') . '</a>'), $map_data['Balloon Text'][0]), 'book_trans' => __('book', 'theme'));
     } else {
         $data = array('center' => array('lat' => floatval(empty($map_data['Center Latitude'][0]) ? $map_data['Latitude'][0] : $map_data['Center Latitude'][0]), 'lng' => floatval(empty($map_data['Center Longitude'][0]) ? $map_data['Longitude'][0] : $map_data['Center Longitude'][0])), 'point' => array('lat' => floatval($map_data['Latitude'][0]), 'lng' => floatval($map_data['Longitude'][0])), 'zoom' => intval($map_data['Zoom'][0]), 'type' => $map_data['Map Type'][0], 'title' => $map_data['Balloon Title'][0], 'content' => str_replace(array('%book%'), array('<a class="book-action" href="javascript:;">' . __('book', 'theme') . '</a>'), $map_data['Balloon Text'][0]), 'book_trans' => __('book', 'theme'));
     }
     return $this->set_map_data($data);
 }
 /**
  * (non-PHPdoc)
  * @see FeatureWithAssets::load_assets()
  */
 function load_assets()
 {
     ThemeHelpers::load_js('showcase');
 }
 /**
  * Loads the needed assets
  * @return MinigalleryBigImageWithThumbs $this for chainability
  */
 public function load_assets()
 {
     ThemeHelpers::load_js('minigallery-big-image-with-thumbs');
     ThemeHelpers::load_css('minigallery-big-image-with-thumbs');
     return $this;
 }
 /**
  * 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;
 }
 /**
  * Retrieves the html markup
  * @return string html markup
  */
 function get_markup()
 {
     return ThemeHelpers::script($this->render(), 'id="runtime-infos"');
 }
 /**
  * (non-PHPdoc)
  * @see FeatureWithAssets::load_assets()
  */
 public function load_assets()
 {
     ThemeHelpers::load_js('jquery.cycle2');
     //ThemeHelpers::load_js('slideshow2');
 }
 /**
  * (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();
 }