Ejemplo n.º 1
0
 /**
  * Implement event onGetLayoutPath to return the layout which override by T3 & T3 templates
  * This event is fired by overriding ModuleHelper class
  * Return path to layout if found, false if not
  *
  * @param   string  $module  The name of the module
  * @param   string  $layout  The name of the module layout. If alternative
  *                           layout, in the form template:filename.
  *
  * @return  null
  */
 function onGetLayoutPath($module, $layout)
 {
     // Detect layout path in T3 themes
     if (T3Common::detect()) {
         $tPath = T3Path::getPath('html' . DS . $module . DS . $layout . '.php', false);
         if ($tPath) {
             return $tPath;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Sets an entire array of search paths for templates or resources.
  *
  * @param   string 		The type of path to set, typically 'template'.
  * @param   string|array	The new set of search paths.  If null or false, resets to the current directory only.
  */
 protected function _setPath($type, $path)
 {
     jimport('joomla.application.helper');
     $component = JApplicationHelper::getComponentName();
     $app = JFactory::getApplication();
     // Clear out the prior search dirs
     $this->_path[$type] = array();
     // Actually add the user-specified directories
     $this->_addPath($type, $path);
     // Always add the fallback directories as last resort
     switch (strtolower($type)) {
         case 'template':
             // Set the alternative template search dir
             if (isset($app)) {
                 $component = preg_replace('/[^A-Z0-9_\\.-]/i', '', $component);
                 $fallback = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . $this->getName();
                 //if it is T3 template, update search path for template
                 if (T3Common::detect()) {
                     if (is_array($fallback1 = T3Path::getPath('html' . DS . $component . DS . $this->getName(), true))) {
                         $fallback = array_reverse($fallback1);
                     }
                 }
                 $this->_addPath('template', $fallback);
             }
             break;
     }
 }
Ejemplo n.º 3
0
 /**
  * Return the pagination footer.
  *
  * @return  string   Pagination footer.
  * @since   11.1
  */
 public function getListFooter()
 {
     $app = JFactory::getApplication();
     $list = array();
     $list['prefix'] = $this->prefix;
     $list['limit'] = $this->limit;
     $list['limitstart'] = $this->limitstart;
     $list['total'] = $this->total;
     $list['limitfield'] = $this->getLimitBox();
     $list['pagescounter'] = $this->getPagesCounter();
     $list['pageslinks'] = $this->getPagesLinks();
     if (T3Common::detect()) {
         $chromePath = T3Path::getPath('html' . DS . 'pagination.php', false);
     } else {
         $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';
     }
     if (file_exists($chromePath)) {
         require_once $chromePath;
         if (function_exists('pagination_list_footer')) {
             return pagination_list_footer($list);
         }
     }
     return $this->_list_footer($list);
 }
Ejemplo n.º 4
0
 /**
  * Sets an entire array of search paths for templates or resources.
  *
  * @access protected
  * @param string $type The type of path to set, typically 'template'.
  * @param string|array $path The new set of search paths.  If null or
  * false, resets to the current directory only.
  */
 function _setPath($type, $path)
 {
     global $mainframe, $option;
     // clear out the prior search dirs
     $this->_path[$type] = array();
     // actually add the user-specified directories
     $this->_addPath($type, $path);
     // always add the fallback directories as last resort
     switch (strtolower($type)) {
         case 'template':
             // set the alternative template search dir
             if (isset($mainframe)) {
                 $option = preg_replace('/[^A-Z0-9_\\.-]/i', '', $option);
                 $fallback = JPATH_BASE . DS . 'templates' . DS . $mainframe->getTemplate() . DS . 'html' . DS . $option . DS . $this->getName();
                 //if it is T3 template, update search path for template
                 if (T3Common::detect()) {
                     if (is_array($fallback1 = T3Path::getPath('html' . DS . $option . DS . $this->getName(), true))) {
                         $fallback = array_reverse($fallback1);
                     }
                 }
                 $this->_addPath('template', $fallback);
             }
             break;
     }
 }
Ejemplo n.º 5
0
 /**
  * Return the pagination footer
  *
  * @access	public
  * @return	string	Pagination footer
  * @since	1.0
  */
 function getListFooter()
 {
     global $mainframe;
     $list = array();
     $list['limit'] = $this->limit;
     $list['limitstart'] = $this->limitstart;
     $list['total'] = $this->total;
     $list['limitfield'] = $this->getLimitBox();
     $list['pagescounter'] = $this->getPagesCounter();
     $list['pageslinks'] = $this->getPagesLinks();
     if (T3Common::detect()) {
         $chromePath = T3Path::getPath('html' . DS . 'pagination.php', false);
     } else {
         $chromePath = JPATH_THEMES . DS . $mainframe->getTemplate() . DS . 'html' . DS . 'pagination.php';
     }
     if (file_exists($chromePath)) {
         require_once $chromePath;
         if (function_exists('pagination_list_footer')) {
             return pagination_list_footer($list);
         }
     }
     return $this->_list_footer($list);
 }