public function __construct($default = array()) { parent::__construct($default); // init vars $this->joomla = JFactory::getApplication(); $this->user = JFactory::getUser(); $this->session = JFactory::getSession(); $this->document = JFactory::getDocument(); $this->dispatcher = JDispatcher::getInstance(); $this->option = YRequest::getCmd('option'); $this->link_base = 'index.php?option=' . $this->option; $this->controller = $this->getName(); // add super administrator var to user $this->user->superadmin = UserHelper::isJoomlaSuperAdmin($this->user); // init additional admin vars if ($this->joomla->isAdmin()) { $this->baseurl = 'index.php?option=' . $this->option . '&controller=' . $this->getName(); } // init additional site vars if ($this->joomla->isSite()) { $this->itemid = (int) $GLOBALS['Itemid']; $this->params = $this->joomla->getParams(); $this->pathway = $this->joomla->getPathway(); } }