вместо $this->countModules('h2_1')
JFactory::getDocument()->countModules('h2_1')
Спасибо вам!
У меня есть файл template.php в нем класс
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
class obrabTemplate {
а в классе одна из функций
public function __construct(& $thisTemplate) {
// get links to global vars
$this->doc = & $thisTemplate;
$this->config = & JFactory::getConfig();
$this->url = & JFactory::getURI();
$this->app = & JFactory::getApplication();
$this->menu = & JSite::getMenu();
$this->params = & $this->app->getTemplate(true)->params;
// init template vars
$this->user = & JFactory::getUser();
$this->bodyClass = $this->_getBodyClass();
$this->date = $this->_getDateCurrent();
$this->langDefault = $this->_getLangDefault();
$this->lang = $this->_getLangCurrent();
$this->itemidDefault = $this->_getItemidDefault();
$this->itemidCurrent = $this->_getItemidCurrent();
$this->isFront = $this->_isFront();
$this->title = $this->_getTitle();
$this->sitename = $this->_getSitename();
$this->req = $this->_getRequest();
$this->isError = $this->_isErrors();
$this->baseurl = $this->doc->baseurl;
$this->dir = $this->doc->getDirection();
// relative paths
$this->path = $this->_getTemplatePath();
$this->flash = $this->path.'/flash';
$this->img = $this->path.'/images';
$this->css = $this->path.'/css';
$this->js = $this->path.'/js';
// absolute paths
$this->pathFull = $this->_getTemplatePathFull();
$this->flashFull = $this->pathFull.DS.'flash';
$this->imgFull = $this->pathFull.DS.'images';
$this->cssFull = $this->pathFull.DS.'css';
$this->jsFull = $this->pathFull.DS.'js';
}
в пределах этого класса все работает замечательно.
ПОтом все это идет в index.php
require_once(dirname(__FILE__).DS.'php'.DS.'template.php');
само тело шаблона
include (dirname(__FILE__).DS.'php'.DS.'desktop.php');
так вот, как я могу использовать свои упрощенные за пределами функции.