[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_workflow/tmpl/stages/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_workflow
   6   *
   7   * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   * @since       4.0.0
  10   */
  11  
  12  defined('_JEXEC') or die;
  13  
  14  use Joomla\CMS\Factory;
  15  use Joomla\CMS\HTML\HTMLHelper;
  16  use Joomla\CMS\Language\Text;
  17  use Joomla\CMS\Layout\LayoutHelper;
  18  use Joomla\CMS\Router\Route;
  19  use Joomla\CMS\Session\Session;
  20  
  21  /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
  22  $wa = $this->document->getWebAssetManager();
  23  $wa->useScript('table.columns')
  24      ->useScript('multiselect');
  25  
  26  $user      = Factory::getUser();
  27  $userId    = $user->id;
  28  
  29  $listOrder = $this->escape($this->state->get('list.ordering'));
  30  $listDirn  = $this->escape($this->state->get('list.direction'));
  31  $saveOrderingUrl = '';
  32  
  33  $saveOrder = ($listOrder == 's.ordering');
  34  
  35  if ($saveOrder) {
  36      $saveOrderingUrl = 'index.php?option=com_workflow&task=stages.saveOrderAjax&workflow_id=' . (int) $this->workflowID . '&extension=' . $this->escape($this->extension) . '&' . Session::getFormToken() . '=1';
  37      HTMLHelper::_('draggablelist.draggable');
  38  }
  39  ?>
  40  <form action="<?php echo Route::_('index.php?option=com_workflow&view=stages&workflow_id=' . (int) $this->workflowID . '&extension=' . $this->extension); ?>" method="post" name="adminForm" id="adminForm">
  41      <div class="row">
  42          <?php if (!empty($this->sidebar)) : ?>
  43              <div id="j-sidebar-container" class="col-md-2">
  44                  <?php echo $this->sidebar; ?>
  45              </div>
  46          <?php endif; ?>
  47          <div class="<?php if (!empty($this->sidebar)) {
  48              echo 'col-md-10';
  49                      } else {
  50                          echo 'col-md-12';
  51                      } ?>">
  52              <div id="j-main-container" class="j-main-container">
  53                  <?php
  54                  // Search tools bar
  55                  echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
  56                  ?>
  57                  <?php if (empty($this->stages)) : ?>
  58                      <div class="alert alert-info">
  59                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  60                          <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  61                      </div>
  62                  <?php else : ?>
  63                      <table class="table">
  64                          <caption class="visually-hidden">
  65                              <?php echo Text::_('COM_WORKFLOW_STAGES_TABLE_CAPTION'); ?>,
  66                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  67                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  68                          </caption>
  69                          <thead>
  70                              <tr>
  71                                  <td class="w-1 text-center d-none d-md-table-cell">
  72                                      <?php echo HTMLHelper::_('grid.checkall'); ?>
  73                                  </td>
  74                                  <th scope="col" class="w-1 text-center d-none d-md-table-cell">
  75                                      <?php echo HTMLHelper::_('searchtools.sort', '', 's.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
  76                                  </th>
  77                                  <th scope="col" class="w-1 text-center">
  78                                      <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 's.published', $listDirn, $listOrder); ?>
  79                                  </th>
  80                                  <th scope="col" class="w-1 text-center">
  81                                      <?php echo Text::_('COM_WORKFLOW_DEFAULT'); ?>
  82                                  </th>
  83                                  <th scope="col">
  84                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_WORKFLOW_NAME', 's.title', $listDirn, $listOrder); ?>
  85                                  </th>
  86                                  <th scope="col" class="w-5 d-none d-md-table-cell">
  87                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_WORKFLOW_ID', 's.id', $listDirn, $listOrder); ?>
  88                                  </th>
  89                              </tr>
  90                          </thead>
  91                          <tbody class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>">
  92                              <?php foreach ($this->stages as $i => $item) :
  93                                  $edit = Route::_('index.php?option=com_workflow&task=stage.edit&id=' . $item->id . '&workflow_id=' . (int) $this->workflowID . '&extension=' . $this->extension);
  94  
  95                                  $canEdit    = $user->authorise('core.edit', $this->extension . '.stage.' . $item->id);
  96                                  $canCheckin = $user->authorise('core.admin', 'com_workflow') || $item->checked_out == $userId || is_null($item->checked_out);
  97                                  $canChange  = $user->authorise('core.edit.state', $this->extension . '.stage.' . $item->id) && $canCheckin;
  98  
  99                                  ?>
 100                                  <tr class="row<?php echo $i % 2; ?>">
 101                                      <td class="text-center d-none d-md-table-cell">
 102                                          <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', Text::_($item->title)); ?>
 103                                      </td>
 104                                      <td class="text-center d-none d-md-table-cell">
 105                                          <?php
 106                                          $iconClass = '';
 107                                          if (!$canChange) {
 108                                              $iconClass = ' inactive';
 109                                          } elseif (!$saveOrder) {
 110                                              $iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
 111                                          }
 112                                          ?>
 113                                          <span class="sortable-handler<?php echo $iconClass ?>">
 114                                              <span class="icon-ellipsis-v" aria-hidden="true"></span>
 115                                          </span>
 116                                          <?php if ($canChange && $saveOrder) : ?>
 117                                              <input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
 118                                          <?php endif; ?>
 119                                      </td>
 120                                      <td class="text-center">
 121                                          <?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'stages.', $canChange); ?>
 122                                      </td>
 123                                      <td class="text-center">
 124                                          <?php echo HTMLHelper::_('jgrid.isdefault', $item->default, $i, 'stages.', $canChange); ?>
 125                                      </td>
 126                                      <th scope="row">
 127                                          <?php if ($item->checked_out) : ?>
 128                                              <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'stages.', $canCheckin); ?>
 129                                          <?php endif; ?>
 130                                          <?php if ($canEdit) : ?>
 131                                              <a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape(Text::_($item->title)); ?>">
 132                                                  <?php echo $this->escape(Text::_($item->title)); ?>
 133                                              </a>
 134                                              <div class="small"><?php echo $this->escape(Text::_($item->description)); ?></div>
 135                                          <?php else : ?>
 136                                              <?php echo $this->escape(Text::_($item->title)); ?>
 137                                              <div class="small"><?php echo $this->escape(Text::_($item->description)); ?></div>
 138                                          <?php endif; ?>
 139                                      </th>
 140                                      <td class="d-none d-md-table-cell">
 141                                          <?php echo (int) $item->id; ?>
 142                                      </td>
 143                                  </tr>
 144                              <?php endforeach ?>
 145                          </tbody>
 146                      </table>
 147                      <?php // load the pagination. ?>
 148                      <?php echo $this->pagination->getListFooter(); ?>
 149  
 150                  <?php endif; ?>
 151                  <input type="hidden" name="task" value="">
 152                  <input type="hidden" name="boxchecked" value="0">
 153                  <input type="hidden" name="workflow_id" value="<?php echo (int) $this->workflowID ?>">
 154                  <input type="hidden" name="extension" value="<?php echo $this->extension ?>">
 155                  <?php echo HTMLHelper::_('form.token'); ?>
 156              </div>
 157          </div>
 158      </div>
 159  </form>


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