/administrator/components/com_installer/controller.php

https://bitbucket.org/eternaware/joomus · PHP · 64 lines · 24 code · 10 blank · 30 comment · 1 complexity · 8f8589aa905040dbca4210acee796438 MD5 · raw file

  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. defined('_JEXEC') or die;
  10. /**
  11. * Installer Controller
  12. *
  13. * @package Joomla.Administrator
  14. * @subpackage com_installer
  15. * @since 1.5
  16. */
  17. class InstallerController extends JControllerLegacy
  18. {
  19. /**
  20. * Method to display a view.
  21. *
  22. * @param boolean If true, the view output will be cached
  23. * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  24. *
  25. * @return JController This object to support chaining.
  26. * @since 1.5
  27. */
  28. public function display($cachable = false, $urlparams = false)
  29. {
  30. require_once JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php';
  31. // Get the document object.
  32. $document = JFactory::getDocument();
  33. // Set the default view name and format from the Request.
  34. $vName = $this->input->get('view', 'install');
  35. $vFormat = $document->getType();
  36. $lName = $this->input->get('layout', 'default');
  37. // Get and render the view.
  38. if ($view = $this->getView($vName, $vFormat)) {
  39. $ftp = JClientHelper::setCredentialsFromRequest('ftp');
  40. $view->ftp = &$ftp;
  41. // Get the model for the view.
  42. $model = $this->getModel($vName);
  43. // Push the model into the view (as default).
  44. $view->setModel($model, true);
  45. $view->setLayout($lName);
  46. // Push document object into the view.
  47. $view->document = $document;
  48. // Load the submenu.
  49. InstallerHelper::addSubmenu($vName);
  50. $view->display();
  51. }
  52. return $this;
  53. }
  54. }