/** * An iterator for the purposes of Slider Template files. Loads the next slide in, preparing other methods to spit out this Slide's information. * * @return boolean * */ public function has_slides() { if (!$this->instance) { throw new Exception("The widget's instance data, containing information about which slide group to show, could not be loaded."); return false; } if (!is_array($this->slides) || count($this->slides) < 1) { $this->slides = $this->slide_group->get_slides(); } // on which slide should we work? does it exist? if (count($this->slides) < $this->slider_iteration + 1) { return false; // we are at the end of the slides } // otherwise, load in the data if (!empty($this->slides[$this->slider_iteration]['title'])) { $this->slide_title = $this->slides[$this->slider_iteration]['title']; } if (!empty($this->slides[$this->slider_iteration]['description'])) { $this->slide_description = $this->slides[$this->slider_iteration]['description']; } else { $this->slide_description = ''; } if (!empty($this->slides[$this->slider_iteration]['id'])) { $this->slide_identifier = $this->slides[$this->slider_iteration]['id']; } // the background may be blank! if (!empty($this->slides[$this->slider_iteration]['background'])) { $this->slide_background_url = $this->slides[$this->slider_iteration]['background']; } else { $this->slide_background_url = ''; } // the link may be blank! if (!empty($this->slides[$this->slider_iteration]['link'])) { $this->slide_link = $this->slides[$this->slider_iteration]['link']; } else { $this->slide_link = ''; } // get X and Y coords if (!empty($this->slides[$this->slider_iteration]['title_pos_x']) || 0 === $this->slides[$this->slider_iteration]['title_pos_x']) { $this->slide_x = $this->slides[$this->slider_iteration]['title_pos_x']; } if (!empty($this->slides[$this->slider_iteration]['title_pos_y']) || 0 === $this->slides[$this->slider_iteration]['title_pos_y']) { $this->slide_y = $this->slides[$this->slider_iteration]['title_pos_y']; } // the data is ready, bump the iterator and return true $this->slider_iteration++; return true; }
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ if (!defined('TOTAL_SLIDER_REQUIRED_CAPABILITY')) { header('HTTP/1.1 403 Forbidden'); die('<h1>Forbidden</h1>'); } if (!function_exists('__')) { header('HTTP/1.1 403 Forbidden'); die('<h1>Forbidden</h1>'); } ?> <!--sortable slides--> <?php $group = new Total_Slide_Group($TS_Total_Slider->slug); $group->load(); $current_slides = $group->get_slides(); ?> <div id="slidesort-container"> <ul id="slidesort" style="width:<?php echo intval(count($current_slides) * 180); ?> px;"> <?php if (is_array($current_slides) && count($current_slides) > 0) { foreach ($current_slides as $slide) { $my_id = $TS_Total_Slider->id_filter($slide['id']); if (is_numeric($slide['background'])) { $background_url = wp_get_attachment_url((int) $slide['background']); } else { $background_url = $slide['background']; }
/** * Gather a count of this slide group for the 'count' column. * * @param Total_Slide_Group $item A slide group object. * @return integer */ public function column_slides_count($item) { $group_object = new Total_Slide_Group($item->slug); $group_object->load(); return count($group_object->get_slides()); }