Skip to content

Commit

Permalink
stupid ide
Browse files Browse the repository at this point in the history
  • Loading branch information
brianteeman committed Mar 26, 2023
1 parent a1b973c commit 89dd593
Showing 1 changed file with 137 additions and 135 deletions.
272 changes: 137 additions & 135 deletions administrator/components/com_guidedtours/tmpl/steps/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
}
?>

<form action="<?php echo Route::_('index.php?option=com_guidedtours&view=steps&tour_id=' . $tour_id); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_guidedtours&view=steps&tour_id=' . $tour_id); ?>"
method="post" name="adminForm" id="adminForm">
<div id="j-main-container" class="j-main-container">
<?php
// Search tools bar
Expand All @@ -52,7 +53,7 @@

<!-- If no steps -->
<?php if (empty($this->items)) :
?>
?>
<!-- No steps -->
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span>
Expand All @@ -63,7 +64,7 @@

<!-- If there are steps, we start with the table -->
<?php if (!empty($this->items)) :
?>
?>
<!-- Steps table starts here -->
<table class="table" id="stepsList">

Expand All @@ -75,144 +76,145 @@

<!-- Steps table header -->
<thead>
<tr>
<td class="w-1 text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
<!-- Ordering?-->
<th scope="col" class="w-3 text-center d-none d-md-table-cell">
<?php echo HTMLHelper::_(
'searchtools.sort',
'',
'a.ordering',
$listDirn,
$listOrder,
null,
'asc',
'JGRID_HEADING_ORDERING',
'icon-sort'
); ?>
</th>
<th scope="col" class="w-1 text-center">
<?php echo HTMLHelper::_(
'searchtools.sort',
'COM_GUIDEDTOURS_STATUS',
'a.published',
$listDirn,
$listOrder
); ?>
</th>
<th scope="col">
<?php echo Text::_('COM_GUIDEDTOURS_STEP_TITLE'); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo Text::_('COM_GUIDEDTOURS_DESCRIPTION'); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo HTMLHelper::_(
'searchtools.sort',
'COM_GUIDEDTOURS_STEP_TYPE',
'a.type',
$listDirn,
$listOrder
); ?>
</th>

<th scope="col" class="w-10 text-center d-none d-md-table-cell">
<?php echo HTMLHelper::_(
'searchtools.sort',
'COM_GUIDEDTOURS_STEP_ID',
'a.id',
$listDirn,
$listOrder
); ?>
</th>
</tr>
<tr>
<td class="w-1 text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
<!-- Ordering?-->
<th scope="col" class="w-3 text-center d-none d-md-table-cell">
<?php echo HTMLHelper::_(
'searchtools.sort',
'',
'a.ordering',
$listDirn,
$listOrder,
null,
'asc',
'JGRID_HEADING_ORDERING',
'icon-sort'
); ?>
</th>
<th scope="col" class="w-1 text-center">
<?php echo HTMLHelper::_(
'searchtools.sort',
'COM_GUIDEDTOURS_STATUS',
'a.published',
$listDirn,
$listOrder
); ?>
</th>
<th scope="col">
<?php echo Text::_('COM_GUIDEDTOURS_STEP_TITLE'); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo Text::_('COM_GUIDEDTOURS_DESCRIPTION'); ?>
</th>
<th scope="col" class="d-none d-md-table-cell">
<?php echo HTMLHelper::_(
'searchtools.sort',
'COM_GUIDEDTOURS_STEP_TYPE',
'a.type',
$listDirn,
$listOrder
); ?>
</th>

<th scope="col" class="w-10 text-center d-none d-md-table-cell">
<?php echo HTMLHelper::_(
'searchtools.sort',
'COM_GUIDEDTOURS_STEP_ID',
'a.id',
$listDirn,
$listOrder
); ?>
</th>
</tr>
</thead>

<!-- Table body begins -->
<tbody <?php if ($saveOrder) : ?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>" data-nested="true" <?php
endif; ?>>
<?php foreach ($this->items as $i => $item) :
$canEdit = $user->authorise('core.edit', 'com_guidedtours' . '.step.' . $item->id);
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out);
$canChange = $user->authorise('core.edit.state', 'com_guidedtours' . '.step.' . $item->id) && $canCheckin;
<tbody <?php if ($saveOrder) : ?>
class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>" data-nested="true" <?php
endif; ?>>
<?php foreach ($this->items as $i => $item) :
$canEdit = $user->authorise('core.edit', 'com_guidedtours' . '.step.' . $item->id);
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out);
$canChange = $user->authorise('core.edit.state', 'com_guidedtours' . '.step.' . $item->id) && $canCheckin;
?>

