getParam( 'language' ); // Make sure that the user's language exists if ( $lang && JLanguage::exists($lang) ) { $options['language'] = $lang; } else { $params = JComponentHelper::getParams('com_languages'); $client =& JApplicationHelper::getClientInfo($this->getClientId()); $options['language'] = $params->get($client->name, 'en-GB'); } } // One last check to make sure we have something if ( ! JLanguage::exists($options['language']) ) { $options['language'] = 'en-GB'; } parent::initialise($options); } /** * Route the application * * @access public */ function route() { parent::route(); } /** * Dispatch the application * * @access public */ function dispatch($component) { $document =& JFactory::getDocument(); $user =& JFactory::getUser(); $router =& $this->getRouter(); $params =& $this->getParams(); switch($document->getType()) { case 'html': { //set metadata $document->setMetaData( 'keywords', $this->getCfg('MetaKeys') ); if ( $user->get('id') ) { $document->addScript( JURI::root(true).'/includes/js/joomla.javascript.js'); } if($router->getMode() == JROUTER_MODE_SEF) { $document->setBase(JURI::current()); } } break; case 'feed': { $document->setBase(JURI::current()); } break; default: break; } $document->setTitle( $params->get('page_title') ); $document->setDescription( $params->get('page_description') ); $contents = JComponentHelper::renderComponent($component); $document->setBuffer( $contents, 'component'); } /** * Display the application. * * @access public */ function render() { $document =& JFactory::getDocument(); $user =& JFactory::getUser(); // get the format to render $format = $document->getType(); switch($format) { case 'feed' : { $params = array(); } break; case 'html' : default : { $template = $this->getTemplate(); $file = JRequest::getCmd('tmpl', 'index'); if ($this->getCfg('offline') && $user