function xmlFile() { $template = preg_replace('#\\W#', '', rsgInstance::getVar('xmlTemplate', 'meta')); $template = strtolower($template); // require generic template which all other templates should extend require_once JPATH_RSGALLERY2_SITE . '/templates/meta/xml.php'; // require the template specified to be used require_once JPATH_RSGALLERY2_SITE . '/templates/' . $template . '/xml.php'; // prepare and output xml $xmlTemplate = "rsgXmlGalleryTemplate_{$template}"; $xmlTemplate = new $xmlTemplate(rsgInstance::getGallery()); ob_start(); $xmlTemplate->prepare(); $content = ob_get_clean(); $xmlTemplate->printHead(); echo $content; die; // quit now so that only the xml is sent and not the joomla template // this is a saftey measure that should not be needed }
/** * Show main gallery page */ function showMainGalleries() { global $rsgConfig; $gallery = rsgInstance::getGallery(); $this->gallery = $gallery; //Get values for page navigation from URL $limit = rsgInstance::getInt('limitg', $rsgConfig->get('galcountNrs')); $limitstart = rsgInstance::getInt('limitstartg', 0); //Get number of galleries including main gallery $this->kids = $gallery->kids(); $kidCountTotal = count($gallery->kids()); $this->pageNav = false; //Show page navigation if selected in backend if ($rsgConfig->get('dispLimitbox') == 1 && $kidCountTotal > $limit || $rsgConfig->get('dispLimitbox') == 2) { require_once JPATH_RSGALLERY2_ADMIN . '/includes/gpagination.php'; $this->kids = array_slice($this->kids, $limitstart, $limit); $this->pageNav = new JGPagination($kidCountTotal, $limitstart, $limit); } $this->display('gallery.php'); }
/** * Returns: an array of items in the order requested * @todo default values should be obtained from config or elsewhere for limits, ordering, etc. * @static * @deprecated Use rsgGallery->items(); instead! */ function getItems() { $gallery = rsgInstance::getGallery(); return $gallery->items(); }
/** * shows proper Joomla breadcrumb pathway */ function showRSPathWay() { global $mainframe, $option; //Don't show the RSG2 pathway if RSGallery2 is not the component being displayed if ($option != 'com_rsgallery2') { return; } //Get information on the current menu item and the gallery id for the active menu item $menus =& JMenu::getInstance('site'); $menuitem =& $menus->getActive(); if (!empty($menuitem->query['gid'])) { $baseGalleryThisMenuItem = $menuitem->query['gid']; } else { //in case of a menu item for the root gallery $baseGalleryThisMenuItem = 0; } //Get gallery information $gallery = rsgInstance::getGallery(); $currentGallery = $gallery->id; $item = rsgInstance::getItem(); //Set up galleries to show in the pathway $galleries = array(); $galleries[] = $gallery; if ($currentGallery != $baseGalleryThisMenuItem) { while ($gallery->parent != $baseGalleryThisMenuItem) { $gallery = $gallery->parent(); $galleries[] = $gallery; } } $galleries = array_reverse($galleries); //Add gallery pathway items $pathway =& $mainframe->getPathway(); foreach ($galleries as $gallery) { if ($gallery->id != $baseGalleryThisMenuItem) { if ($gallery->id == $currentGallery && empty($item)) { $pathway->addItem($gallery->name); } else { $link = 'index.php?option=com_rsgallery2&gid=' . $gallery->id; $pathway->addItem($gallery->name, $link); } } } //Add image name to pathway if an image is displayed (page in URL is the string 'inline') $page = JRequest::getString('page', 0); if ($page == 'inline') { $pathway->addItem($item->title); } }