Source for file installer.php

Documentation is available at installer.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_installer
  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.  * Installer helper.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_installer
  17.  * @since       1.6
  18.  */
  19. {
  20.     /**
  21.      * Configure the Linkbar.
  22.      *
  23.      * @param   string  $vName  The name of the active view.
  24.      *
  25.      * @return  void 
  26.      */
  27.     public static function addSubmenu($vName 'install')
  28.     {
  29.         JHtmlSidebar::addEntry(
  30.             JText::_('COM_INSTALLER_SUBMENU_INSTALL'),
  31.             'index.php?option=com_installer',
  32.             $vName == 'install'
  33.         );
  34.         JHtmlSidebar::addEntry(
  35.             JText::_('COM_INSTALLER_SUBMENU_UPDATE'),
  36.             'index.php?option=com_installer&view=update',
  37.             $vName == 'update'
  38.         );
  39.         JHtmlSidebar::addEntry(
  40.             JText::_('COM_INSTALLER_SUBMENU_MANAGE'),
  41.             'index.php?option=com_installer&view=manage',
  42.             $vName == 'manage'
  43.         );
  44.         JHtmlSidebar::addEntry(
  45.             JText::_('COM_INSTALLER_SUBMENU_DISCOVER'),
  46.             'index.php?option=com_installer&view=discover',
  47.             $vName == 'discover'
  48.         );
  49.         JHtmlSidebar::addEntry(
  50.             JText::_('COM_INSTALLER_SUBMENU_DATABASE'),
  51.             'index.php?option=com_installer&view=database',
  52.             $vName == 'database'
  53.         );
  54.         JHtmlSidebar::addEntry(
  55.         JText::_('COM_INSTALLER_SUBMENU_WARNINGS'),
  56.                     'index.php?option=com_installer&view=warnings',
  57.         $vName == 'warnings'
  58.         );
  59.         JHtmlSidebar::addEntry(
  60.             JText::_('COM_INSTALLER_SUBMENU_LANGUAGES'),
  61.             'index.php?option=com_installer&view=languages',
  62.             $vName == 'languages'
  63.         );
  64.     }
  65.  
  66.     /**
  67.      * Get a list of filter options for the extension types.
  68.      *
  69.      * @return  array  An array of stdClass objects.
  70.      *
  71.      * @since   3.0
  72.      */
  73.     public static function getExtensionTypes()
  74.     {
  75.         $db    JFactory::getDbo();
  76.         $query $db->getQuery(true)
  77.             ->select('DISTINCT type')
  78.             ->from('#__extensions');
  79.         $db->setQuery($query);
  80.         $types $db->loadColumn();
  81.  
  82.         $options array();
  83.         foreach ($types as $type)
  84.         {
  85.             $options[JHtml::_('select.option'$type'COM_INSTALLER_TYPE_' strtoupper($type));
  86.         }
  87.  
  88.         return $options;
  89.     }
  90.  
  91.     /**
  92.      * Get a list of filter options for the extension types.
  93.      *
  94.      * @return  array  An array of stdClass objects.
  95.      *
  96.      * @since   3.0
  97.      */
  98.     public static function getExtensionGroupes()
  99.     {
  100.         $db JFactory::getDbo();
  101.         $query $db->getQuery(true)
  102.             ->select('DISTINCT folder')
  103.             ->from('#__extensions')
  104.             ->where('folder != ' $db->quote(''))
  105.             ->order('folder');
  106.         $db->setQuery($query);
  107.         $folders $db->loadColumn();
  108.  
  109.         $options array();
  110.         foreach ($folders as $folder)
  111.         {
  112.             $options[JHtml::_('select.option'$folder$folder);
  113.         }
  114.  
  115.         return $options;
  116.     }
  117.  
  118.     /**
  119.      * Gets a list of the actions that can be performed.
  120.      *
  121.      * @return  JObject 
  122.      *
  123.      * @since   1.6
  124.      */
  125.     public static function getActions()
  126.     {
  127.         $user    JFactory::getUser();
  128.         $result    new JObject;
  129.  
  130.         $assetName 'com_installer';
  131.  
  132.         $actions JAccess::getActions($assetName);
  133.  
  134.         foreach ($actions as $action)
  135.         {
  136.             $result->set($action->name,    $user->authorise($action->name$assetName));
  137.         }
  138.  
  139.         return $result;
  140.     }
  141. }

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