[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_config/tmpl/component/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_config
   6   *
   7   * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Factory;
  14  use Joomla\CMS\Form\FormHelper;
  15  use Joomla\CMS\HTML\HTMLHelper;
  16  use Joomla\CMS\Language\Text;
  17  use Joomla\CMS\Router\Route;
  18  
  19  $app = Factory::getApplication();
  20  $template = $app->getTemplate();
  21  
  22  Text::script('ERROR');
  23  Text::script('WARNING');
  24  Text::script('NOTICE');
  25  Text::script('MESSAGE');
  26  
  27  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  28  $wa = $this->document->getWebAssetManager();
  29  $wa->useScript('form.validate')
  30      ->useScript('keepalive');
  31  
  32  if ($this->fieldsets) {
  33      HTMLHelper::_('bootstrap.framework');
  34  }
  35  
  36  $xml = $this->form->getXml();
  37  ?>
  38  
  39  <form action="<?php echo Route::_('index.php?option=com_config'); ?>" id="component-form" method="post" class="form-validate main-card" name="adminForm" autocomplete="off">
  40      <div class="row main-card-columns">
  41          <?php // Begin Sidebar ?>
  42          <div class="col-md-3" id="sidebar">
  43              <button class="btn btn-sm btn-secondary my-2 options-menu d-md-none" type="button" data-bs-toggle="collapse" data-bs-target=".sidebar-nav" aria-controls="sidebar-nav" aria-expanded="false">
  44                   <span class="icon-align-justify" aria-hidden="true"></span>
  45                   <?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>
  46              </button>
  47              <div id="sidebar-nav" class="sidebar-nav">
  48                  <?php echo $this->loadTemplate('navigation'); ?>
  49              </div>
  50          </div>
  51          <?php // End Sidebar ?>
  52  
  53          <div class="col-md-9" id="config">
  54              <?php if ($this->fieldsets) : ?>
  55                  <?php $opentab = 0; ?>
  56  
  57                  <?php echo HTMLHelper::_('uitab.startTabSet', 'configTabs', ['recall' => true, 'breakpoint' => 768]); ?>
  58  
  59                  <?php foreach ($this->fieldsets as $name => $fieldSet) : ?>
  60                      <?php
  61                      $hasChildren = $xml->xpath('//fieldset[@name="' . $name . '"]/fieldset');
  62                      $hasParent = $xml->xpath('//fieldset/fieldset[@name="' . $name . '"]');
  63                      $isGrandchild = $xml->xpath('//fieldset/fieldset/fieldset[@name="' . $name . '"]');
  64                      ?>
  65  
  66                      <?php $dataShowOn = ''; ?>
  67                      <?php if (!empty($fieldSet->showon)) : ?>
  68                          <?php $wa->useScript('showon'); ?>
  69                          <?php $dataShowOn = ' data-showon=\'' . json_encode(FormHelper::parseShowOnConditions($fieldSet->showon, $this->formControl)) . '\''; ?>
  70                      <?php endif; ?>
  71  
  72                      <?php $label = empty($fieldSet->label) ? 'COM_CONFIG_' . $name . '_FIELDSET_LABEL' : $fieldSet->label; ?>
  73  
  74                      <?php if (!$isGrandchild && $hasParent) : ?>
  75                          <fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form">
  76                              <legend><?php echo Text::_($fieldSet->label); ?></legend>
  77                              <div class="form-grid">
  78                      <?php elseif (!$hasParent) : ?>
  79                          <?php if ($opentab) : ?>
  80                              <?php if ($opentab > 1) : ?>
  81                                  </div>
  82                                  </fieldset>
  83                              <?php endif; ?>
  84  
  85                              <?php echo HTMLHelper::_('uitab.endTab'); ?>
  86  
  87                          <?php endif; ?>
  88  
  89                          <?php echo HTMLHelper::_('uitab.addTab', 'configTabs', $name, Text::_($label)); ?>
  90  
  91                          <?php $opentab = 1; ?>
  92  
  93                          <?php if (!$hasChildren) : ?>
  94                          <fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form">
  95                              <legend><?php echo Text::_($fieldSet->label); ?></legend>
  96                              <div class="form-grid">
  97                              <?php $opentab = 2; ?>
  98                          <?php endif; ?>
  99                      <?php endif; ?>
 100  
 101                      <?php if (!empty($fieldSet->description)) : ?>
 102                          <div class="tab-description alert alert-info">
 103                              <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
 104                              <?php echo Text::_($fieldSet->description); ?>
 105                          </div>
 106                      <?php endif; ?>
 107  
 108                      <?php if (!$hasChildren) : ?>
 109                          <?php echo $this->form->renderFieldset($name, $name === 'permissions' ? ['hiddenLabel' => true, 'class' => 'revert-controls'] : []); ?>
 110                      <?php endif; ?>
 111  
 112                      <?php if (!$isGrandchild && $hasParent) : ?>
 113                          </div>
 114                      </fieldset>
 115                      <?php endif; ?>
 116                  <?php endforeach; ?>
 117  
 118                  <?php if ($opentab) : ?>
 119                      <?php if ($opentab > 1) : ?>
 120                          </div>
 121                          </fieldset>
 122                      <?php endif; ?>
 123                      <?php echo HTMLHelper::_('uitab.endTab'); ?>
 124                  <?php endif; ?>
 125  
 126                  <?php echo HTMLHelper::_('uitab.endTabSet'); ?>
 127  
 128              <?php else : ?>
 129                  <div class="alert alert-info">
 130                      <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
 131                      <?php echo Text::_('COM_CONFIG_COMPONENT_NO_CONFIG_FIELDS_MESSAGE'); ?>
 132                  </div>
 133              <?php endif; ?>
 134          </div>
 135  
 136          <input type="hidden" name="id" value="<?php echo $this->component->id; ?>">
 137          <input type="hidden" name="component" value="<?php echo $this->component->option; ?>">
 138          <input type="hidden" name="return" value="<?php echo $this->return; ?>">
 139          <input type="hidden" name="task" value="">
 140          <?php echo HTMLHelper::_('form.token'); ?>
 141      </div>
 142  </form>


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