Source for file default.php

Documentation is available at default.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Installation
  4.  * @subpackage  Controller
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Default controller class for the Joomla Installer.
  14.  *
  15.  * @package     Joomla.Installation
  16.  * @subpackage  Controller
  17.  * @since       3.1
  18.  */
  19. {
  20.     /**
  21.      * Execute the controller.
  22.      *
  23.      * @return  string  The rendered view.
  24.      *
  25.      * @since   3.1
  26.      */
  27.     public function execute()
  28.     {
  29.         // Get the application
  30.         /* @var InstallationApplicationWeb $app */
  31.         $app $this->getApplication();
  32.  
  33.         // Get the document object.
  34.         $document $app->getDocument();
  35.  
  36.         // Set the default view name and format from the request.
  37.         if (file_exists(JPATH_CONFIGURATION '/configuration.php'&& (filesize(JPATH_CONFIGURATION '/configuration.php'10)
  38.             && file_exists(JPATH_INSTALLATION '/index.php'))
  39.         {
  40.             $default_view 'remove';
  41.         }
  42.         else
  43.         {
  44.             $default_view 'site';
  45.         }
  46.  
  47.         $vName   $this->input->getWord('view'$default_view);
  48.         $vFormat $document->getType();
  49.         $lName   $this->input->getWord('layout''default');
  50.  
  51.         if (strcmp($vName$default_view== 0)
  52.         {
  53.             $this->input->set('view'$default_view);
  54.         }
  55.  
  56.         switch ($vName)
  57.         {
  58.             case 'preinstall':
  59.                 $model        new InstallationModelSetup;
  60.                 $sufficient   $model->getPhpOptionsSufficient();
  61.                 $checkOptions false;
  62.                 $options $model->getOptions();
  63.  
  64.                 if ($sufficient)
  65.                 {
  66.                     $app->redirect('index.php');
  67.                 }
  68.  
  69.                 break;
  70.  
  71.             case 'languages':
  72.             case 'defaultlanguage':
  73.                 $model new InstallationModelLanguages;
  74.                 $checkOptions false;
  75.                 $options array();
  76.                 break;
  77.  
  78.             default:
  79.                 $model        new InstallationModelSetup;
  80.                 $sufficient   $model->getPhpOptionsSufficient();
  81.                 $checkOptions true;
  82.                 $options $model->getOptions();
  83.  
  84.                 if (!$sufficient)
  85.                 {
  86.                     $app->redirect('index.php?view=preinstall');
  87.                 }
  88.  
  89.                 break;
  90.         }
  91.  
  92.         if ($vName != $default_view && ($checkOptions && empty($options)))
  93.         {
  94.             $this->setRedirect('index.php');
  95.         }
  96.  
  97.         // Include the component HTML helpers.
  98.         JHtml::addIncludePath(JPATH_COMPONENT '/helper/html');
  99.  
  100.         // Register the layout paths for the view
  101.         $paths new SplPriorityQueue;
  102.         $paths->insert(JPATH_INSTALLATION '/view/' $vName '/tmpl''normal');
  103.  
  104.         $vClass 'InstallationView' ucfirst($vNameucfirst($vFormat);
  105.  
  106.         if (!class_exists($vClass))
  107.         {
  108.             $vClass 'InstallationViewDefault';
  109.         }
  110.  
  111.         /* @var JViewHtml $view */
  112.         $view new $vClass($model$paths);
  113.         $view->setLayout($lName);
  114.  
  115.         // Render our view and return it to the application.
  116.         return $view->render();
  117.     }
  118. }

Documentation generated on Tue, 19 Nov 2013 14:59:27 +0100 by phpDocumentor 1.4.3