diff --git a/administrator/components/com_contact/views/contacts/tmpl/modal.php b/administrator/components/com_contact/views/contacts/tmpl/modal.php index 5b2482c943cd2..969ec405a1ca3 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/modal.php +++ b/administrator/components/com_contact/views/contacts/tmpl/modal.php @@ -9,6 +9,13 @@ defined('_JEXEC') or die; +$app = JFactory::getApplication(); + +if ($app->isSite()) +{ + JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN')); +} + JLoader::register('ContactHelperRoute', JPATH_ROOT . '/components/com_contact/helpers/route.php'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); @@ -21,15 +28,13 @@ $searchFilterDesc = $this->filterForm->getFieldAttribute('search', 'description', null, 'filter'); JHtml::_('bootstrap.tooltip', '#filter_search', array('title' => JText::_($searchFilterDesc), 'placement' => 'bottom')); -$app = JFactory::getApplication(); - $function = $app->input->getCmd('function', 'jSelectContact'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?>
-
+ $this)); ?> diff --git a/administrator/components/com_menus/models/items.php b/administrator/components/com_menus/models/items.php index 2b5c0e6190890..c1681fbca446d 100644 --- a/administrator/components/com_menus/models/items.php +++ b/administrator/components/com_menus/models/items.php @@ -350,7 +350,10 @@ protected function getListQuery() } } - $query->where('a.menutype IN(' . implode(',', $types) . ')'); + if (!empty($types)) + { + $query->where('a.menutype IN(' . implode(',', $types) . ')'); + } } // Default behavior => load all items from a specific menu elseif (strlen($menuType)) @@ -372,8 +375,12 @@ protected function getListQuery() // Implement View Level Access if (!$user->authorise('core.admin')) { - $groups = implode(',', $user->getAuthorisedViewLevels()); - $query->where('a.access IN (' . $groups . ')'); + $groups = $user->getAuthorisedViewLevels(); + + if (!empty($groups)) + { + $query->where('a.access IN (' . implode(',', $groups) . ')'); + } } // Filter on the level. diff --git a/administrator/components/com_menus/views/items/tmpl/modal.php b/administrator/components/com_menus/views/items/tmpl/modal.php index e55c3ec6e8029..029eff8e77e54 100644 --- a/administrator/components/com_menus/views/items/tmpl/modal.php +++ b/administrator/components/com_menus/views/items/tmpl/modal.php @@ -13,10 +13,10 @@ if ($app->isSite()) { - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN')); } -JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); +JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/helpers/html'); JHtml::_('behavior.core'); JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); @@ -43,7 +43,7 @@ ?>
- + $this)); ?> diff --git a/administrator/components/com_menus/views/items/view.html.php b/administrator/components/com_menus/views/items/view.html.php index b33f9a19b1c5c..ee11e0d9f9cdd 100644 --- a/administrator/components/com_menus/views/items/view.html.php +++ b/administrator/components/com_menus/views/items/view.html.php @@ -55,7 +55,11 @@ public function display($tpl = null) $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); - MenusHelper::addSubmenu('items'); + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + MenusHelper::addSubmenu('items'); + } // Check for errors. if (count($errors = $this->get('Errors'))) diff --git a/administrator/components/com_modules/modules.php b/administrator/components/com_modules/modules.php index b30029920f7ed..5a0cd0caeb553 100644 --- a/administrator/components/com_modules/modules.php +++ b/administrator/components/com_modules/modules.php @@ -10,7 +10,11 @@ defined('_JEXEC') or die; JHtml::_('behavior.tabstate'); -if (!JFactory::getUser()->authorise('core.manage', 'com_modules')) +$user = JFactory::getUser(); +$input = JFactory::getApplication()->input; + +if (($input->get('layout') !== 'modal' && $input->get('view') !== 'modules') + && !$user->authorise('core.manage', 'com_modules')) { throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } diff --git a/components/com_contact/contact.php b/components/com_contact/contact.php index a119f16139c3e..fd6a908af80bf 100644 --- a/components/com_contact/contact.php +++ b/components/com_contact/contact.php @@ -11,6 +11,19 @@ JLoader::register('ContactHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); +$input = JFactory::getApplication()->input; + +if ($input->get('view') === 'contacts' && $input->get('layout') === 'modal') +{ + if (!JFactory::getUser()->authorise('core.create', 'com_contact')) + { + JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning'); + return; + } + + JFactory::getLanguage()->load('com_contact', JPATH_ADMINISTRATOR); +} + $controller = JControllerLegacy::getInstance('Contact'); $controller->execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); diff --git a/components/com_contact/controller.php b/components/com_contact/controller.php index de91f092984e1..26cc51c440f56 100644 --- a/components/com_contact/controller.php +++ b/components/com_contact/controller.php @@ -16,6 +16,29 @@ */ class ContactController extends JControllerLegacy { + /** + * Constructor. + * + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * + * @since __DEPLOY_VERSION__ + */ + public function __construct($config = array()) + { + $this->input = JFactory::getApplication()->input; + + // Contact frontpage Editor contacts proxying: + if ($this->input->get('view') === 'contacts' && $this->input->get('layout') === 'modal') + { + JHtml::_('stylesheet', 'system/adminlist.css', array(), true); + $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; + } + + parent::__construct($config); + } + /** * Method to display a view. * diff --git a/components/com_contact/models/forms/filter_contacts.xml b/components/com_contact/models/forms/filter_contacts.xml new file mode 100644 index 0000000000000..6272238fbadd7 --- /dev/null +++ b/components/com_contact/models/forms/filter_contacts.xml @@ -0,0 +1,136 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/com_menus/controller.php b/components/com_menus/controller.php new file mode 100644 index 0000000000000..2a9d60630aea7 --- /dev/null +++ b/components/com_menus/controller.php @@ -0,0 +1,41 @@ +input = JFactory::getApplication()->input; + + // Menus frontpage Editor Menu proxying: + if ($this->input->get('view') === 'items' && $this->input->get('layout') === 'modal') + { + JHtml::_('stylesheet', 'system/adminlist.css', array(), true); + $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; + } + + parent::__construct($config); + } +} diff --git a/components/com_menus/menus.php b/components/com_menus/menus.php new file mode 100644 index 0000000000000..c9d2ecd9c81a0 --- /dev/null +++ b/components/com_menus/menus.php @@ -0,0 +1,31 @@ +input->get('view') === 'items' && $app->input->get('layout') === 'modal') +{ + if (!JFactory::getUser()->authorise('core.create', 'com_menus')) + { + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning'); + return; + } +} + +$lang->load('joomla', JPATH_ADMINISTRATOR); +$lang->load('com_menus', JPATH_ADMINISTRATOR); + +// Trigger the controller +$controller = JControllerLegacy::getInstance('Menus'); +$controller->execute($app->input->get('task')); +$controller->redirect(); diff --git a/components/com_menus/models/forms/filter_items.xml b/components/com_menus/models/forms/filter_items.xml new file mode 100644 index 0000000000000..f6179f04b9c9a --- /dev/null +++ b/components/com_menus/models/forms/filter_items.xml @@ -0,0 +1,95 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +