Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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 @@ -109,6 +109,7 @@ public function display($tpl = null)
$this->assoc = $this->get('Assoc');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$isModal = $this->getLayout() === 'modal';

// Written this way because we only want to call IsEmptyState if no items, to prevent always calling it when not needed.
if (!count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
Expand All @@ -126,7 +127,7 @@ public function display($tpl = null)
}

// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
if (!$isModal) {
$this->addToolbar();

// We do not need to filter by language when multilingual is disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$isModal = $this->getLayout() === 'modal';

if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('emptystate');
Expand All @@ -107,7 +108,7 @@ public function display($tpl = null)
}

// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
if (!$isModal) {
$this->addToolbar();

// We do not need to filter by language when multilingual is disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function display($tpl = null)
$this->activeFilters = $this->get('ActiveFilters');
$this->vote = PluginHelper::isEnabled('content', 'vote');
$this->hits = ComponentHelper::getParams('com_content')->get('record_hits', 1) == 1;
$isModal = $this->getLayout() === 'modal';

if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('emptystate');
Expand All @@ -133,7 +134,7 @@ public function display($tpl = null)
}

// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
if (!$isModal) {
$this->addToolbar();

// We do not need to filter by language when multilingual is disabled
Expand Down
8 changes: 0 additions & 8 deletions administrator/components/com_media/tmpl/file/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Uri\Uri;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
Expand All @@ -36,13 +35,6 @@

$input->set('hidemainmenu', true);

// Load the toolbar when we are in an iframe
if ($tmpl == 'component') {
echo '<div class="subhead noshadow">';
echo Toolbar::getInstance('toolbar')->render();
echo '</div>';
}

$mediaTypes = $input->getString('mediatypes', '0');

// Populate the media config
Expand Down
8 changes: 0 additions & 8 deletions administrator/components/com_media/tmpl/media/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Uri\Uri;

$app = Factory::getApplication();
Expand All @@ -32,13 +31,6 @@

$tmpl = $input->getCmd('tmpl');

// Load the toolbar when we are in an iframe
if ($tmpl === 'component') {
echo '<div class="subhead noshadow">';
echo Toolbar::getInstance('toolbar')->render();
echo '</div>';
}

$mediaTypes = '&mediatypes=' . $input->getString('mediatypes', '0,1,2,3');

// Populate the media config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function display($tpl = null)
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->clientId = $this->state->get('client_id');
$isModal = $this->getLayout() === 'modal';

if (!count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('emptystate');
Expand Down Expand Up @@ -138,7 +139,7 @@ public function display($tpl = null)
}

// We don't need the toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
if (!$isModal) {
$this->addToolbar();

// We do not need to filter by language when multilingual is disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public function display($tpl = null)
throw new GenericDataException(implode("\n", $errors), 500);
}

$this->addToolbar();
if ($this->getLayout() !== 'modal') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to nitpick. In the other files, you assigned it to $isModal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it need there, because emptystate layout, and here it not in use

$this->addToolbar();
}

parent::display($tpl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ public function display($tpl = null)
$this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage);
}

$this->addToolbar();
if ($this->getLayout() !== 'modal') {
$this->addToolbar();
}

parent::display($tpl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$isModal = $this->getLayout() === 'modal';

if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('emptystate');
Expand All @@ -109,7 +110,7 @@ public function display($tpl = null)
}

// We don't need toolbar in the modal layout.
if ($this->getLayout() !== 'modal') {
if (!$isModal) {
$this->addToolbar();

// We do not need to filter by language when multilingual is disabled
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_tags/src/View/Tags/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$isModal = $this->getLayout() === 'modal';

if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('emptystate');
Expand All @@ -116,7 +117,7 @@ public function display($tpl = null)
}

// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
if (!$isModal) {
$this->addToolbar();

// We do not need to filter by language when multilingual is disabled
Expand Down