Example #1
0
 /**
  * Adds js/css to the page object, and generates a gallery of the items
  * returns html string and sets $this->html
  * @return  string
  */
 public function getHTML()
 {
     if ($this->contextMenu) {
         static::addPageResources(array('css' => '/lib/jquery.contextMenu/jquery.contextMenu.css', 'js' => '/lib/jquery.contextMenu/jquery.contextMenu.js'));
     }
     if (!$this->identifier) {
         $this->identifier = 'vf-gallery-' . self::$count . '-' . md5(rand());
     }
     self::$count++;
     $this->setMemToken();
     $items = $this->getItemIDs();
     $params = array('width' => $this->width, 'height' => $this->height, 'crop' => $this->crop);
     $list = $items ? Client::getItems($items, $params) : null;
     $data = array('id' => $this->identifier, 'empty' => !$list, 'empty_message' => $this->empty_message, 'list' => $list, 'context_menu' => $this->contextMenu ? 'context_menu="true"' : null, 'folders_path' => $this->folder->path, 'token' => $this->_token);
     return $this->html = static::getMustache('gallery', $data);
 }
Example #2
0
 /**
  * Adds js/css to the page object, and generates the slideshow html
  * returns html string and sets $this->html
  * @return  string
  */
 public function getHTML()
 {
     static::addPageResources(array('js' => '/lib/js/jquery.hoverIntent.js'));
     list($large_conf, $small_conf) = $this->getItemsConfs();
     $items = $this->getItemIDs();
     $large = Client::getItems($items, $large_conf);
     $small = Client::getItems($items, $small_conf);
     if (!is_array($small)) {
         return;
     }
     if (!is_object($small[0])) {
         return;
     }
     if (!is_array($large)) {
         return;
     }
     if (!is_object($large[0])) {
         return;
     }
     $small[0]->class = $large[0]->class = "first selected";
     $data = array('folders_path' => $this->folder->path, 'transition' => $this->transition, 'delay' => $this->delay, 'autohide' => $this->auto_hide_toolbar ? 'yes' : 'no', 'autostart' => $this->autostart ? 'true' : 'false', 'enlarge' => $this->enlarge, 'controls' => $this->controls, 'captions' => $this->captions, 'main' => $large, 'thumbs' => $small, 'width' => $this->width, 'height' => $this->height);
     return $this->html = static::getMustache('slideshow', $data);
 }