<!-- Row begins -->
<tr class="row<?php echo $i % 2; ?>" data-draggable-group="none">
<!-- Item Checkbox -->
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?>
</td>

<!-- Draggable handle -->
<td class="text-center d-none d-md-table-cell">
<?php
$iconClass = '';

if (!$canChange) {
$iconClass = ' inactive';
} elseif (!$saveOrder) {
$iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
}
?>

<span class="sortable-handler <?php echo $iconClass; ?>">
<span class="icon-ellipsis-v" aria-hidden="true"></span>
</span>

<?php if ($canChange && $saveOrder) : ?>
<input type="text" class="hidden text-area-order" name="order[]" size="5" value="<?php echo $item->ordering; ?>">
<!-- Row begins -->
<tr class="row<?php echo $i % 2; ?>" data-draggable-group="none">
<!-- Item Checkbox -->
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?>
</td>

<!-- Draggable handle -->
<td class="text-center d-none d-md-table-cell">
<?php
$iconClass = '';

if (!$canChange) {
$iconClass = ' inactive';
} elseif (!$saveOrder) {
$iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
}
?>

<span class="sortable-handler <?php echo $iconClass; ?>">
<span class="icon-ellipsis-v" aria-hidden="true"></span>
</span>

<?php if ($canChange && $saveOrder) : ?>
<input type="text" class="hidden text-area-order" name="order[]" size="5" value="<?php echo $item->ordering; ?>">
<?php endif; ?>
</td>

<!-- Step State -->
<td class="text-center">
<?php echo HTMLHelper::_(
'jgrid.published',
$item->published,
$i,
'steps.',
$canChange
); ?>
</td>

<!-- Step name, edit link, and note -->
<th scope="row">
<div>
<?php if ($item->checked_out) : ?>
<?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'steps.', $canCheckin); ?>
<?php endif; ?>
</td>

<!-- Step State -->
<td class="text-center">
<?php echo HTMLHelper::_(
'jgrid.published',
$item->published,
$i,
'steps.',
$canChange
); ?>
</td>

<!-- Step name, edit link, and note -->
<th scope="row">
<div>
<?php if ($item->checked_out) : ?>
<?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'steps.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<a href="<?php echo Route::_('index.php?option=com_guidedtours&task=step.edit&id=' . $item->id); ?> " title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>">
<?php echo $this->escape($item->title); ?>
</a>
<?php else : ?>
<?php if ($canEdit) : ?>
<a href="<?php echo Route::_('index.php?option=com_guidedtours&task=step.edit&id=' . $item->id); ?> " title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->title); ?>">
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<?php if ($item->note) : ?>
<div class="small break-word">
<?php echo Text::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note)); ?>
</div>
<?php endif; ?>
</div>
</th>
<td class="d-none d-md-table-cell">
<?php echo StringHelper::truncate($item->description, 200, true, false); ?>
</td>

<!-- Step Type -->
<td class="d-none d-md-table-cell">
<?php echo Text::_(GuidedtoursComponent::STEP_TYPE_NAMES[$item->type]) ?>
</td>

<!-- Step ID -->
<td class="d-none d-md-table-cell text-center">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<?php if ($item->note) : ?>
<div class="small break-word">
<?php echo Text::sprintf('JGLOBAL_LIST_NOTE', $this->escape($item->note)); ?>
</div>
<?php endif; ?>
</div>
</th>
<td class="d-none d-md-table-cell">
<?php echo StringHelper::truncate($item->description, 200, true, false); ?>
</td>

<!-- Step Type -->
<td class="d-none d-md-table-cell">
<?php echo Text::_(GuidedtoursComponent::STEP_TYPE_NAMES[$item->type]) ?>
</td>

<!-- Step ID -->
<td class="d-none d-md-table-cell text-center">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

Expand All @@ -226,4 +228,4 @@
<input type="hidden" name="boxchecked" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</form>
</form>

0 comments on commit 89dd593

Please sign in to comment.