Skip to content

Commit

Permalink
[4.0] Displaying Client and Menus filters in Menu Items manager (#17630)
Browse files Browse the repository at this point in the history
* [4.0] Displaying Client and Menus filters in Menu Items manager

* Moving filters before basic bar

* Div missing

* correcting JToolbar error in menu manager
  • Loading branch information
infograf768 authored and wilsonge committed Aug 20, 2017
1 parent 6312df8 commit eaeb91c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
5 changes: 3 additions & 2 deletions administrator/components/com_menus/View/Menus/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

defined('_JEXEC') or die;

use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\View\HtmlView;
use Joomla\Component\Content\Administrator\Helper\ContentHelper;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;

/**
Expand Down Expand Up @@ -137,7 +138,7 @@ protected function addToolbar()

if ($canDo->get('core.admin') && $this->state->get('client_id') == 1)
{
JToolbarHelper::custom('menu.exportXml', 'download', 'download', 'COM_MENUS_MENU_EXPORT_BUTTON', true);
ToolbarHelper::custom('menu.exportXml', 'download', 'download', 'COM_MENUS_MENU_EXPORT_BUTTON', true);
}

if ($canDo->get('core.admin') || $canDo->get('core.options'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
// Receive overridable options
$data['options'] = !empty($data['options']) ? $data['options'] : array();

if ($data['view'] instanceof MenusViewItems || $data['view'] instanceof MenusViewMenus)
if ($data['view'] instanceof \Joomla\Component\Menus\Administrator\View\Items\Html
|| $data['view'] instanceof \Joomla\Component\Menus\Administrator\View\Menus\Html)
{
// Client selector doesn't have to activate the filter bar.
unset($data['view']->activeFilters['client_id']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/** @var array $displayData */
$data = $displayData;

if ($data['view'] instanceof MenusViewItems)
if ($data['view'] instanceof \Joomla\Component\Menus\Administrator\View\Items\Html)
{
// We will get the menutype filter & remove it from the form filters
$menuTypeField = $data['view']->filterForm->getField('menutype');
Expand All @@ -21,23 +21,28 @@
$clientIdField = $data['view']->filterForm->getField('client_id');

if ($clientIdField): ?>
<div class="js-stools-field-filter js-stools-client_id">
<?php echo $clientIdField->input; ?>
<div class="js-stools-container-selector">
<div class="js-stools-field-selector js-stools-client_id">
<?php echo $clientIdField->input; ?>
</div>
</div>
<?php endif; ?>

<div class="js-stools-field-filter js-stools-menutype">
<?php echo $menuTypeField->input; ?>
<div class="js-stools-container-selector">
<div class="js-stools-field-selector js-stools-menutype">
<?php echo $menuTypeField->input; ?>
</div>
</div>
<?php
}
elseif ($data['view'] instanceof MenusViewMenus)
elseif ($data['view'] instanceof \Joomla\Component\Menus\Administrator\View\Menus\Html)
{
// Add the client selector before the form filters.
$clientIdField = $data['view']->filterForm->getField('client_id');
?>
<div class="js-stools-field-filter js-stools-client_id">
<?php echo $clientIdField->input; ?>
<div class="js-stools-container-selector">
<div class="js-stools-field-selector js-stools-client_id">
<?php echo $clientIdField->input; ?>
</div>
</div>
<?php
}
Expand Down

0 comments on commit eaeb91c

Please sign in to comment.