Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,5 @@ protected function addToolbar()

ToolbarHelper::cancel('association.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::help('JHELP_COMPONENTS_ASSOCIATIONS_EDIT');

\JHtmlSidebar::setAction('index.php?option=com_associations');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ public function display($tpl = null)

$this->addToolbar();

// Will add sidebar if needed $this->sidebar = \JHtmlSidebar::render();
parent::display($tpl);
}

Expand Down
237 changes: 117 additions & 120 deletions administrator/components/com_associations/tmpl/associations/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,128 +44,125 @@
<form action="<?php echo Route::_('index.php?option=com_associations&view=associations&layout=modal&tmpl=component&function='
. $function . '&' . Session::getFormToken() . '=1'); ?>" method="post" name="adminForm" id="adminForm">

<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="col-md-2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="col-md-10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table" id="associationsList">
<caption id="captionTable" class="sr-only">
?php echo Text::_('COM_ASSOCIATIONS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
</caption>
<thead>
<tr>
<?php if (!empty($this->typeSupports['state'])) : ?>
<th scope="col" style="width:1%" class="center">
<?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'state', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<th scope="col">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'title', $listDirn, $listOrder); ?>
</th>
<th scope="col" style="width:15%">
<?php echo Text::_('JGRID_HEADING_LANGUAGE'); ?>
</th>
<th scope="col" style="width:5%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?>
</th>
<?php if (!empty($this->typeFields['menutype'])) : ?>
<th scope="col" style="width:10%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_MENUTYPE', 'menutype_title', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if (!empty($this->typeSupports['acl'])) : ?>
<th scope="col" style="width:5%" class="d-none d-sm-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<th scope="col" style="width:1%" class="d-none d-sm-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $item) :
$canEdit = AssociationsHelper::allowEdit($this->extensionName, $this->typeName, $item->id);
$canCheckin = $canManageCheckin || AssociationsHelper::canCheckinItem($this->extensionName, $this->typeName, $item->id);
$isCheckout = AssociationsHelper::isCheckoutItem($this->extensionName, $this->typeName, $item->id);
?>
<tr class="row<?php echo $i % 2; ?>">
<?php if (!empty($this->typeSupports['state'])) : ?>
<td class="center">
<span class="<?php echo $iconStates[$this->escape($item->state)]; ?>" aria-hidden="true"></span>
</td>
<?php endif; ?>
<th scope="row" class="has-context">
<?php if (isset($item->level)) : ?>
<?php echo LayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level)); ?>
<?php endif; ?>
<?php if (($canEdit && !$isCheckout) || ($canEdit && $canCheckin && $isCheckout)) : ?>
<a class="select-link" href="javascript:void(0);" data-id="<?php echo $item->id; ?>">
<?php echo $this->escape($item->title); ?></a>
<?php elseif ($canEdit && $isCheckout) : ?>
<?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'associations.'); ?>
<span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>">
<?php echo $this->escape($item->title); ?></span>
<?php else : ?>
<span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>">
<?php echo $this->escape($item->title); ?></span>
<?php endif; ?>
<?php if (!empty($this->typeFields['alias'])) : ?>
<span class="small">
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
</span>
<?php endif; ?>
<?php if (!empty($this->typeFields['catid'])) : ?>
<div class="small">
<?php echo Text::_('JCATEGORY') . ": " . $this->escape($item->category_title); ?>
</div>
<?php endif; ?>
</th>
<td class="small">
<?php echo LayoutHelper::render('joomla.content.language', $item); ?>
</td>
<td>
<?php if (true || $item->association) : ?>
<?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, false, false); ?>
<?php endif; ?>
</td>
<?php if (!empty($this->typeFields['menutype'])) : ?>
<td class="small">
<?php echo $this->escape($item->menutype_title); ?>
</td>
<?php endif; ?>
<?php if (!empty($this->typeSupports['acl'])) : ?>
<td class="small d-none d-sm-table-cell">
<?php echo $this->escape($item->access_level); ?>
</td>
<?php endif; ?>
<td class="d-none d-sm-table-cell">
<?php echo $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="row">
<div class="col-md-12">
<div id="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table" id="associationsList">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_ASSOCIATIONS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
</caption>
<thead>
<tr>
<?php if (!empty($this->typeSupports['state'])) : ?>
<th scope="col" style="width:1%" class="center">
<?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'state', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<th scope="col">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'title', $listDirn, $listOrder); ?>
</th>
<th scope="col" style="width:15%">
<?php echo Text::_('JGRID_HEADING_LANGUAGE'); ?>
</th>
<th scope="col" style="width:5%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?>
</th>
<?php if (!empty($this->typeFields['menutype'])) : ?>
<th scope="col" style="width:10%">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_ASSOCIATIONS_HEADING_MENUTYPE', 'menutype_title', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if (!empty($this->typeSupports['acl'])) : ?>
<th scope="col" style="width:5%" class="d-none d-sm-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<th scope="col" style="width:1%" class="d-none d-sm-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $item) :
$canEdit = AssociationsHelper::allowEdit($this->extensionName, $this->typeName, $item->id);
$canCheckin = $canManageCheckin || AssociationsHelper::canCheckinItem($this->extensionName, $this->typeName, $item->id);
$isCheckout = AssociationsHelper::isCheckoutItem($this->extensionName, $this->typeName, $item->id);
?>
<tr class="row<?php echo $i % 2; ?>">
<?php if (!empty($this->typeSupports['state'])) : ?>
<td class="center">
<span class="<?php echo $iconStates[$this->escape($item->state)]; ?>" aria-hidden="true"></span>
</td>
<?php endif; ?>
<th scope="row" class="has-context">
<?php if (isset($item->level)) : ?>
<?php echo LayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level)); ?>
<?php endif; ?>
<?php if (($canEdit && !$isCheckout) || ($canEdit && $canCheckin && $isCheckout)) : ?>
<a class="select-link" href="javascript:void(0);" data-id="<?php echo $item->id; ?>">
<?php echo $this->escape($item->title); ?></a>
<?php elseif ($canEdit && $isCheckout) : ?>
<?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'associations.'); ?>
<span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>">
<?php echo $this->escape($item->title); ?></span>
<?php else : ?>
<span title="<?php echo Text::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>">
<?php echo $this->escape($item->title); ?></span>
<?php endif; ?>
<?php if (!empty($this->typeFields['alias'])) : ?>
<span class="small">
<?php echo Text::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
</span>
<?php endif; ?>
<?php if (!empty($this->typeFields['catid'])) : ?>
<div class="small">
<?php echo Text::_('JCATEGORY') . ": " . $this->escape($item->category_title); ?>
</div>
<?php endif; ?>
</th>
<td class="small">
<?php echo LayoutHelper::render('joomla.content.language', $item); ?>
</td>
<td>
<?php if (true || $item->association) : ?>
<?php echo AssociationsHelper::getAssociationHtmlList($this->extensionName, $this->typeName, (int) $item->id, $item->language, false, false); ?>
<?php endif; ?>
</td>
<?php if (!empty($this->typeFields['menutype'])) : ?>
<td class="small">
<?php echo $this->escape($item->menutype_title); ?>
</td>
<?php endif; ?>
<?php if (!empty($this->typeSupports['acl'])) : ?>
<td class="small d-none d-sm-table-cell">
<?php echo $this->escape($item->access_level); ?>
</td>
<?php endif; ?>
<td class="d-none d-sm-table-cell">
<?php echo $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter(); ?>
<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter(); ?>

<?php endif; ?>
<?php endif; ?>

<input type="hidden" name="task" value="">
<input type="hidden" name="forcedItemType" value="<?php echo $app->input->get('forcedItemType', '', 'string'); ?>">
<input type="hidden" name="forcedLanguage" value="<?php echo $app->input->get('forcedLanguage', '', 'cmd'); ?>">
<?php echo HTMLHelper::_('form.token'); ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="forcedItemType" value="<?php echo $app->input->get('forcedItemType', '', 'string'); ?>">
<input type="hidden" name="forcedLanguage" value="<?php echo $app->input->get('forcedLanguage', '', 'cmd'); ?>">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
</form>