[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_menus/tmpl/item/ -> edit_modules.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_menus
   6   *
   7   * @copyright   (C) 2009 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\HTML\HTMLHelper;
  14  use Joomla\CMS\Language\Text;
  15  use Joomla\CMS\Layout\LayoutHelper;
  16  
  17  foreach ($this->levels as $key => $value) {
  18      $allLevels[$value->id] = $value->title;
  19  }
  20  
  21  $this->document->addScriptOptions('menus-edit-modules', ['viewLevels' => $allLevels, 'itemId' => $this->item->id]);
  22  
  23  /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
  24  $wa = $this->document->getWebAssetManager();
  25  $wa->useStyle('com_menus.admin-item-edit-modules')
  26      ->useScript('com_menus.admin-item-edit-modules');
  27  
  28  // Set up the bootstrap modal that will be used for all module editors
  29  echo HTMLHelper::_(
  30      'bootstrap.renderModal',
  31      'moduleEditModal',
  32      array(
  33          'title'       => Text::_('COM_MENUS_EDIT_MODULE_SETTINGS'),
  34          'backdrop'    => 'static',
  35          'keyboard'    => false,
  36          'closeButton' => false,
  37          'bodyHeight'  => '70',
  38          'modalWidth'  => '80',
  39          'footer'      => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-bs-target="#closeBtn">'
  40                  . Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
  41                  . '<button type="button" class="btn btn-primary" data-bs-dismiss="modal" data-bs-target="#saveBtn">'
  42                  . Text::_('JSAVE') . '</button>'
  43                  . '<button type="button" class="btn btn-success" data-bs-target="#applyBtn">'
  44                  . Text::_('JAPPLY') . '</button>',
  45      )
  46  );
  47  
  48  ?>
  49  <?php
  50  // Set main fields.
  51  $this->fields = array('toggle_modules_assigned','toggle_modules_published');
  52  
  53  echo LayoutHelper::render('joomla.menu.edit_modules', $this); ?>
  54  
  55  <table class="table" id="modules_assigned">
  56      <caption class="visually-hidden">
  57          <?php echo Text::_('COM_MENUS_MODULES_TABLE_CAPTION'); ?>
  58      </caption>
  59      <thead>
  60          <tr>
  61              <th scope="col" class="w-40">
  62                  <?php echo Text::_('COM_MENUS_HEADING_ASSIGN_MODULE'); ?>
  63              </th>
  64              <th scope="col" class="w-15">
  65                  <?php echo Text::_('COM_MENUS_HEADING_LEVELS'); ?>
  66              </th>
  67              <th scope="col" class="w-15">
  68                  <?php echo Text::_('COM_MENUS_HEADING_POSITION'); ?>
  69              </th>
  70              <th scope="col">
  71                  <?php echo Text::_('COM_MENUS_HEADING_DISPLAY'); ?>
  72              </th>
  73              <th scope="col">
  74                  <?php echo Text::_('COM_MENUS_HEADING_PUBLISHED_ITEMS'); ?>
  75              </th>
  76          </tr>
  77      </thead>
  78      <tbody>
  79      <?php foreach ($this->modules as $i => &$module) : ?>
  80          <?php if (is_null($module->menuid)) : ?>
  81              <?php if (!$module->except || $module->menuid < 0) : ?>
  82                  <?php $no = 'no '; ?>
  83              <?php else : ?>
  84                  <?php $no = ''; ?>
  85              <?php endif; ?>
  86          <?php else : ?>
  87              <?php $no = ''; ?>
  88          <?php endif; ?>
  89          <?php if ($module->published) : ?>
  90              <?php $status = ''; ?>
  91          <?php else : ?>
  92              <?php $status = 'unpublished '; ?>
  93          <?php endif; ?>
  94          <tr id="tr-<?php echo $module->id; ?>" class="<?php echo $no; ?><?php echo $status; ?>row<?php echo $i % 2; ?>">
  95              <th scope="row">
  96                  <button type="button"
  97                      data-bs-target="#moduleEditModal"
  98                      class="btn btn-link module-edit-link"
  99                      title="<?php echo Text::_('COM_MENUS_EDIT_MODULE_SETTINGS'); ?>"
 100                      id="title-<?php echo $module->id; ?>"
 101                      data-module-id="<?php echo $module->id; ?>">
 102                      <?php echo $this->escape($module->title); ?></button>
 103              </th>
 104              <td id="access-<?php echo $module->id; ?>">
 105                  <?php echo $this->escape($module->access_title); ?>
 106              </td>
 107              <td id="position-<?php echo $module->id; ?>">
 108                  <?php echo $this->escape($module->position); ?>
 109              </td>
 110              <td id="menus-<?php echo $module->id; ?>">
 111                  <?php if (is_null($module->menuid)) : ?>
 112                      <?php if ($module->except) : ?>
 113                          <span class="badge bg-success">
 114                              <?php echo Text::_('JYES'); ?>
 115                          </span>
 116                      <?php else : ?>
 117                          <span class="badge bg-danger">
 118                              <?php echo Text::_('JNO'); ?>
 119                          </span>
 120                      <?php endif; ?>
 121                  <?php elseif ($module->menuid > 0) : ?>
 122                      <span class="badge bg-success">
 123                          <?php echo Text::_('JYES'); ?>
 124                      </span>
 125                  <?php elseif ($module->menuid < 0) : ?>
 126                      <span class="badge bg-danger">
 127                          <?php echo Text::_('JNO'); ?>
 128                      </span>
 129                  <?php else : ?>
 130                      <span class="badge bg-info">
 131                          <?php echo Text::_('JALL'); ?>
 132                      </span>
 133                  <?php endif; ?>
 134              </td>
 135              <td id="status-<?php echo $module->id; ?>">
 136                  <?php if ($module->published) : ?>
 137                      <span class="badge bg-success">
 138                          <?php echo Text::_('JYES'); ?>
 139                      </span>
 140                  <?php else : ?>
 141                      <span class="badge bg-danger">
 142                          <?php echo Text::_('JNO'); ?>
 143                      </span>
 144                  <?php endif; ?>
 145              </td>
 146          </tr>
 147      <?php endforeach; ?>
 148      </tbody>
 149  </table>


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