Example #1
0
 /**
  * Render the application
  *
  * @return	void
  */
 public function render()
 {
     $document =& JFactory::getDocument();
     $config =& JFactory::getConfig();
     $user =& JFactory::getUser();
     switch ($document->getType()) {
         case 'html':
             // Set metadata
             $document->setTitle(JText::_('PAGE_TITLE'));
             break;
         default:
             break;
     }
     // Define component path
     define('JPATH_COMPONENT', JPATH_BASE);
     define('JPATH_COMPONENT_SITE', JPATH_SITE);
     define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR);
     // Start the output buffer.
     ob_start();
     // Import the controller.
     require_once JPATH_COMPONENT . '/controller.php';
     // Execute the task.
     $controller =& JInstallationController::getInstance();
     $controller->execute(JRequest::getVar('task'));
     $controller->redirect();
     // Get output from the buffer and clean it.
     $contents = ob_get_contents();
     ob_end_clean();
     $params = array('template' => 'template', 'file' => 'index.php', 'directory' => JPATH_THEMES, 'params' => '{}');
     $document->setBuffer($contents, 'installation');
     $document->setTitle(JText::_('PAGE_TITLE'));
     $data = $document->render(false, $params);
     JResponse::setBody($data);
 }