Source for file installation.php

Documentation is available at installation.php

  1. <?php
  2. /**
  3.  * @package    Joomla.Installation
  4.  *
  5.  * @copyright  Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  6.  * @license    GNU General Public License version 2 or later; see LICENSE.txt
  7.  */
  8.  
  9. defined('_JEXEC'or die;
  10.  
  11. /**
  12.  * HTML utility class for the installation application
  13.  *
  14.  * @package  Joomla.Installation
  15.  * @since    1.6
  16.  */
  17. {
  18.     /**
  19.      * Method to generate the side bar
  20.      *
  21.      * @return  string  Markup for the side bar
  22.      *
  23.      * @since   1.6
  24.      */
  25.     public static function stepbar()
  26.     {
  27.  
  28.         // Determine if the configuration file path is writable.
  29.         $path JPATH_CONFIGURATION '/configuration.php';
  30.         $useftp (file_exists($path)) !is_writable($path!is_writable(JPATH_CONFIGURATION '/');
  31.  
  32.         $tabs array();
  33.         $tabs['site';
  34.         $tabs['database';
  35.         if ($useftp)
  36.         {
  37.             $tabs['ftp';
  38.         }
  39.         $tabs['summary';
  40.  
  41.         $html array();
  42.         $html['<ul class="nav nav-tabs">';
  43.         foreach ($tabs as $tab)
  44.         {
  45.             $html[static::getTab($tab$tabs);
  46.         }
  47.         $html['</ul>';
  48.         return implode(''$html);
  49.     }
  50.  
  51.     /**
  52.      * Method to generate the side bar
  53.      *
  54.      * @return  string  Markup for the side bar
  55.      *
  56.      * @since   3.1
  57.      */
  58.     public static function stepbarlanguages()
  59.     {
  60.  
  61.         $tabs array();
  62.         $tabs['languages';
  63.         $tabs['defaultlanguage';
  64.         $tabs['complete';
  65.  
  66.         $html array();
  67.         $html['<ul class="nav nav-tabs">';
  68.         foreach ($tabs as $tab)
  69.         {
  70.             $html[static::getTab($tab$tabs);
  71.         }
  72.         $html['</ul>';
  73.  
  74.         return implode(''$html);
  75.     }
  76.  
  77.     /**
  78.      * Method to generate the navigation tab
  79.      *
  80.      * @param   string  $id    The container ID
  81.      * @param   array   $tabs  The navigation tabs
  82.      *
  83.      * @return  string  Markup for the tab
  84.      *
  85.      * @since   3.1
  86.      */
  87.     private static function getTab($id$tabs)
  88.     {
  89.         $input JFactory::getApplication()->input;
  90.         $num   static::getTabNumber($id$tabs);
  91.         $view  static::getTabNumber($input->getWord('view')$tabs);
  92.         $tab   '<span class="badge">' $num '</span> ' JText::_('INSTL_STEP_' strtoupper($id'_LABEL');
  93.  
  94.         if ($view == $num)
  95.         {
  96.             $tab '<a href="#" onclick="Install.submitform();">' $tab '</a>';
  97.         }
  98.         elseif ($view $num)
  99.         {
  100.             $tab '<span>' $tab '</span>';
  101.         }
  102.         else
  103.         {
  104.             $tab '<a href="#" onclick="return Install.goToPage(\'' $id '\')">' $tab '</a>';
  105.         }
  106.  
  107.         return '<li class="step' ($num == $view ' active' '''" id="' $id '">' $tab '</li>';
  108.     }
  109.  
  110.     /**
  111.      * Method to determine the tab (step) number
  112.      *
  113.      * @param   string  $id    The container ID
  114.      * @param   array   $tabs  The navigation tabs
  115.      *
  116.      * @return  integer  Tab number in navigation sequence
  117.      *
  118.      * @since   3.1
  119.      */
  120.     private static function getTabNumber($id$tabs)
  121.     {
  122.         $num = (int) array_search($id$tabs);
  123.         $num++;
  124.  
  125.         return $num;
  126.     }
  127. }

Documentation generated on Tue, 19 Nov 2013 15:05:40 +0100 by phpDocumentor 1.4.3