[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_installer/src/Service/HTML/ -> Manage.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_installer
   6   *
   7   * @copyright   (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Installer\Administrator\Service\HTML;
  12  
  13  use Joomla\CMS\HTML\HTMLHelper;
  14  
  15  // phpcs:disable PSR1.Files.SideEffects
  16  \defined('_JEXEC') or die;
  17  // phpcs:enable PSR1.Files.SideEffects
  18  
  19  /**
  20   * Installer HTML class.
  21   *
  22   * @since  2.5
  23   */
  24  class Manage
  25  {
  26      /**
  27       * Returns a published state on a grid.
  28       *
  29       * @param   integer  $value     The state value.
  30       * @param   integer  $i         The row index.
  31       * @param   boolean  $enabled   An optional setting for access control on the action.
  32       * @param   string   $checkbox  An optional prefix for checkboxes.
  33       *
  34       * @return  string        The Html code
  35       *
  36       * @see JHtmlJGrid::state
  37       *
  38       * @since   2.5
  39       */
  40      public function state($value, $i, $enabled = true, $checkbox = 'cb')
  41      {
  42          $states = array(
  43              2 => array(
  44                  '',
  45                  'COM_INSTALLER_EXTENSION_PROTECTED',
  46                  '',
  47                  'COM_INSTALLER_EXTENSION_PROTECTED',
  48                  true,
  49                  'protected',
  50                  'protected',
  51              ),
  52              1 => array(
  53                  'unpublish',
  54                  'COM_INSTALLER_EXTENSION_ENABLED',
  55                  'COM_INSTALLER_EXTENSION_DISABLE',
  56                  'COM_INSTALLER_EXTENSION_ENABLED',
  57                  true,
  58                  'publish',
  59                  'publish',
  60              ),
  61              0 => array(
  62                  'publish',
  63                  'COM_INSTALLER_EXTENSION_DISABLED',
  64                  'COM_INSTALLER_EXTENSION_ENABLE',
  65                  'COM_INSTALLER_EXTENSION_DISABLED',
  66                  true,
  67                  'unpublish',
  68                  'unpublish',
  69              ),
  70          );
  71  
  72          return HTMLHelper::_('jgrid.state', $states, $value, $i, 'manage.', $enabled, true, $checkbox);
  73      }
  74  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer