/administrator/components/com_installer/controller.php
PHP | 64 lines | 24 code | 10 blank | 30 comment | 1 complexity | 8f8589aa905040dbca4210acee796438 MD5 | raw file
Possible License(s): LGPL-2.1
1<?php 2/** 3 * @package Joomla.Administrator 4 * @subpackage com_installer 5 * 6 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 7 * @license GNU General Public License version 2 or later; see LICENSE.txt 8 */ 9 10defined('_JEXEC') or die; 11 12/** 13 * Installer Controller 14 * 15 * @package Joomla.Administrator 16 * @subpackage com_installer 17 * @since 1.5 18 */ 19class InstallerController extends JControllerLegacy 20{ 21 /** 22 * Method to display a view. 23 * 24 * @param boolean If true, the view output will be cached 25 * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. 26 * 27 * @return JController This object to support chaining. 28 * @since 1.5 29 */ 30 public function display($cachable = false, $urlparams = false) 31 { 32 require_once JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php'; 33 34 // Get the document object. 35 $document = JFactory::getDocument(); 36 37 // Set the default view name and format from the Request. 38 $vName = $this->input->get('view', 'install'); 39 $vFormat = $document->getType(); 40 $lName = $this->input->get('layout', 'default'); 41 42 // Get and render the view. 43 if ($view = $this->getView($vName, $vFormat)) { 44 $ftp = JClientHelper::setCredentialsFromRequest('ftp'); 45 $view->ftp = &$ftp; 46 47 // Get the model for the view. 48 $model = $this->getModel($vName); 49 50 // Push the model into the view (as default). 51 $view->setModel($model, true); 52 $view->setLayout($lName); 53 54 // Push document object into the view. 55 $view->document = $document; 56 57 // Load the submenu. 58 InstallerHelper::addSubmenu($vName); 59 $view->display(); 60 } 61 62 return $this; 63 } 64}