diff --git a/administrator/components/com_categories/src/View/Categories/HtmlView.php b/administrator/components/com_categories/src/View/Categories/HtmlView.php
index c022373331ff0..b928409500017 100644
--- a/administrator/components/com_categories/src/View/Categories/HtmlView.php
+++ b/administrator/components/com_categories/src/View/Categories/HtmlView.php
@@ -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')) {
@@ -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
diff --git a/administrator/components/com_contact/src/View/Contacts/HtmlView.php b/administrator/components/com_contact/src/View/Contacts/HtmlView.php
index 6d46155b55aed..1edc459e9dbc0 100644
--- a/administrator/components/com_contact/src/View/Contacts/HtmlView.php
+++ b/administrator/components/com_contact/src/View/Contacts/HtmlView.php
@@ -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');
@@ -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
diff --git a/administrator/components/com_content/src/View/Articles/HtmlView.php b/administrator/components/com_content/src/View/Articles/HtmlView.php
index 8037ee669eb05..4b246da0b98f6 100644
--- a/administrator/components/com_content/src/View/Articles/HtmlView.php
+++ b/administrator/components/com_content/src/View/Articles/HtmlView.php
@@ -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');
@@ -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
diff --git a/administrator/components/com_media/tmpl/file/default.php b/administrator/components/com_media/tmpl/file/default.php
index 1695ddc8e880d..0a9a3e470a443 100644
--- a/administrator/components/com_media/tmpl/file/default.php
+++ b/administrator/components/com_media/tmpl/file/default.php
@@ -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 */
@@ -36,13 +35,6 @@
$input->set('hidemainmenu', true);
-// Load the toolbar when we are in an iframe
-if ($tmpl == 'component') {
- echo '
';
- echo Toolbar::getInstance('toolbar')->render();
- echo '
';
-}
-
$mediaTypes = $input->getString('mediatypes', '0');
// Populate the media config
diff --git a/administrator/components/com_media/tmpl/media/default.php b/administrator/components/com_media/tmpl/media/default.php
index 23ec4136ef345..c5e0aaa264a30 100644
--- a/administrator/components/com_media/tmpl/media/default.php
+++ b/administrator/components/com_media/tmpl/media/default.php
@@ -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();
@@ -32,13 +31,6 @@
$tmpl = $input->getCmd('tmpl');
-// Load the toolbar when we are in an iframe
-if ($tmpl === 'component') {
- echo '';
- echo Toolbar::getInstance('toolbar')->render();
- echo '
';
-}
-
$mediaTypes = '&mediatypes=' . $input->getString('mediatypes', '0,1,2,3');
// Populate the media config
diff --git a/administrator/components/com_modules/src/View/Modules/HtmlView.php b/administrator/components/com_modules/src/View/Modules/HtmlView.php
index bbcaecd92da8e..fe09e0438b137 100644
--- a/administrator/components/com_modules/src/View/Modules/HtmlView.php
+++ b/administrator/components/com_modules/src/View/Modules/HtmlView.php
@@ -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');
@@ -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
diff --git a/administrator/components/com_modules/src/View/Select/HtmlView.php b/administrator/components/com_modules/src/View/Select/HtmlView.php
index 7d55d7a765ff7..83336315d24f4 100644
--- a/administrator/components/com_modules/src/View/Select/HtmlView.php
+++ b/administrator/components/com_modules/src/View/Select/HtmlView.php
@@ -67,7 +67,10 @@ public function display($tpl = null)
throw new GenericDataException(implode("\n", $errors), 500);
}
- $this->addToolbar();
+ if ($this->getLayout() !== 'modal') {
+ $this->addToolbar();
+ }
+
parent::display($tpl);
}
diff --git a/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php b/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php
index 1cac38c86eae6..753b6200bdbe0 100644
--- a/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php
+++ b/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php
@@ -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);
}
diff --git a/administrator/components/com_newsfeeds/src/View/Newsfeeds/HtmlView.php b/administrator/components/com_newsfeeds/src/View/Newsfeeds/HtmlView.php
index e7d4815ef145d..bfd02451bd39c 100644
--- a/administrator/components/com_newsfeeds/src/View/Newsfeeds/HtmlView.php
+++ b/administrator/components/com_newsfeeds/src/View/Newsfeeds/HtmlView.php
@@ -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');
@@ -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
diff --git a/administrator/components/com_tags/src/View/Tags/HtmlView.php b/administrator/components/com_tags/src/View/Tags/HtmlView.php
index 3ea735fbef7d7..e775875669cb6 100644
--- a/administrator/components/com_tags/src/View/Tags/HtmlView.php
+++ b/administrator/components/com_tags/src/View/Tags/HtmlView.php
@@ -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');
@@ -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