cname = self::$statcname; $this->interface = cmsapiInterface::getInstance($this->cname); $database = $this->interface->getDB(); $this->gconfig = aliroComponentConfiguration::getInstance('com_glossary'); $this->admin = $admin; $this->idparm = $this->interface->getParam($_REQUEST, 'id', 0); if ($this->idparm) { $database->setQuery("SELECT * FROM #__glossary WHERE id = $this->idparm"); $entries = $database->loadObjectList(); if ($entries) { $this->glossid = $entries[0]->catid; $total = 1; } } $glossparam = $this->interface->getFromConfig('com_glossary', 'glossid', 0); if (0 == $this->glossid) $this->glossid = $this->interface->getParam($_REQUEST, 'glossid', $glossparam); if ($this->glossid) $this->glossary = glossaryGlossaryManager::getInstance()->getByID($this->glossid); else { $this->glossary = glossaryGlossaryManager::getInstance()->getDefault(); $this->glossid = empty($this->glossary) ? 0 : $this->glossary->id; } $this->Itemid = $this->interface->getParam($_REQUEST, 'Itemid', 0); $this->orderby = $this->interface->getParam($_REQUEST, 'orderby', _GLOSSARY_DEFAULT_ORDERING); $configuration = aliroComponentConfiguration::getInstance('com_glossary'); if (file_exists($this->interface->getCfg('absolute_path')."/components/com_glossary/css/glossary.css")) { $css = << GLOSSARY_USER_CSS; $this->interface->addCustomHeadTag($css); } glossaryUserControllers::loadLanguage($this->gconfig, $this->glossary->language); $this->remUser = $this->interface->getUser(); } public static function loadLanguage ($configuration, $forcelang='') { $interface = cmsapiInterface::getInstance(self::$statcname); $absolute_path = $interface->getCfg('absolute_path'); $lang = $forcelang ? $forcelang : ($configuration->language ? $configuration->language : $interface->getCfg('lang')); //Need config values for language files foreach (get_object_vars($configuration) as $k=>$v) $$k = $configuration->$k; if (file_exists($absolute_path."/components/com_glossary/"._CMSAPI_LANGFILE.$lang.'.php')) require_once($absolute_path."/components/com_glossary/"._CMSAPI_LANGFILE.$lang.'.php'); require_once($absolute_path."/components/com_glossary/"._CMSAPI_LANGFILE."english.php"); } }