[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_menus/tmpl/menutypes/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_menus
   6   *
   7   * @copyright   (C) 2011 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\HTML\HTMLHelper;
  15  use Joomla\CMS\Language\Text;
  16  
  17  $input = Factory::getApplication()->input;
  18  
  19  // Checking if loaded via index.php or component.php
  20  $tmpl = ($input->getCmd('tmpl') != '') ? '1' : '';
  21  $tmpl = json_encode($tmpl, JSON_NUMERIC_CHECK);
  22  
  23  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  24  $wa = $this->document->getWebAssetManager();
  25  $wa->useScript('com_menus.admin-item-modal');
  26  
  27  ?>
  28  <?php echo HTMLHelper::_('bootstrap.startAccordion', 'collapseTypes', array('active' => 'slide1')); ?>
  29      <?php $i = 0; ?>
  30      <?php foreach ($this->types as $name => $list) : ?>
  31          <?php echo HTMLHelper::_('bootstrap.addSlide', 'collapseTypes', $name, 'collapse' . ($i++)); ?>
  32              <div class="list-group">
  33                  <?php foreach ($list as $title => $item) : ?>
  34                      <?php $menutype = array('id' => $this->recordId, 'title' => $item->type ?? $item->title, 'request' => $item->request); ?>
  35                      <?php $menutype = base64_encode(json_encode($menutype)); ?>
  36                      <a class="choose_type list-group-item list-group-item-action" href="#"
  37                          onclick="Joomla.setMenuType('<?php echo $menutype; ?>', '<?php echo $tmpl; ?>')">
  38                          <div class="pe-2">
  39                              <?php echo $title; ?>
  40                          </div>
  41                          <small class="text-muted">
  42                              <?php echo Text::_($item->description); ?>
  43                          </small>
  44                      </a>
  45                  <?php endforeach; ?>
  46              </div>
  47          <?php echo HTMLHelper::_('bootstrap.endSlide'); ?>
  48      <?php endforeach; ?>
  49  <?php echo HTMLHelper::_('bootstrap.endSlide'); ?>
  50  <?php echo HTMLHelper::_('bootstrap.endAccordion');


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