diff --git a/administrator/components/com_media/controller.php b/administrator/components/com_media/controller.php index f90061d4c9ac1..46f18e7bc7069 100644 --- a/administrator/components/com_media/controller.php +++ b/administrator/components/com_media/controller.php @@ -30,8 +30,16 @@ public function display($cachable = false, $urlparams = false) { JPluginHelper::importPlugin('content'); + $app = JFactory::getApplication(); $vType = JFactory::getDocument()->getType(); - $vName = $this->input->get('view', 'media'); + $vName = $this->input->get('view', 'media', 'string'); + + if ($app->isSite()) + { + $template = $this->input->get('template', '', 'string'); + $app->setTemplate(($template != '') ? $template : $app->getTemplate()); + + } switch ($vName) { @@ -48,7 +56,6 @@ public function display($cachable = false, $urlparams = false) break; case 'mediaList': - $app = JFactory::getApplication(); $mName = 'list'; $vLayout = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word'); diff --git a/plugins/editors-xtd/image/image.php b/plugins/editors-xtd/image/image.php index 80fc0e5c0aaff..0b6e371fbd746 100644 --- a/plugins/editors-xtd/image/image.php +++ b/plugins/editors-xtd/image/image.php @@ -35,9 +35,10 @@ class PlgButtonImage extends JPlugin */ public function onDisplay($name, $asset, $author) { - $app = JFactory::getApplication(); - $user = JFactory::getUser(); + $app = JFactory::getApplication(); + $user = JFactory::getUser(); $extension = $app->input->get('option'); + $template = $app->getTemplate(); if ($asset == '') { @@ -51,7 +52,8 @@ public function onDisplay($name, $asset, $author) || (count($user->getAuthorisedCategories($extension, 'core.edit')) > 0) || (count($user->getAuthorisedCategories($extension, 'core.edit.own')) > 0 && $author == $user->id)) { - $link = 'index.php?option=com_media&view=images&tmpl=component&e_name=' . $name . '&asset=' . $asset . '&author=' . $author; + $link = 'index.php?option=com_media&view=images&tmpl=component&e_name=' . $name . '&asset=' + . $asset . '&author=' . $author . '&template=' . $template; $button = new JObject; $button->modal = true;