diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 0889043887e3c..67b97a8825308 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -1618,6 +1618,10 @@ public function deleteUnexistingFiles() '/administrator/components/com_modules/layouts/joomla/searchtools/default.php', '/administrator/components/com_templates/layouts/joomla/searchtools/default/bar.php', '/administrator/components/com_templates/layouts/joomla/searchtools/default.php', + // Joomla __DEPLOY_VERSION__ + '/administrator/modules/mod_menu/tmpl/default_enabled.php', + '/administrator/modules/mod_menu/tmpl/default_disabled.php', + '/administrator/templates/hathor/html/mod_menu/default_enabled.php', ); // TODO There is an issue while deleting folders using the ftp mode @@ -1746,6 +1750,8 @@ public function deleteUnexistingFiles() '/administrator/components/com_templates/layouts/joomla/searchtools', '/administrator/components/com_templates/layouts/joomla', '/administrator/components/com_templates/layouts', + // Joomla! __DEPLOY_VERSION__ + '/administrator/templates/hathor/html/mod_menu', ); jimport('joomla.filesystem.file'); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-11-19.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-11-19.sql new file mode 100644 index 0000000000000..4b2cabfb8b5ec --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-11-19.sql @@ -0,0 +1,3 @@ +ALTER TABLE `#__menu_types` ADD `client_id` int(11) NOT NULL DEFAULT 0; + +UPDATE `#__menu` SET `published` = 1 WHERE `menutype` = 'main' OR `menutype` = 'menu'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-11-19.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-11-19.sql new file mode 100644 index 0000000000000..da2b368041418 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-11-19.sql @@ -0,0 +1,3 @@ +ALTER TABLE "#__menu_types" ADD "client_id" int DEFAULT 0 NOT NULL; + +UPDATE "#__menu" SET "published" = 1 WHERE "menutype" = 'main' OR "menutype" = 'menu'; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-11-19.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-11-19.sql new file mode 100644 index 0000000000000..01bd65750ac80 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-11-19.sql @@ -0,0 +1,3 @@ +ALTER TABLE [#__menu_types] ADD [client_id] [tinyint] NOT NULL DEFAULT 0; + +UPDATE [#__menu] SET [published] = 1 WHERE [menutype] = 'main' OR [menutype] = 'menu'; diff --git a/administrator/components/com_admin/views/help/tmpl/default.xml b/administrator/components/com_admin/views/help/tmpl/default.xml new file mode 100755 index 0000000000000..098e8f184d6e2 --- /dev/null +++ b/administrator/components/com_admin/views/help/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_admin/views/sysinfo/tmpl/default.xml b/administrator/components/com_admin/views/sysinfo/tmpl/default.xml new file mode 100755 index 0000000000000..479fa92087a8c --- /dev/null +++ b/administrator/components/com_admin/views/sysinfo/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_cache/views/cache/tmpl/default.xml b/administrator/components/com_cache/views/cache/tmpl/default.xml new file mode 100755 index 0000000000000..82466a2128618 --- /dev/null +++ b/administrator/components/com_cache/views/cache/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_cache/views/purge/tmpl/default.xml b/administrator/components/com_cache/views/purge/tmpl/default.xml new file mode 100755 index 0000000000000..98fcff1baed46 --- /dev/null +++ b/administrator/components/com_cache/views/purge/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_categories/views/categories/tmpl/default.xml b/administrator/components/com_categories/views/categories/tmpl/default.xml new file mode 100755 index 0000000000000..d1eadb14baa6d --- /dev/null +++ b/administrator/components/com_categories/views/categories/tmpl/default.xml @@ -0,0 +1,19 @@ + + + + + + + +
+ + + +
+
diff --git a/administrator/components/com_categories/views/category/tmpl/edit.xml b/administrator/components/com_categories/views/category/tmpl/edit.xml new file mode 100755 index 0000000000000..3bdf3cee46f20 --- /dev/null +++ b/administrator/components/com_categories/views/category/tmpl/edit.xml @@ -0,0 +1,24 @@ + + + + + + + +
+ + + + +
+
diff --git a/administrator/components/com_checkin/views/checkin/tmpl/default.xml b/administrator/components/com_checkin/views/checkin/tmpl/default.xml new file mode 100755 index 0000000000000..e0086bef3983c --- /dev/null +++ b/administrator/components/com_checkin/views/checkin/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_config/view/application/tmpl/default.xml b/administrator/components/com_config/view/application/tmpl/default.xml new file mode 100755 index 0000000000000..2cd0ed3287f1b --- /dev/null +++ b/administrator/components/com_config/view/application/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_config/view/component/tmpl/default.xml b/administrator/components/com_config/view/component/tmpl/default.xml new file mode 100755 index 0000000000000..2ddf42d8b8967 --- /dev/null +++ b/administrator/components/com_config/view/component/tmpl/default.xml @@ -0,0 +1,19 @@ + + + + + + + + +
+ +
+
+
diff --git a/administrator/components/com_content/views/article/tmpl/edit.xml b/administrator/components/com_content/views/article/tmpl/edit.xml new file mode 100755 index 0000000000000..f5efd601bb092 --- /dev/null +++ b/administrator/components/com_content/views/article/tmpl/edit.xml @@ -0,0 +1,17 @@ + + + + + + + +
+ + + +
+
diff --git a/administrator/components/com_content/views/articles/tmpl/default.xml b/administrator/components/com_content/views/articles/tmpl/default.xml new file mode 100755 index 0000000000000..b3dec7f7be330 --- /dev/null +++ b/administrator/components/com_content/views/articles/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_content/views/featured/tmpl/default.xml b/administrator/components/com_content/views/featured/tmpl/default.xml new file mode 100755 index 0000000000000..4697ce1704542 --- /dev/null +++ b/administrator/components/com_content/views/featured/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_cpanel/views/cpanel/tmpl/default.xml b/administrator/components/com_cpanel/views/cpanel/tmpl/default.xml new file mode 100755 index 0000000000000..f9c3fdac00aea --- /dev/null +++ b/administrator/components/com_cpanel/views/cpanel/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/database/tmpl/default.xml b/administrator/components/com_installer/views/database/tmpl/default.xml new file mode 100755 index 0000000000000..c028598367863 --- /dev/null +++ b/administrator/components/com_installer/views/database/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/discover/tmpl/default.xml b/administrator/components/com_installer/views/discover/tmpl/default.xml new file mode 100755 index 0000000000000..350dddaf66f10 --- /dev/null +++ b/administrator/components/com_installer/views/discover/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/install/tmpl/default.xml b/administrator/components/com_installer/views/install/tmpl/default.xml new file mode 100755 index 0000000000000..e6fd86b3287f9 --- /dev/null +++ b/administrator/components/com_installer/views/install/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/languages/tmpl/default.xml b/administrator/components/com_installer/views/languages/tmpl/default.xml new file mode 100755 index 0000000000000..4f52293ea226d --- /dev/null +++ b/administrator/components/com_installer/views/languages/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/manage/tmpl/default.xml b/administrator/components/com_installer/views/manage/tmpl/default.xml new file mode 100755 index 0000000000000..13dc66fc7c92c --- /dev/null +++ b/administrator/components/com_installer/views/manage/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/update/tmpl/default.xml b/administrator/components/com_installer/views/update/tmpl/default.xml new file mode 100755 index 0000000000000..d262a8a9750b2 --- /dev/null +++ b/administrator/components/com_installer/views/update/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/updatesites/tmpl/default.xml b/administrator/components/com_installer/views/updatesites/tmpl/default.xml new file mode 100755 index 0000000000000..f9cf92a6b36fe --- /dev/null +++ b/administrator/components/com_installer/views/updatesites/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_installer/views/warnings/tmpl/default.xml b/administrator/components/com_installer/views/warnings/tmpl/default.xml new file mode 100755 index 0000000000000..8e6472cdea1e9 --- /dev/null +++ b/administrator/components/com_installer/views/warnings/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default.xml b/administrator/components/com_joomlaupdate/views/default/tmpl/default.xml new file mode 100755 index 0000000000000..61f8dafe9a76b --- /dev/null +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_languages/views/installed/tmpl/default.xml b/administrator/components/com_languages/views/installed/tmpl/default.xml new file mode 100755 index 0000000000000..3c92e7d97662c --- /dev/null +++ b/administrator/components/com_languages/views/installed/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_languages/views/languages/tmpl/default.xml b/administrator/components/com_languages/views/languages/tmpl/default.xml new file mode 100755 index 0000000000000..4c7a003f386bc --- /dev/null +++ b/administrator/components/com_languages/views/languages/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_languages/views/overrides/tmpl/default.xml b/administrator/components/com_languages/views/overrides/tmpl/default.xml new file mode 100755 index 0000000000000..54b63dcf72c9c --- /dev/null +++ b/administrator/components/com_languages/views/overrides/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_media/views/media/tmpl/default.xml b/administrator/components/com_media/views/media/tmpl/default.xml new file mode 100755 index 0000000000000..6aa1cbb202034 --- /dev/null +++ b/administrator/components/com_media/views/media/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_menus/controllers/item.php b/administrator/components/com_menus/controllers/item.php index c473d4881eb89..5b5f42b78e52d 100644 --- a/administrator/components/com_menus/controllers/item.php +++ b/administrator/components/com_menus/controllers/item.php @@ -69,6 +69,12 @@ protected function allowEdit($data = array(), $key = 'id') if (!empty($item->menutype)) { + // Protected menutype, do not allow edit + if ($item->menutype == 'main' || $item->menutype == 'menu') + { + return false; + } + $menutypeID = (int) $this->getMenuTypeId($item->menutype); } } @@ -113,10 +119,6 @@ public function add() { $app->setUserState($context . '.type', null); $app->setUserState($context . '.link', null); - - $menuType = $app->getUserStateFromRequest($this->context . '.filter.menutype', 'menutype', 'mainmenu', 'cmd'); - - $this->setRedirect(JRoute::_('index.php?option=com_menus&view=item&menutype=' . $menuType . $this->getRedirectToItemAppend(), false)); } return $result; @@ -204,6 +206,38 @@ public function edit($key = null, $urlVar = null) return $result; } + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 12.2 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + if ($recordId) + { + $model = $this->getModel(); + $item = $model->getItem($recordId); + $clientId = $item->client_id; + $append = '&client_id=' . $clientId . $append; + } + else + { + $app = JFactory::getApplication(); + $clientId = $app->input->get('client_id', '0', 'int'); + $menuType = $app->input->get('menutype', 'mainmenu', 'cmd'); + $append = '&client_id=' . $clientId . ($menuType ? '&menutype=' . $menuType : '') . $append; + } + + return $append; + } + /** * Method to save a record. * @@ -429,7 +463,6 @@ public function save($key = null, $urlVar = null) $app->setUserState('com_menus.edit.item.data', null); $app->setUserState('com_menus.edit.item.type', null); $app->setUserState('com_menus.edit.item.link', null); - $app->setUserState('com_menus.edit.item.menutype', $model->getState('item.menutype')); // Redirect back to the edit screen. $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend(), false)); @@ -532,21 +565,26 @@ public function getParentItem() { $app = JFactory::getApplication(); + $results = array(); $menutype = $this->input->get->get('menutype'); - $model = $this->getModel('Items', '', array()); - $model->getState(); - $model->setState('filter.menutype', $menutype); - $model->setState('list.select', 'a.id, a.title, a.level'); - $model->setState('list.start', 0); - $model->setState('list.limit', 0); - - $results = $model->getItems(); - - // Pad the option text with spaces using depth level as a multiplier. - for ($i = 0, $n = count($results); $i < $n; $i++) + if ($menutype) { - $results[$i]->title = str_repeat('- ', $results[$i]->level) . $results[$i]->title; + $model = $this->getModel('Items', '', array()); + $model->getState(); + $model->setState('filter.menutype', $menutype); + $model->setState('list.select', 'a.id, a.title, a.level'); + $model->setState('list.start', '0'); + $model->setState('list.limit', '0'); + + /** @var MenusModelItems $model */ + $results = $model->getItems(); + + // Pad the option text with spaces using depth level as a multiplier. + for ($i = 0, $n = count($results); $i < $n; $i++) + { + $results[$i]->title = str_repeat(' - ', $results[$i]->level) . $results[$i]->title; + } } // Output a JSON object diff --git a/administrator/components/com_menus/controllers/menu.php b/administrator/components/com_menus/controllers/menu.php index 2891d6947eaa1..341584a7073f1 100644 --- a/administrator/components/com_menus/controllers/menu.php +++ b/administrator/components/com_menus/controllers/menu.php @@ -52,17 +52,6 @@ public function save($key = null, $urlVar = null) $task = $this->getTask(); $recordId = $this->input->getInt('id'); - // Make sure we are not trying to modify an administrator menu. - if (isset($data['client_id']) && $data['client_id'] == 1) - { - JError::raiseNotice(0, JText::_('COM_MENUS_MENU_TYPE_NOT_ALLOWED')); - - // Redirect back to the edit screen. - $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menu&layout=edit', false)); - - return false; - } - // Prevent using 'menu' or 'main' as menutype as this is reserved for backend menus if (strtolower($data['menutype']) == 'menu' || strtolower($data['menutype']) == 'main') { diff --git a/administrator/components/com_menus/layouts/joomla/searchtools/default.php b/administrator/components/com_menus/layouts/joomla/searchtools/default.php new file mode 100644 index 0000000000000..d44a0870e910f --- /dev/null +++ b/administrator/components/com_menus/layouts/joomla/searchtools/default.php @@ -0,0 +1,83 @@ +addStyleDeclaration(" + /* Fixed filter field in search bar */ + .js-stools .js-stools-menutype, + .js-stools .js-stools-client_id { + float: left; + margin-right: 10px; + min-width: 220px; + } + html[dir=rtl] .js-stools .js-stools-menutype, + html[dir=rtl] .js-stools .js-stools-client_id { + float: right; + margin-left: 10px + margin-right: 0; + } + .js-stools .js-stools-container-bar .js-stools-field-filter .chzn-container { + padding: 3px 0; + } + "); + + // Client selector doesn't have to activate the filter bar. + unset($data['view']->activeFilters['client_id']); + + // Menutype filter doesn't have to activate the filter bar + unset($data['view']->activeFilters['menutype']); +} + +// Set some basic options +$customOptions = array( + 'filtersHidden' => isset($data['options']['filtersHidden']) ? $data['options']['filtersHidden'] : empty($data['view']->activeFilters), + 'defaultLimit' => isset($data['options']['defaultLimit']) ? $data['options']['defaultLimit'] : JFactory::getApplication()->get('list_limit', 20), + 'searchFieldSelector' => '#filter_search', + 'orderFieldSelector' => '#list_fullordering', + 'totalResults' => isset($data['options']['totalResults']) ? $data['options']['totalResults'] : -1, + 'noResultsText' => isset($data['options']['noResultsText']) ? $data['options']['noResultsText'] : JText::_('JGLOBAL_NO_MATCHING_RESULTS'), +); + +$data['options'] = array_merge($customOptions, $data['options']); + +$formSelector = !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm'; + +// Load search tools +JHtml::_('searchtools.form', $formSelector, $data['options']); + +$filtersClass = isset($data['view']->activeFilters) && $data['view']->activeFilters ? ' js-stools-container-filters-visible' : ''; +?> +
+
+
+ +
+
+ +
+
+ +
+ +
+
+ + + diff --git a/administrator/components/com_menus/layouts/joomla/searchtools/default/bar.php b/administrator/components/com_menus/layouts/joomla/searchtools/default/bar.php new file mode 100644 index 0000000000000..916ea5459df3b --- /dev/null +++ b/administrator/components/com_menus/layouts/joomla/searchtools/default/bar.php @@ -0,0 +1,46 @@ +filterForm->getField('menutype'); + + // Add the client selector before the form filters. + $clientIdField = $data['view']->filterForm->getField('client_id'); + + if ($clientIdField): ?> +
+ input; ?> +
+ + +
+ input; ?> +
+ filterForm->getField('client_id'); + ?> +
+ input; ?> +
+ 'none')); diff --git a/administrator/components/com_menus/models/fields/menuparent.php b/administrator/components/com_menus/models/fields/menuparent.php index 3e2f95b593209..b59a9cd3993e4 100644 --- a/administrator/components/com_menus/models/fields/menuparent.php +++ b/administrator/components/com_menus/models/fields/menuparent.php @@ -49,7 +49,10 @@ protected function getOptions() } else { + // Skip special menu types $query->where('a.menutype != ' . $db->quote('')); + $query->where('a.menutype != ' . $db->quote('main')); + $query->where('a.menutype != ' . $db->quote('menu')); } // Filter by client id. diff --git a/administrator/components/com_menus/models/fields/menutype.php b/administrator/components/com_menus/models/fields/menutype.php index 0c374c0c9df68..df985c85de23a 100644 --- a/administrator/components/com_menus/models/fields/menutype.php +++ b/administrator/components/com_menus/models/fields/menutype.php @@ -39,14 +39,12 @@ protected function getInput() { $html = array(); $recordId = (int) $this->form->getValue('id'); - $size = ($v = $this->element['size']) ? ' size="' . $v . '"' : ''; - $class = ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"'; - $required = ($v = $this->element['required']) ? ' required="required"' : ''; + $size = (string) ($v = $this->element['size']) ? ' size="' . $v . '"' : ''; + $class = (string) ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"'; + $required = (string) $this->element['required'] ? ' required="required"' : ''; + $clientId = (int) $this->element['clientid'] ?: 0; // Get a reverse lookup of the base link URL to Title - $model = JModelLegacy::getInstance('menutypes', 'menusModel'); - $rlu = $model->getReverseLookup(); - switch ($this->value) { case 'url': @@ -68,10 +66,17 @@ protected function getInput() default: $link = $this->form->getValue('link'); + /** @var MenusModelMenutypes $model */ + $model = JModelLegacy::getInstance('Menutypes', 'MenusModel', array('ignore_request' => true)); + $model->setState('client_id', $clientId); + + $rlu = $model->getReverseLookup(); + // Clean the link back to the option, view and layout $value = JText::_(ArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link))); break; } + // Include jQuery JHtml::_('jquery.framework'); @@ -82,9 +87,9 @@ function jSelectPosition_' . $this->id . '(name) { } '); - $link = JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&recordId=' . $recordId); + $link = JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&client_id=' . $clientId . '&recordId=' . $recordId); $html[] = ''; + . '" value="' . $value . '" ' . $size . $class . ' />'; $html[] = '' . ' ' . JText::_('JSELECT') . ''; diff --git a/administrator/components/com_menus/models/fields/modal/menu.php b/administrator/components/com_menus/models/fields/modal/menu.php index 072a20bb95884..b5164459cf9b2 100644 --- a/administrator/components/com_menus/models/fields/modal/menu.php +++ b/administrator/components/com_menus/models/fields/modal/menu.php @@ -38,6 +38,7 @@ protected function getInput() $allowEdit = ((string) $this->element['edit'] == 'true'); $allowClear = ((string) $this->element['clear'] != 'false'); $allowSelect = ((string) $this->element['select'] != 'false'); + $clientId = (int) $this->element['clientid']; // Load language JFactory::getLanguage()->load('com_menus', JPATH_ADMINISTRATOR); @@ -75,8 +76,9 @@ function jSelectMenu_" . $this->id . "(id, title, object) { } // Setup variables for display. - $linkItems = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; - $linkItem = 'index.php?option=com_menus&view=item&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; + $linkSuffix = '&layout=modal&client_id=' . $clientId . '&tmpl=component&' . JSession::getFormToken() . '=1'; + $linkItems = 'index.php?option=com_menus&view=items' . $linkSuffix; + $linkItem = 'index.php?option=com_menus&view=item' . $linkSuffix; $modalTitle = JText::_('COM_MENUS_CHANGE_MENUITEM'); if (isset($this->element['language'])) diff --git a/administrator/components/com_menus/models/forms/filter_items.xml b/administrator/components/com_menus/models/forms/filter_items.xml index c70e06bf9de1f..a946b172c97f1 100644 --- a/administrator/components/com_menus/models/forms/filter_items.xml +++ b/administrator/components/com_menus/models/forms/filter_items.xml @@ -1,11 +1,23 @@
+ + + + diff --git a/administrator/components/com_menus/models/forms/filter_menus.xml b/administrator/components/com_menus/models/forms/filter_menus.xml index 9356ab179adec..58842a644d03f 100644 --- a/administrator/components/com_menus/models/forms/filter_menus.xml +++ b/administrator/components/com_menus/models/forms/filter_menus.xml @@ -1,5 +1,15 @@ + + + + JGLOBAL_TITLE_DESC - + @@ -121,7 +122,7 @@ type="list" label="COM_MENUS_ITEM_FIELD_BROWSERNAV_LABEL" description="COM_MENUS_ITEM_FIELD_BROWSERNAV_DESC" - default="Parent" + default="0" filter="int" > @@ -143,6 +144,7 @@ type="templatestyle" label="COM_MENUS_ITEM_FIELD_TEMPLATE_LABEL" description="COM_MENUS_ITEM_FIELD_TEMPLATE_DESC" + client="site" filter="int" > diff --git a/administrator/components/com_menus/models/forms/item_alias.xml b/administrator/components/com_menus/models/forms/item_alias.xml index c184b2a675ed6..abde0417f2707 100644 --- a/administrator/components/com_menus/models/forms/item_alias.xml +++ b/administrator/components/com_menus/models/forms/item_alias.xml @@ -8,6 +8,7 @@ - + diff --git a/administrator/components/com_menus/models/forms/itemadmin.xml b/administrator/components/com_menus/models/forms/itemadmin.xml new file mode 100644 index 0000000000000..55578eb2589ae --- /dev/null +++ b/administrator/components/com_menus/models/forms/itemadmin.xml @@ -0,0 +1,194 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/administrator/components/com_menus/models/forms/itemadmin_alias.xml b/administrator/components/com_menus/models/forms/itemadmin_alias.xml new file mode 100644 index 0000000000000..66e4aebe774a2 --- /dev/null +++ b/administrator/components/com_menus/models/forms/itemadmin_alias.xml @@ -0,0 +1,72 @@ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + +
+
+ + diff --git a/administrator/components/com_menus/models/forms/itemadmin_component.xml b/administrator/components/com_menus/models/forms/itemadmin_component.xml new file mode 100644 index 0000000000000..78741817a4869 --- /dev/null +++ b/administrator/components/com_menus/models/forms/itemadmin_component.xml @@ -0,0 +1,43 @@ + +
+ +
+ + + + + + + + + + + + + + + +
+
+
diff --git a/administrator/components/com_menus/models/forms/itemadmin_heading.xml b/administrator/components/com_menus/models/forms/itemadmin_heading.xml new file mode 100644 index 0000000000000..a13ca94055c55 --- /dev/null +++ b/administrator/components/com_menus/models/forms/itemadmin_heading.xml @@ -0,0 +1,81 @@ + +
+
+ + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + diff --git a/administrator/components/com_menus/models/forms/itemadmin_separator.xml b/administrator/components/com_menus/models/forms/itemadmin_separator.xml new file mode 100644 index 0000000000000..dc0a4d2e8e4fc --- /dev/null +++ b/administrator/components/com_menus/models/forms/itemadmin_separator.xml @@ -0,0 +1,18 @@ + +
+
+ + + + +
+ + + diff --git a/administrator/components/com_menus/models/forms/itemadmin_url.xml b/administrator/components/com_menus/models/forms/itemadmin_url.xml new file mode 100644 index 0000000000000..5eba70717831c --- /dev/null +++ b/administrator/components/com_menus/models/forms/itemadmin_url.xml @@ -0,0 +1,61 @@ + +
+ +
+ + + + + + + + + + + + + + + + + + +
+
+ + diff --git a/administrator/components/com_menus/models/forms/menu.xml b/administrator/components/com_menus/models/forms/menu.xml index a10aac513c04a..4f1855a388fd1 100644 --- a/administrator/components/com_menus/models/forms/menu.xml +++ b/administrator/components/com_menus/models/forms/menu.xml @@ -7,13 +7,13 @@ type="hidden" default="0" filter="int" - readonly="true"/> - + readonly="true" + /> - + filter="unset" + /> - + required="true" + /> - + required="true" + /> - + maxlength="255" + /> + + + + 'batchAccess', - 'language_id' => 'batchLanguage' + 'language_id' => 'batchLanguage' ); /** @@ -96,9 +96,10 @@ protected function canDelete($record) if (!empty($record->id)) { + // Only delete trashed items if ($record->published != -2) { - return; + return false; } $menuTypeId = 0; @@ -110,6 +111,8 @@ protected function canDelete($record) return $user->authorise('core.delete', 'com_menus.menu.' . (int) $menuTypeId); } + + return false; } /** @@ -143,13 +146,13 @@ protected function canEditState($record) protected function batchCopy($value, $pks, $contexts) { // $value comes as {menutype}.{parent_id} - $parts = explode('.', $value); + $parts = explode('.', $value); $menuType = $parts[0]; $parentId = ArrayHelper::getValue($parts, 1, 0, 'int'); - $table = $this->getTable(); - $db = $this->getDbo(); - $query = $db->getQuery(true); + $table = $this->getTable(); + $db = $this->getDbo(); + $query = $db->getQuery(true); $newIds = array(); // Check that the parent exists @@ -536,8 +539,17 @@ public function getForm($data = array(), $loadData = true) $this->setState('item.type', ArrayHelper::getValue($data, 'type')); } + $clientId = $this->getState('item.client_id'); + // Get the form. - $form = $this->loadForm('com_menus.item', 'item', array('control' => 'jform', 'load_data' => $loadData), true); + if ($clientId == 1) + { + $form = $this->loadForm('com_menus.item.admin', 'itemadmin', array('control' => 'jform', 'load_data' => $loadData), true); + } + else + { + $form = $this->loadForm('com_menus.item', 'item', array('control' => 'jform', 'load_data' => $loadData), true); + } if (empty($form)) { @@ -562,10 +574,11 @@ public function getForm($data = array(), $loadData = true) $form->setFieldAttribute('published', 'filter', 'unset'); } - // Filter available menues + // Filter available menus $action = $this->getState('item.id') > 0 ? 'edit' : 'create'; $form->setFieldAttribute('menutype', 'accesstype', $action); + $form->setFieldAttribute('type', 'clientid', $clientId); return $form; } @@ -653,7 +666,8 @@ public function getItem($pk = null) if (empty($table->id)) { $table->parent_id = $this->getState('item.parent_id'); - $table->menutype = $this->getState('item.menutype'); + $table->menutype = $this->getState('item.menutype'); + $table->client_id = $this->getState('item.client_id'); $table->params = '{}'; } @@ -762,10 +776,8 @@ public function getItem($pk = null) $result->params = array_merge($result->params, $args); } - // Load associated menu items - $assoc = JLanguageAssociations::isEnabled(); - - if ($assoc) + // Load associated menu items, only supported for frontend for now + if ($this->getState('item.client_id') == 0 && JLanguageAssociations::isEnabled()) { if ($pk != null) { @@ -794,6 +806,12 @@ public function getModules() $db = $this->getDbo(); $query = $db->getQuery(true); + // Currently any setting that affects target page for a backend menu is not supported, hence load no modules. + if ($this->getState('item.client_id') == 1) + { + return false; + } + /** * Join on the module-to-menu mapping table. * We are only interested if the module is displayed on ALL or THIS menu item (or the inverse ID number). @@ -808,7 +826,7 @@ public function getModules() $query->select('ag.title AS access_title') ->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access') ->where('a.published >= 0') - ->where('a.client_id = 0') + ->where('a.client_id = ' . (int) $this->getState('item.client_id')) ->order('a.position, a.ordering'); $db->setQuery($query); @@ -830,7 +848,7 @@ public function getModules() /** * Get the list of all view levels * - * @return array An array of all view levels (id, title). + * @return array|bool An array of all view levels (id, title). * * @since 3.4 */ @@ -873,17 +891,17 @@ public function getViewLevels() */ protected function getReorderConditions($table) { - return 'menutype = ' . $this->_db->quote($table->menutype); + return 'menutype = ' . $this->_db->quote($table->get('menutype')); } /** * Returns a Table object, always creating it * - * @param type $type The table type to instantiate. + * @param string $type The table type to instantiate. * @param string $prefix A prefix for the table class name. Optional. * @param array $config Configuration array for model. Optional. * - * @return JTable A database object. + * @return JTable|JTableNested A database object. * * @since 1.6 */ @@ -916,25 +934,48 @@ protected function populateState() $this->setState('item.parent_id', $parentId); - $menuType = $app->getUserState('com_menus.edit.item.menutype'); + $menuType = $app->getUserStateFromRequest('com_menus.items.menutype', 'menutype', '', 'string'); - if ($forcedMenuType = $app->input->get('menutype', '', 'string')) + // If we have a menutype we take client_id from there, unless forced otherwise + if ($menuType) { - $menuType = $forcedMenuType; + $menuTypeObj = $this->getMenuType($menuType); - // Set the menu type on the list view state, so we return to this menu after saving. - $app->setUserState('com_menus.items.menutype', $forcedMenuType); + // An invalid menutype will be handled as clientId = 0 and menuType = '' + $menuType = (string) $menuTypeObj->menutype; + $menuTypeId = (int) $menuTypeObj->client_id; + $clientId = (int) $menuTypeObj->client_id; + } + else + { + $menuTypeId = 0; + $clientId = $app->getUserState('com_menus.items.client_id', 0); } - $this->setState('item.menutype', $menuType); + // Forced client id will override/clear menuType if conflicted + $forcedClientId = $app->input->get('client_id', null, 'string'); - $menuTypeId = 0; + // Current item if not new, we don't allow changing client id at all + if ($pk) + { + $table = $this->getTable(); + $table->load($pk); + $forcedClientId = $table->get('client_id', $forcedClientId); + } - if ($menuType) + if (isset($forcedClientId) && $forcedClientId != $clientId) { - $menuTypeId = $this->getMenuTypeId($menuType); + $clientId = $forcedClientId; + $menuType = ''; + $menuTypeId = 0; } + // Set the menu type and client id on the list view state, so we return to this menu after saving. + $app->setUserState('com_menus.items.menutype', $menuType); + $app->setUserState('com_menus.items.client_id', $clientId); + + $this->setState('item.menutype', $menuType); + $this->setState('item.client_id', $clientId); $this->setState('item.menutypeid', $menuTypeId); if (!($type = $app->getUserState('com_menus.edit.item.type'))) @@ -960,21 +1001,37 @@ protected function populateState() } /** - * Loads the menutype ID by a given menutype string + * Loads the menutype object by a given menutype string * * @param string $menutype The given menutype * - * @return integer + * @return stdClass * - * @since 3.6 + * @since __DEPLOY_VERSION__ */ - protected function getMenuTypeId($menutype) + protected function getMenuType($menutype) { $table = $this->getTable('MenuType', 'JTable'); $table->load(array('menutype' => $menutype)); - return (int) $table->id; + return (object) $table->getProperties(); + } + + /** + * Loads the menutype ID by a given menutype string + * + * @param string $menutype The given menutype + * + * @return integer + * + * @since 3.6 + */ + protected function getMenuTypeId($menutype) + { + $menu = $this->getMenuType($menutype); + + return (int) $menu->id; } /** @@ -991,10 +1048,15 @@ protected function getMenuTypeId($menutype) */ protected function preprocessForm(JForm $form, $data, $group = 'content') { - $link = $this->getState('item.link'); - $type = $this->getState('item.type'); + $link = $this->getState('item.link'); + $type = $this->getState('item.type'); + $clientId = $this->getState('item.client_id'); $formFile = false; + // Load the specific type file + $typeFile = $clientId == 1 ? 'itemadmin_' . $type : 'item_' . $type; + $clientInfo = JApplicationHelper::getClientInfo($clientId); + // Initialise form with component view params if available. if ($type == 'component') { @@ -1012,7 +1074,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') { // The option determines the base path to work with. $option = $args['option']; - $base = JPATH_SITE . '/components/' . $option; + $base = $clientInfo->path . '/components/' . $option; } if (isset($args['view'])) @@ -1045,8 +1107,9 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') // template folder is first part of file name -- template:folder if (!$formFile && (strpos($layout, ':') > 0)) { - $temp = explode(':', $layout); - $templatePath = JPath::clean(JPATH_SITE . '/templates/' . $temp[0] . '/html/' . $option . '/' . $view . '/' . $temp[1] . '.xml'); + list($altTmpl, $altLayout) = explode(':', $layout); + + $templatePath = JPath::clean($clientInfo->path . '/templates/' . $altTmpl . '/html/' . $option . '/' . $view . '/' . $altLayout . '.xml'); if (is_file($templatePath)) { @@ -1106,16 +1169,18 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') else { // We don't have a component. Load the form XML to get the help path - $xmlFile = JPath::find(JPATH_ADMINISTRATOR . '/components/com_menus/models/forms', 'item_' . $type . '.xml'); + $xmlFile = JPath::find(JPATH_ADMINISTRATOR . '/components/com_menus/models/forms', $typeFile . '.xml'); - // Attempt to load the xml file. - if ($xmlFile && !$xml = simplexml_load_file($xmlFile)) + if ($xmlFile) { - throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); - } + if (!$xml = simplexml_load_file($xmlFile)) + { + throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); + } - // Get the help data from the XML file if present. - $help = $xml->xpath('/form/help'); + // Get the help data from the XML file if present. + $help = $xml->xpath('/form/help'); + } } if (!empty($help)) @@ -1129,14 +1194,13 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $this->helpLocal = (($helpLoc == 'true') || ($helpLoc == '1') || ($helpLoc == 'local')) ? true : false; } - // Load the specific type file - if (!$form->loadFile('item_' . $type, false, false)) + if (!$form->loadFile($typeFile, true, false)) { throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); } - // Association menu items - if (JLanguageAssociations::isEnabled()) + // Association menu items, we currently do not support this for admin menu… may be later + if ($clientId == 0 && JLanguageAssociations::isEnabled()) { $languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc'); @@ -1182,7 +1246,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') */ public function rebuild() { - // Initialiase variables. + // Initialise variables. $db = $this->getDbo(); $query = $db->getQuery(true); $table = $this->getTable(); @@ -1262,8 +1326,8 @@ public function save($data) $dispatcher = JEventDispatcher::getInstance(); $pk = (!empty($data['id'])) ? $data['id'] : (int) $this->getState('item.id'); $isNew = true; - $table = $this->getTable(); - $context = $this->option . '.' . $this->name; + $table = $this->getTable(); + $context = $this->option . '.' . $this->name; // Include the plugins for the on save events. JPluginHelper::importPlugin($this->events_map['save']); @@ -1310,6 +1374,10 @@ public function save($data) // We have a new item, so it is not a change. else { + $menuType = $this->getMenuType($data['menutype']); + + $data['client_id'] = $menuType->client_id; + $table->setLocation($data['parent_id'], 'last-child'); } @@ -1325,10 +1393,11 @@ public function save($data) if (!$isNew && $data['id'] == 0) { list($title, $alias) = $this->generateNewTitle($table->parent_id, $table->alias, $table->title); - $table->title = $title; - $table->alias = $alias; + + $table->title = $title; + $table->alias = $alias; $table->published = 0; - $table->home = 0; + $table->home = 0; } // Check the data. @@ -1364,10 +1433,8 @@ public function save($data) $this->setState('item.id', $table->id); $this->setState('item.menutype', $table->menutype); - // Load associated menu items - $assoc = JLanguageAssociations::isEnabled(); - - if ($assoc) + // Load associated menu items, for now not supported for admin menu… may be later + if ($table->get('client_id') == 0 && JLanguageAssociations::isEnabled()) { // Adding self to the association $associations = isset($data['associations']) ? $data['associations'] : array(); @@ -1541,6 +1608,12 @@ public function setHome(&$pks, $value = 1) unset($pks[$i]); JError::raiseNotice(403, JText::_('COM_MENUS_ERROR_ALREADY_HOME')); } + elseif ($table->menutype == 'main' || $table->menutype == 'menu') + { + // Prune items that you can't change. + unset($pks[$i]); + JError::raiseWarning(403, JText::_('COM_MENUS_ERROR_MENUTYPE_HOME')); + } else { $table->home = $value; diff --git a/administrator/components/com_menus/models/items.php b/administrator/components/com_menus/models/items.php index 7fc2e735290f5..655c658071713 100644 --- a/administrator/components/com_menus/models/items.php +++ b/administrator/components/com_menus/models/items.php @@ -108,49 +108,58 @@ protected function populateState($ordering = 'a.lft', $direction = 'asc') $level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level'); $this->setState('filter.level', $level); + // Watch changes in client_id and menutype and keep sync whenever needed. + $currentClientId = $app->getUserState($this->context . '.client_id', 0); + $clientId = $app->input->getInt('client_id', $currentClientId); + $currentMenuType = $app->getUserState($this->context . '.menutype', ''); $menuType = $app->input->getString('menutype', $currentMenuType); - // If selected menu type different from current menu type reset pagination to 0 - if ($menuType != $currentMenuType) + // If client_id changed clear menutype and reset pagination + if ($clientId != $currentClientId) { + $menuType = ''; + $app->input->set('limitstart', 0); + $app->input->set('menutype', ''); } - if ($menuType) + // If menutype changed reset pagination. + if ($menuType != $currentMenuType) { - $db = $this->getDbo(); - $query = $db->getQuery(true) - ->select($db->qn(array('id', 'title'))) - ->from($db->qn('#__menu_types')) - ->where($db->qn('menutype') . ' = ' . $db->q($menuType)); - - $menuTypeItem = $db->setQuery($query)->loadObject(); - - // Check if menu type exists. - if (!$menuTypeItem) - { - $this->setError(JText::_('COM_MENUS_ERROR_MENUTYPE_NOT_FOUND')); - } - // Check if menu type was changed and if valid agains ACL - elseif ($user->authorise('core.manage', 'com_menus.menu.' . $menuTypeItem->id)) - { - $app->setUserState($this->context . '.menutype', $menuType); - $this->setState('menutypetitle', !empty($menuTypeItem->title) ? $menuTypeItem->title : ''); - $this->setState('menutypeid', !empty($menuTypeItem->id) ? $menuTypeItem->id : ''); - } - // Nope, not valid - else - { - $this->setError(JText::_('JERROR_ALERTNOAUTHOR')); - } + $app->input->set('limitstart', 0); } - else + + if (!$menuType) { $app->setUserState($this->context . '.menutype', ''); $this->setState('menutypetitle', ''); $this->setState('menutypeid', ''); } + // Special menu types, if selected explicitly, will be allowed as a filter + elseif ($menuType == 'main' || $menuType == 'menu') + { + // Adjust client_id to match the menutype. This is safe as client_id was not changed in this request. + $app->input->set('client_id', 1); + + $app->setUserState($this->context . '.menutype', $menuType); + $this->setState('menutypetitle', ucfirst($menuType)); + $this->setState('menutypeid', -1); + } + // Get the menutype object with appropriate checks. + elseif ($cMenu = $this->getMenu($menuType, true)) + { + // Adjust client_id to match the menutype. This is safe as client_id was not changed in this request. + $app->input->set('client_id', $cMenu->client_id); + + $app->setUserState($this->context . '.menutype', $menuType); + $this->setState('menutypetitle', $cMenu->title); + $this->setState('menutypeid', $cMenu->id); + } + + // Client id filter + $clientId = (int) $this->getUserStateFromRequest($this->context . '.client_id', 'client_id', 0, 'int'); + $this->setState('filter.client_id', $clientId); $this->setState('filter.menutype', $menuType); @@ -193,6 +202,7 @@ protected function getStoreId($id = '') $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.parent_id'); $id .= ':' . $this->getState('filter.menutype'); + $id .= ':' . $this->getState('filter.client_id'); return parent::getStoreId($id); } @@ -282,7 +292,7 @@ protected function getListQuery() // Exclude the root category. $query->where('a.id > 1') - ->where('a.client_id = 0'); + ->where('a.client_id = ' . (int) $this->getState('filter.client_id')); // Filter on the published state. $published = $this->getState('filter.published'); @@ -293,7 +303,7 @@ protected function getListQuery() } elseif ($published === '') { - $query->where('(a.published IN (0, 1))'); + $query->where('a.published IN (0, 1)'); } // Filter by search in title, alias or id @@ -329,30 +339,31 @@ protected function getListQuery() // Filter the items over the menu id if set. $menuType = $this->getState('filter.menutype'); - // "" means all + // A value "" means all if ($menuType == '') { // Load all menu types we have manage access $query2 = $this->getDbo()->getQuery(true) ->select($this->getDbo()->qn(array('id', 'menutype'))) ->from('#__menu_types') + ->where('client_id = ' . (int) $this->getState('filter.client_id')) ->order('title'); $menuTypes = $this->getDbo()->setQuery($query2)->loadObjectList(); - $types = array(); - - foreach ($menuTypes as $type) + if ($menuTypes) { - if ($user->authorise('core.manage', 'com_menus.menu.' . (int) $type->id)) + $types = array(); + + foreach ($menuTypes as $type) { - $types[] = $query->q($type->menutype); + if ($user->authorise('core.manage', 'com_menus.menu.' . (int) $type->id)) + { + $types[] = $query->q($type->menutype); + } } - } - if (!empty($types)) - { - $query->where('a.menutype IN(' . implode(',', $types) . ')'); + $query->where($types ? 'a.menutype IN(' . implode(',', $types) . ')' : 0); } } // Default behavior => load all items from a specific menu @@ -400,4 +411,108 @@ protected function getListQuery() return $query; } + + /** + * Method to allow derived classes to preprocess the form. + * + * @param JForm $form A JForm object. + * @param mixed $data The data expected for the form. + * @param string $group The name of the plugin group to import (defaults to "content"). + * + * @return void + * + * @since 3.2 + * @throws Exception if there is an error in the form event. + */ + protected function preprocessForm(JForm $form, $data, $group = 'content') + { + $name = $form->getName(); + + if ($name == 'com_menus.items.filter') + { + $clientId = $this->getState('filter.client_id'); + $form->setFieldAttribute('menutype', 'clientid', $clientId); + } + elseif (false !== strpos($name, 'com_menus.items.modal.')) + { + $form->removeField('client_id'); + + $clientId = $this->getState('filter.client_id'); + $form->setFieldAttribute('menutype', 'clientid', $clientId); + } + } + + /** + * Get the client id for a menu + * + * @param string $menuType The menutype identifier for the menu + * @param bool $check Flag whether to perform check against ACL as well as existence + * + * @return int + * + * @since __DEPLOY_VERSION__ + */ + protected function getMenu($menuType, $check = false) + { + $query = $this->_db->getQuery(true); + + $query->select('a.*') + ->from($this->_db->qn('#__menu_types', 'a')) + ->where('menutype = ' . $this->_db->q($menuType)); + + $cMenu = $this->_db->setQuery($query)->loadObject(); + + if ($check) + { + // Check if menu type exists. + if (!$cMenu) + { + $this->setError(JText::_('COM_MENUS_ERROR_MENUTYPE_NOT_FOUND')); + } + // Check if menu type is valid against ACL. + elseif (!JFactory::getUser()->authorise('core.manage', 'com_menus.menu.' . $cMenu->id)) + { + $this->setError(JText::_('JERROR_ALERTNOAUTHOR')); + } + } + + return $cMenu; + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * + * @since 12.2 + */ + public function getItems() + { + $store = $this->getStoreId(); + + if (!isset($this->cache[$store])) + { + $items = parent::getItems(); + $lang = JFactory::getLanguage(); + + if ($items) + { + foreach ($items as $item) + { + if ($extension = $item->componentname) + { + $lang->load("$extension.sys", JPATH_ADMINISTRATOR, null, false, true) + || $lang->load("$extension.sys", JPATH_ADMINISTRATOR . '/components/' . $extension, null, false, true); + } + + // Translate component name + $item->title = JText::_($item->title); + } + } + + $this->cache[$store] = $items; + } + + return $this->cache[$store]; + } } diff --git a/administrator/components/com_menus/models/menus.php b/administrator/components/com_menus/models/menus.php index c8d7cbc77ce87..6c7f8e6dc566e 100644 --- a/administrator/components/com_menus/models/menus.php +++ b/administrator/components/com_menus/models/menus.php @@ -34,6 +34,7 @@ public function __construct($config = array()) 'id', 'a.id', 'title', 'a.title', 'menutype', 'a.menutype', + 'client_id', 'a.client_id', ); } @@ -138,9 +139,9 @@ public function getItems() // Inject the values back into the array. foreach ($items as $item) { - $item->count_published = isset($countPublished[$item->menutype]) ? $countPublished[$item->menutype] : 0; + $item->count_published = isset($countPublished[$item->menutype]) ? $countPublished[$item->menutype] : 0; $item->count_unpublished = isset($countUnpublished[$item->menutype]) ? $countUnpublished[$item->menutype] : 0; - $item->count_trashed = isset($countTrashed[$item->menutype]) ? $countTrashed[$item->menutype] : 0; + $item->count_trashed = isset($countTrashed[$item->menutype]) ? $countTrashed[$item->menutype] : 0; } // Add the items to the internal cache. @@ -163,10 +164,12 @@ protected function getListQuery() $query = $db->getQuery(true); // Select all fields from the table. - $query->select($this->getState('list.select', 'a.id, a.menutype, a.title, a.description')) + $query->select($this->getState('list.select', 'a.id, a.menutype, a.title, a.description, a.client_id')) ->from($db->quoteName('#__menu_types') . ' AS a') ->where('a.id > 0'); + $query->where('a.client_id = ' . (int) $this->getState('client_id')); + // Filter by search in title or menutype if ($search = trim($this->getState('filter.search'))) { @@ -194,9 +197,12 @@ protected function getListQuery() */ protected function populateState($ordering = 'a.title', $direction = 'asc') { - $search = $this->getUserStateFromRequest($this->context . '.search', 'filter_search'); + $search = $this->getUserStateFromRequest($this->context . '.search', 'filter_search'); $this->setState('filter.search', $search); + $clientId = (int) $this->getUserStateFromRequest($this->context . '.client_id', 'client_id', 0, 'int'); + $this->setState('client_id', $clientId); + // List state information. parent::populateState($ordering, $direction); } @@ -210,13 +216,13 @@ protected function populateState($ordering = 'a.title', $direction = 'asc') */ public function getModMenuId() { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('e.extension_id') ->from('#__extensions AS e') ->where('e.type = ' . $db->quote('module')) ->where('e.element = ' . $db->quote('mod_menu')) - ->where('e.client_id = 0'); + ->where('e.client_id = ' . (int) $this->getState('client_id')); $db->setQuery($query); return $db->loadResult(); diff --git a/administrator/components/com_menus/models/menutypes.php b/administrator/components/com_menus/models/menutypes.php index 85e429b2db640..79aab9ed78b6c 100644 --- a/administrator/components/com_menus/models/menutypes.php +++ b/administrator/components/com_menus/models/menutypes.php @@ -25,6 +25,28 @@ class MenusModelMenutypes extends JModelLegacy */ protected $rlu = array(); + /** + * Method to auto-populate the model state. + * + * This method should only be called once per instantiation and is designed + * to be called on the first call to the getState() method unless the model + * configuration flag to ignore the request is set. + * + * @return void + * + * @note Calling getState in this method will result in recursion. + * @since 12.2 + */ + protected function populateState() + { + parent::populateState(); + + $app = JFactory::getApplication(); + $clientId = $app->input->get('client_id', 0); + + $this->state->set('client_id', $clientId); + } + /** * Method to get the reverse lookup of the base link URL to Title * @@ -57,7 +79,7 @@ public function getTypeOptions() $list = array(); // Get the list of components. - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('name, element AS ' . $db->quoteName('option')) ->from('#__extensions') @@ -69,7 +91,9 @@ public function getTypeOptions() foreach ($components as $component) { - if ($options = $this->getTypeOptionsByComponent($component->option)) + $options = $this->getTypeOptionsByComponent($component->option); + + if ($options) { $list[$component->name] = $options; @@ -124,8 +148,8 @@ public function addReverseLookupUrl($option) protected function getTypeOptionsByComponent($component) { $options = array(); - - $mainXML = JPATH_SITE . '/components/' . $component . '/metadata.xml'; + $client = JApplicationHelper::getClientInfo($this->getState('client_id')); + $mainXML = $client->path . '/components/' . $component . '/metadata.xml'; if (is_file($mainXML)) { @@ -137,6 +161,11 @@ protected function getTypeOptionsByComponent($component) $options = $this->getTypeOptionsFromMvc($component); } + if ($client->id == 1 && empty($options)) + { + $options = $this->getTypeOptionsFromManifest($component); + } + return $options; } @@ -146,7 +175,7 @@ protected function getTypeOptionsByComponent($component) * @param string $file File path * @param string $component Component option as in URL * - * @return array + * @return array|bool * * @since 1.6 */ @@ -199,31 +228,29 @@ protected function getTypeOptionsFromXml($file, $component) { return false; } - else + + // Process each child as an option. + foreach ($children as $child) { - // Process each child as an option. - foreach ($children as $child) + if ($child->getName() == 'option') { - if ($child->getName() == 'option') - { - // Create the menu option for the component. - $o = new JObject; - $o->title = (string) $child['name']; - $o->description = (string) $child['msg']; - $o->request = array('option' => $component, (string) $optionsNode['var'] => (string) $child['value']); + // Create the menu option for the component. + $o = new JObject; + $o->title = (string) $child['name']; + $o->description = (string) $child['msg']; + $o->request = array('option' => $component, (string) $optionsNode['var'] => (string) $child['value']); - $options[] = $o; - } - elseif ($child->getName() == 'default') - { - // Create the menu option for the component. - $o = new JObject; - $o->title = (string) $child['name']; - $o->description = (string) $child['msg']; - $o->request = array('option' => $component); + $options[] = $o; + } + elseif ($child->getName() == 'default') + { + // Create the menu option for the component. + $o = new JObject; + $o->title = (string) $child['name']; + $o->description = (string) $child['msg']; + $o->request = array('option' => $component); - $options[] = $o; - } + $options[] = $o; } } @@ -235,18 +262,19 @@ protected function getTypeOptionsFromXml($file, $component) * * @param string $component Component option like in URLs * - * @return array + * @return array|bool * * @since 1.6 */ protected function getTypeOptionsFromMvc($component) { $options = array(); + $client = JApplicationHelper::getClientInfo($this->getState('client_id')); // Get the views for this component. - if (is_dir(JPATH_SITE . '/components/' . $component)) + if (is_dir($client->path . '/components/' . $component)) { - $folders = JFolder::folders(JPATH_SITE . '/components/' . $component, '^view[s]?$', false, true); + $folders = JFolder::folders($client->path . '/components/' . $component, '^view[s]?$', false, true); } $path = ''; @@ -344,6 +372,104 @@ protected function getTypeOptionsFromMvc($component) return $options; } + /** + * Get menu types from Component manifest + * + * @param string $component Component option like in URLs + * + * @return array|bool + * + * @since __DEPLOY_VERSION__ + */ + protected function getTypeOptionsFromManifest($component) + { + // Load the component manifest + $fileName = JPATH_ADMINISTRATOR . '/components/' . $component . '/' . str_replace('com_', '', $component) . '.xml'; + + if (!is_file($fileName)) + { + return false; + } + + if (!($manifest = simplexml_load_file($fileName))) + { + return false; + } + + // Check for a valid XML root tag. + if ($manifest->getName() != 'extension') + { + return false; + } + + $options = array(); + + // Start with the component root menu. + $rootMenu = $manifest->administration->menu; + + // If the menu item doesn't exist or is hidden do nothing. + if (!$rootMenu || in_array((string) $rootMenu['hidden'], array('true', 'hidden'))) + { + return $options; + } + + // Create the root menu option. + $ro = new stdClass; + $ro->title = (string) trim($rootMenu); + $ro->description = ''; + $ro->request = array('option' => $component); + + // Process submenu options. + $submenu = $manifest->administration->submenu; + + if (!$submenu) + { + return $options; + } + + foreach ($submenu->menu as $child) + { + $attributes = $child->attributes(); + + $o = new stdClass; + $o->title = (string) trim($child); + $o->description = ''; + + if ((string) $attributes->link) + { + parse_str((string) $attributes->link, $request); + } + else + { + $request = array(); + + $request['option'] = $component; + $request['act'] = (string) $attributes->act; + $request['task'] = (string) $attributes->task; + $request['controller'] = (string) $attributes->controller; + $request['view'] = (string) $attributes->view; + $request['layout'] = (string) $attributes->layout; + $request['sub'] = (string) $attributes->sub; + } + + $o->request = array_filter($request, 'strlen'); + $options[] = new JObject($o); + + // Do not repeat the default view link (index.php?option=com_abc). + if (count($o->request) == 1) + { + $ro = null; + } + } + + if ($ro) + { + $options[] = new JObject($ro); + } + + return $options; + } + /** * Get the menu types from component layouts * @@ -361,11 +487,12 @@ protected function getTypeOptionsFromLayouts($component, $view) $layoutNames = array(); $lang = JFactory::getLanguage(); $path = ''; + $client = JApplicationHelper::getClientInfo($this->getState('client_id')); // Get the views for this component. - if (is_dir(JPATH_SITE . '/components/' . $component)) + if (is_dir($client->path . '/components/' . $component)) { - $folders = JFolder::folders(JPATH_SITE . '/components/' . $component, '^view[s]?$', false, true); + $folders = JFolder::folders($client->path . '/components/' . $component, '^view[s]?$', false, true); } if (!empty($folders[0])) @@ -395,7 +522,7 @@ protected function getTypeOptionsFromLayouts($component, $view) // Get the template layouts // TODO: This should only search one template -- the current template for this item (default of specified) - $folders = JFolder::folders(JPATH_SITE . '/templates', '', false, true); + $folders = JFolder::folders($client->path . '/templates', '', false, true); // Array to hold association between template file names and templates $templateName = array(); @@ -405,8 +532,8 @@ protected function getTypeOptionsFromLayouts($component, $view) if (is_dir($folder . '/html/' . $component . '/' . $view)) { $template = basename($folder); - $lang->load('tpl_' . $template . '.sys', JPATH_SITE, null, false, true) - || $lang->load('tpl_' . $template . '.sys', JPATH_SITE . '/templates/' . $template, null, false, true); + $lang->load('tpl_' . $template . '.sys', $client->path, null, false, true) + || $lang->load('tpl_' . $template . '.sys', $client->path . '/templates/' . $template, null, false, true); $templateLayouts = JFolder::files($folder . '/html/' . $component . '/' . $view, '.xml$', false, true); diff --git a/administrator/components/com_menus/views/item/tmpl/edit.php b/administrator/components/com_menus/views/item/tmpl/edit.php index de72294593e76..12cd2122a5806 100644 --- a/administrator/components/com_menus/views/item/tmpl/edit.php +++ b/administrator/components/com_menus/views/item/tmpl/edit.php @@ -87,12 +87,12 @@ // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration($script); // In case of modal -$isModal = $input->get('layout') == 'modal' ? true : false; -$layout = $isModal ? 'modal' : 'edit'; -$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : ''; +$isModal = $input->get('layout') == 'modal' ? true : false; +$layout = $isModal ? 'modal' : 'edit'; +$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : ''; +$clientId = $this->state->get('item.client_id', 0); ?> - -
+ @@ -129,6 +129,7 @@ // Set main fields. $this->fields = array( 'id', + 'client_id', 'menutype', 'parent_id', 'menuordering', @@ -143,8 +144,8 @@ { $this->fields = array_diff($this->fields, array('home')); } - ?> - + + echo JLayoutHelper::render('joomla.edit.global', $this); ?> @@ -155,14 +156,14 @@ echo JLayoutHelper::render('joomla.edit.params', $this); ?> - + state->get('item.client_id') != 1) : ?> item->type !== 'alias' && $this->item->type !== 'url' && $this->item->type !== 'separator' && $this->item->type !== 'heading') : ?> loadTemplate('associations'); ?> - + state->get('item.client_id') != 1) : ?> diff --git a/administrator/components/com_menus/views/item/tmpl/edit.xml b/administrator/components/com_menus/views/item/tmpl/edit.xml new file mode 100755 index 0000000000000..d1408e7e1b3e0 --- /dev/null +++ b/administrator/components/com_menus/views/item/tmpl/edit.xml @@ -0,0 +1,21 @@ + + + + + + + +
+ + + + + +
+
diff --git a/administrator/components/com_menus/views/item/view.html.php b/administrator/components/com_menus/views/item/view.html.php index c1b4c88107780..019f23567ebc3 100644 --- a/administrator/components/com_menus/views/item/view.html.php +++ b/administrator/components/com_menus/views/item/view.html.php @@ -36,6 +36,11 @@ class MenusViewItem extends JViewLegacy */ protected $state; + /** + * @var JObject + */ + protected $canDo; + /** * Display the view * @@ -49,11 +54,11 @@ public function display($tpl = null) { $user = JFactory::getUser(); + $this->state = $this->get('State'); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->modules = $this->get('Modules'); $this->levels = $this->get('ViewLevels'); - $this->state = $this->get('State'); $this->canDo = JHelperContent::getActions('com_menus', 'menu', (int) $this->state->get('item.menutypeid')); // Check if we're allowed to edit this item @@ -68,7 +73,7 @@ public function display($tpl = null) { JError::raiseError(500, implode("\n", $errors)); - return false; + return; } // If we are forcing a language in modal (used for associations). diff --git a/administrator/components/com_menus/views/items/tmpl/default.php b/administrator/components/com_menus/views/items/tmpl/default.php index aca7ccb8e0670..f39e7eb9024fb 100644 --- a/administrator/components/com_menus/views/items/tmpl/default.php +++ b/administrator/components/com_menus/views/items/tmpl/default.php @@ -31,8 +31,8 @@ JHtml::_('sortablelist.sortable', 'itemList', 'adminForm', strtolower($listDirn), $saveOrderingUrl, false, true); } -$assoc = JLanguageAssociations::isEnabled(); -$colSpan = ($assoc) ? 10 : 9; +$assoc = JLanguageAssociations::isEnabled() && $this->state->get('filter.client_id') == 0; +$colSpan = $assoc ? 10 : 9; if ($menuType == '') { @@ -71,9 +71,11 @@ + state->get('filter.client_id') == 0): ?> + @@ -171,7 +173,7 @@ checked_out) : ?> editor, $item->checked_out_time, 'items.', $canCheckin); ?> - + protected) : ?> escape($item->title); ?> @@ -196,12 +198,13 @@ - escape($item->menutype_title); ?> + escape($item->menutype_title ?: ucwords($item->menutype)); ?> + state->get('filter.client_id') == 0): ?> type == 'component') : ?> language == '*' || $item->home == '0') : ?> - home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange); ?> + home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange && !$item->protected); ?> language_image) : ?> @@ -219,6 +222,7 @@ + escape($item->access_level); ?> diff --git a/administrator/components/com_menus/views/items/tmpl/default.xml b/administrator/components/com_menus/views/items/tmpl/default.xml new file mode 100755 index 0000000000000..24144a99341b2 --- /dev/null +++ b/administrator/components/com_menus/views/items/tmpl/default.xml @@ -0,0 +1,21 @@ + + + + + + + +
+ + + + + +
+
diff --git a/administrator/components/com_menus/views/items/view.html.php b/administrator/components/com_menus/views/items/view.html.php index 616bf546b8b7d..bace94afeacdd 100644 --- a/administrator/components/com_menus/views/items/view.html.php +++ b/administrator/components/com_menus/views/items/view.html.php @@ -47,7 +47,6 @@ class MenusViewItems extends JViewLegacy */ public function display($tpl = null) { - $user = JFactory::getUser(); $lang = JFactory::getLanguage(); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); @@ -207,6 +206,7 @@ public function display($tpl = null) } $item->item_type = $value; + $item->protected = $item->menutype == 'main' || $item->menutype == 'menu'; } // Levels filter. @@ -284,7 +284,9 @@ protected function addToolbar() JToolbarHelper::addNew('item.add'); } - if ($canDo->get('core.edit')) + $m = $this->state->get('filter.menutype'); + + if ($canDo->get('core.edit') && ($m != 'main' && $m != 'menu')) { JToolbarHelper::editList('item.edit'); } @@ -300,7 +302,7 @@ protected function addToolbar() JToolbarHelper::checkin('items.checkin', 'JTOOLBAR_CHECKIN', true); } - if ($canDo->get('core.edit.state')) + if ($canDo->get('core.edit.state') && $this->state->get('filter.client_id') == 0) { JToolbarHelper::makeDefault('items.setDefault', 'COM_MENUS_TOOLBAR_SET_HOME'); } diff --git a/administrator/components/com_menus/views/menu/tmpl/edit.php b/administrator/components/com_menus/views/menu/tmpl/edit.php index ca398e15cc4fe..80d88e941df71 100644 --- a/administrator/components/com_menus/views/menu/tmpl/edit.php +++ b/administrator/components/com_menus/views/menu/tmpl/edit.php @@ -30,9 +30,9 @@ "); ?> - + - +
'details')); ?> @@ -53,6 +53,14 @@ form->getInput('description'); ?>
+
+
+ form->getLabel('client_id'); ?> +
+
+ form->getInput('client_id'); ?> +
+
canDo->get('core.admin')) : ?> diff --git a/administrator/components/com_menus/views/menu/tmpl/edit.xml b/administrator/components/com_menus/views/menu/tmpl/edit.xml new file mode 100755 index 0000000000000..9765a0da2026c --- /dev/null +++ b/administrator/components/com_menus/views/menu/tmpl/edit.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_menus/views/menus/tmpl/default.xml b/administrator/components/com_menus/views/menus/tmpl/default.xml new file mode 100755 index 0000000000000..7a64aba93deef --- /dev/null +++ b/administrator/components/com_menus/views/menus/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_menus/views/menutypes/tmpl/default.php b/administrator/components/com_menus/views/menutypes/tmpl/default.php index 23aea535c9722..781308a99736e 100644 --- a/administrator/components/com_menus/views/menutypes/tmpl/default.php +++ b/administrator/components/com_menus/views/menutypes/tmpl/default.php @@ -41,8 +41,8 @@ $this->recordId, 'title' => (isset($item->type) ? $item->type : $item->title), 'request' => $item->request); ?>
- + onclick="setmenutype('')"> + description); ?> diff --git a/administrator/components/com_menus/views/menutypes/view.html.php b/administrator/components/com_menus/views/menutypes/view.html.php index 0823e0c189b21..4a9cf300f83dc 100644 --- a/administrator/components/com_menus/views/menutypes/view.html.php +++ b/administrator/components/com_menus/views/menutypes/view.html.php @@ -16,6 +16,11 @@ */ class MenusViewMenutypes extends JViewLegacy { + /** + * @var JObject[] + */ + protected $types; + /** * Display the view * @@ -27,40 +32,12 @@ class MenusViewMenutypes extends JViewLegacy */ public function display($tpl = null) { - $input = JFactory::getApplication()->input; - $this->recordId = $input->getInt('recordId'); - $types = $this->get('TypeOptions'); + $app = JFactory::getApplication(); + $this->recordId = $app->input->getInt('recordId'); - // Adding System Links - $list = array(); - $o = new JObject; - $o->title = 'COM_MENUS_TYPE_EXTERNAL_URL'; - $o->type = 'url'; - $o->description = 'COM_MENUS_TYPE_EXTERNAL_URL_DESC'; - $o->request = null; - $list[] = $o; - - $o = new JObject; - $o->title = 'COM_MENUS_TYPE_ALIAS'; - $o->type = 'alias'; - $o->description = 'COM_MENUS_TYPE_ALIAS_DESC'; - $o->request = null; - $list[] = $o; - - $o = new JObject; - $o->title = 'COM_MENUS_TYPE_SEPARATOR'; - $o->type = 'separator'; - $o->description = 'COM_MENUS_TYPE_SEPARATOR_DESC'; - $o->request = null; - $list[] = $o; + $types = $this->get('TypeOptions'); - $o = new JObject; - $o->title = 'COM_MENUS_TYPE_HEADING'; - $o->type = 'heading'; - $o->description = 'COM_MENUS_TYPE_HEADING_DESC'; - $o->request = null; - $list[] = $o; - $types['COM_MENUS_TYPE_SYSTEM'] = $list; + $this->addCustomTypes($types); $sortedTypes = array(); @@ -108,4 +85,53 @@ protected function addToolbar() $title"; $bar->appendButton('Custom', $dhtml, 'new'); } + + /** + * Method to add system link types to the link types array + * + * @param array &$types The list of link types + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function addCustomTypes(&$types) + { + if (empty($types)) + { + $types = array(); + } + + // Adding System Links + $list = array(); + $o = new JObject; + $o->title = 'COM_MENUS_TYPE_EXTERNAL_URL'; + $o->type = 'url'; + $o->description = 'COM_MENUS_TYPE_EXTERNAL_URL_DESC'; + $o->request = null; + $list[] = $o; + + $o = new JObject; + $o->title = 'COM_MENUS_TYPE_ALIAS'; + $o->type = 'alias'; + $o->description = 'COM_MENUS_TYPE_ALIAS_DESC'; + $o->request = null; + $list[] = $o; + + $o = new JObject; + $o->title = 'COM_MENUS_TYPE_SEPARATOR'; + $o->type = 'separator'; + $o->description = 'COM_MENUS_TYPE_SEPARATOR_DESC'; + $o->request = null; + $list[] = $o; + + $o = new JObject; + $o->title = 'COM_MENUS_TYPE_HEADING'; + $o->type = 'heading'; + $o->description = 'COM_MENUS_TYPE_HEADING_DESC'; + $o->request = null; + $list[] = $o; + + $types['COM_MENUS_TYPE_SYSTEM'] = $list; + } } diff --git a/administrator/components/com_modules/views/modules/tmpl/default.xml b/administrator/components/com_modules/views/modules/tmpl/default.xml new file mode 100755 index 0000000000000..4d323670bbf5b --- /dev/null +++ b/administrator/components/com_modules/views/modules/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_plugins/views/plugins/tmpl/default.xml b/administrator/components/com_plugins/views/plugins/tmpl/default.xml new file mode 100755 index 0000000000000..9d181a9f8de8f --- /dev/null +++ b/administrator/components/com_plugins/views/plugins/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_postinstall/views/messages/tmpl/default.xml b/administrator/components/com_postinstall/views/messages/tmpl/default.xml new file mode 100755 index 0000000000000..f4b7d57442f9d --- /dev/null +++ b/administrator/components/com_postinstall/views/messages/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_templates/views/styles/tmpl/default.xml b/administrator/components/com_templates/views/styles/tmpl/default.xml new file mode 100755 index 0000000000000..95ef7adba738f --- /dev/null +++ b/administrator/components/com_templates/views/styles/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_templates/views/templates/tmpl/default.xml b/administrator/components/com_templates/views/templates/tmpl/default.xml new file mode 100755 index 0000000000000..b867cf716c364 --- /dev/null +++ b/administrator/components/com_templates/views/templates/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/group/tmpl/edit.xml b/administrator/components/com_users/views/group/tmpl/edit.xml new file mode 100755 index 0000000000000..bcc58adfd9996 --- /dev/null +++ b/administrator/components/com_users/views/group/tmpl/edit.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/groups/tmpl/default.xml b/administrator/components/com_users/views/groups/tmpl/default.xml new file mode 100755 index 0000000000000..b5cccb8105263 --- /dev/null +++ b/administrator/components/com_users/views/groups/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/level/tmpl/edit.xml b/administrator/components/com_users/views/level/tmpl/edit.xml new file mode 100755 index 0000000000000..fc078486434e0 --- /dev/null +++ b/administrator/components/com_users/views/level/tmpl/edit.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/levels/tmpl/default.xml b/administrator/components/com_users/views/levels/tmpl/default.xml new file mode 100755 index 0000000000000..77c9428152f90 --- /dev/null +++ b/administrator/components/com_users/views/levels/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/mail/tmpl/default.xml b/administrator/components/com_users/views/mail/tmpl/default.xml new file mode 100755 index 0000000000000..075e0da043481 --- /dev/null +++ b/administrator/components/com_users/views/mail/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/note/tmpl/edit.xml b/administrator/components/com_users/views/note/tmpl/edit.xml new file mode 100755 index 0000000000000..7a6a20b60eadb --- /dev/null +++ b/administrator/components/com_users/views/note/tmpl/edit.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/notes/tmpl/default.xml b/administrator/components/com_users/views/notes/tmpl/default.xml new file mode 100755 index 0000000000000..a1a88fbd51920 --- /dev/null +++ b/administrator/components/com_users/views/notes/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/user/tmpl/edit.xml b/administrator/components/com_users/views/user/tmpl/edit.xml new file mode 100755 index 0000000000000..045a8e9a3c21b --- /dev/null +++ b/administrator/components/com_users/views/user/tmpl/edit.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/components/com_users/views/users/tmpl/default.xml b/administrator/components/com_users/views/users/tmpl/default.xml new file mode 100755 index 0000000000000..28b9faff51653 --- /dev/null +++ b/administrator/components/com_users/views/users/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/administrator/language/en-GB/en-GB.com_admin.sys.ini b/administrator/language/en-GB/en-GB.com_admin.sys.ini index ae7de2e601c06..f05285fdce0b3 100644 --- a/administrator/language/en-GB/en-GB.com_admin.sys.ini +++ b/administrator/language/en-GB/en-GB.com_admin.sys.ini @@ -5,3 +5,8 @@ COM_ADMIN="Administrator - System Information" COM_ADMIN_XML_DESCRIPTION="Administration system information component." + +COM_ADMIN_HELP_VIEW_DEFAULT_DESC="Get help regarding various pages in your Joomla administrator interface." +COM_ADMIN_HELP_VIEW_DEFAULT_TITLE="Joomla! Help" +COM_ADMIN_SYSINFO_VIEW_DEFAULT_DESC="View detailed information about your Joomla site and server configuration settings." +COM_ADMIN_SYSINFO_VIEW_DEFAULT_TITLE="System Information" diff --git a/administrator/language/en-GB/en-GB.com_cache.sys.ini b/administrator/language/en-GB/en-GB.com_cache.sys.ini index 0e201b4d4cac6..ed51a4f33c0a2 100644 --- a/administrator/language/en-GB/en-GB.com_cache.sys.ini +++ b/administrator/language/en-GB/en-GB.com_cache.sys.ini @@ -5,3 +5,8 @@ COM_CACHE="Cache" COM_CACHE_XML_DESCRIPTION="Component for cache management." + +COM_CACHE_CACHE_VIEW_DEFAULT_DESC="" +COM_CACHE_CACHE_VIEW_DEFAULT_TITLE="Clear Cache" +COM_CACHE_PURGE_VIEW_DEFAULT_DESC="" +COM_CACHE_PURGE_VIEW_DEFAULT_TITLE="Clear Expired Cache" diff --git a/administrator/language/en-GB/en-GB.com_categories.sys.ini b/administrator/language/en-GB/en-GB.com_categories.sys.ini index e3e0aa219bd6a..9247455f43c0b 100644 --- a/administrator/language/en-GB/en-GB.com_categories.sys.ini +++ b/administrator/language/en-GB/en-GB.com_categories.sys.ini @@ -5,3 +5,10 @@ COM_CATEGORIES="Categories" COM_CATEGORIES_XML_DESCRIPTION="This component manages categories." + +COM_CATEGORIES_CATEGORIES_VIEW_DEFAULT_DESC="Shows a List of All categories in the selected component." +COM_CATEGORIES_CATEGORIES_VIEW_DEFAULT_TITLE="List All Categories" +COM_CATEGORIES_CATEGORY_VIEW_EDIT_DESC="Create a new Category in the selected component." +COM_CATEGORIES_CATEGORY_VIEW_EDIT_TITLE="Create New Category" +COM_CATEGORIES_CHOOSE_COMPONENT_DESC="Select a component to which this category should be linked." +COM_CATEGORIES_CHOOSE_COMPONENT_LABEL="Choose a Component" diff --git a/administrator/language/en-GB/en-GB.com_checkin.sys.ini b/administrator/language/en-GB/en-GB.com_checkin.sys.ini index fc1a900980b74..c1b1dd9c1b2ed 100644 --- a/administrator/language/en-GB/en-GB.com_checkin.sys.ini +++ b/administrator/language/en-GB/en-GB.com_checkin.sys.ini @@ -5,3 +5,6 @@ COM_CHECKIN="Check-in" COM_CHECKIN_XML_DESCRIPTION="Check-in Component" + +COM_CHECKIN_CHECKIN_VIEW_DEFAULT_DESC="Shows a list of checked out items from all components/tables." +COM_CHECKIN_CHECKIN_VIEW_DEFAULT_TITLE="Global Check-in" diff --git a/administrator/language/en-GB/en-GB.com_config.sys.ini b/administrator/language/en-GB/en-GB.com_config.sys.ini index 6025e3a678812..3fe6c96073ecb 100644 --- a/administrator/language/en-GB/en-GB.com_config.sys.ini +++ b/administrator/language/en-GB/en-GB.com_config.sys.ini @@ -5,7 +5,10 @@ COM_CONFIG="Configuration Manager" COM_CONFIG_XML_DESCRIPTION="Configuration Manager" + +COM_CONFIG_COMPONENT_VIEW_DEFAULT_DESC="Dislay the configuration options for the selected component." +COM_CONFIG_COMPONENT_VIEW_DEFAULT_TITLE="Component Configuration Options" COM_CONFIG_CONFIG_VIEW_DEFAULT_DESC="Displays basic site configuration options." -COM_CONFIG_CONFIG_VIEW_DEFAULT_TITLE="Display Site Configuration Options" +COM_CONFIG_CONFIG_VIEW_DEFAULT_TITLE="Site Configuration Options" COM_CONFIG_TEMPLATES_VIEW_DEFAULT_DESC="Displays template parameter options if the template allows this." COM_CONFIG_TEMPLATES_VIEW_DEFAULT_TITLE="Display Template Options" diff --git a/administrator/language/en-GB/en-GB.com_content.sys.ini b/administrator/language/en-GB/en-GB.com_content.sys.ini index 80157151db210..de2003b689593 100644 --- a/administrator/language/en-GB/en-GB.com_content.sys.ini +++ b/administrator/language/en-GB/en-GB.com_content.sys.ini @@ -7,11 +7,15 @@ COM_CONTENT="Articles" COM_CONTENT_ARCHIVE_VIEW_DEFAULT_DESC="Display all archived articles." COM_CONTENT_ARCHIVE_VIEW_DEFAULT_OPTION="Default" COM_CONTENT_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" +COM_CONTENT_ARTICLES="Articles" +COM_CONTENT_ARTICLES_VIEW_DEFAULT_DESC="Shows a list of all the articles." +COM_CONTENT_ARTICLES_VIEW_DEFAULT_TITLE="List All Articles" COM_CONTENT_ARTICLE_MANAGER="Articles" COM_CONTENT_ARTICLE_VIEW_DEFAULT_DESC="Display a single article." COM_CONTENT_ARTICLE_VIEW_DEFAULT_OPTION="Default" COM_CONTENT_ARTICLE_VIEW_DEFAULT_TITLE="Single Article" -COM_CONTENT_ARTICLES="Articles" +COM_CONTENT_ARTICLE_VIEW_EDIT_DESC="Shows a form to create a New Article." +COM_CONTENT_ARTICLE_VIEW_EDIT_TITLE="Create an Article" COM_CONTENT_CATEGORIES="Categories" COM_CONTENT_CATEGORIES_VIEW_DEFAULT_DESC="Shows a list of all the article categories within a category." COM_CONTENT_CATEGORIES_VIEW_DEFAULT_OPTION="Default" diff --git a/administrator/language/en-GB/en-GB.com_cpanel.sys.ini b/administrator/language/en-GB/en-GB.com_cpanel.sys.ini index 71de81d3d968c..2a535faf4d8b5 100644 --- a/administrator/language/en-GB/en-GB.com_cpanel.sys.ini +++ b/administrator/language/en-GB/en-GB.com_cpanel.sys.ini @@ -5,3 +5,6 @@ COM_CPANEL="Control Panel" COM_CPANEL_XML_DESCRIPTION="Control Panel component." + +COM_CPANEL_CPANEL_VIEW_DEFAULT_TITLE="Control Panel" +COM_CPANEL_CPANEL_VIEW_DEFAULT_TITLE_DESC="Shows the Joomla! Administration Dashboard page." diff --git a/administrator/language/en-GB/en-GB.com_installer.sys.ini b/administrator/language/en-GB/en-GB.com_installer.sys.ini index e04cd920a5f25..f2c2f57250fdf 100644 --- a/administrator/language/en-GB/en-GB.com_installer.sys.ini +++ b/administrator/language/en-GB/en-GB.com_installer.sys.ini @@ -5,3 +5,20 @@ COM_INSTALLER="Installer" COM_INSTALLER_XML_DESCRIPTION="Installer component for adding, removing and upgrading extensions." + +COM_INSTALLER_DATABASE_VIEW_DEFAULT_DESC="Check and fix any database issues with your website." +COM_INSTALLER_DATABASE_VIEW_DEFAULT_TITLE="Check Database" +COM_INSTALLER_DISCOVER_VIEW_DEFAULT_DESC="Discover extensions that have not gone through the normal installation process." +COM_INSTALLER_DISCOVER_VIEW_DEFAULT_TITLE="Discover Extensions" +COM_INSTALLER_INSTALL_VIEW_DEFAULT_DESC="Install extensions into your Joomla! installation." +COM_INSTALLER_INSTALL_VIEW_DEFAULT_TITLE="Install Extensions" +COM_INSTALLER_LANGUAGES_VIEW_DEFAULT_DESC="Install Language packs into your Joomla! website." +COM_INSTALLER_LANGUAGES_VIEW_DEFAULT_TITLE="Install Languages" +COM_INSTALLER_MANAGE_VIEW_DEFAULT_DESC="Manage extension that are already installed on your Joomla! website." +COM_INSTALLER_MANAGE_VIEW_DEFAULT_TITLE="Manage Extensions" +COM_INSTALLER_UPDATESITES_VIEW_DEFAULT_DESC="Manage "_QQ_"Update Sites"_QQ_" for various installed extensions." +COM_INSTALLER_UPDATESITES_VIEW_DEFAULT_TITLE="Update Sites" +COM_INSTALLER_UPDATE_VIEW_DEFAULT_DESC="Find and Install updates for the installed extensions." +COM_INSTALLER_UPDATE_VIEW_DEFAULT_TITLE="Update Extensions" +COM_INSTALLER_WARNINGS_VIEW_DEFAULT_DESC="Displays warnings related to your installed extensions." +COM_INSTALLER_WARNINGS_VIEW_DEFAULT_TITLE="Warnings" diff --git a/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini b/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini index eac4a605ae179..e69a2e27fbbcd 100644 --- a/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini +++ b/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini @@ -5,3 +5,6 @@ COM_JOOMLAUPDATE="Joomla! Update" COM_JOOMLAUPDATE_XML_DESCRIPTION="One-click update to the latest Joomla release." + +COM_JOOMLAUPDATE_DEFAULT_VIEW_DEFAULT_DESC="Check for Joomla! updates and update your website with latest available release." +COM_JOOMLAUPDATE_DEFAULT_VIEW_DEFAULT_TITLE="View Joomla! Updates" diff --git a/administrator/language/en-GB/en-GB.com_languages.sys.ini b/administrator/language/en-GB/en-GB.com_languages.sys.ini index fd629041ee376..5646707ee7a9a 100644 --- a/administrator/language/en-GB/en-GB.com_languages.sys.ini +++ b/administrator/language/en-GB/en-GB.com_languages.sys.ini @@ -5,3 +5,10 @@ COM_LANGUAGES="Languages" COM_LANGUAGES_XML_DESCRIPTION="Component for language management." + +COM_LANGUAGES_INSTALLED_VIEW_DEFAULT_DESC="Displays language packs installed into your Joomla! website." +COM_LANGUAGES_INSTALLED_VIEW_DEFAULT_TITLE="Installed Languages" +COM_LANGUAGES_LANGUAGES_VIEW_DEFAULT_DESC="Create or manage content languages for your Joomla! website." +COM_LANGUAGES_LANGUAGES_VIEW_DEFAULT_TITLE="Content Languages" +COM_LANGUAGES_OVERRIDE_VIEW_DEFAULT_DESC="Here you assign custom text for a language key that you want to used instead of language pack default text." +COM_LANGUAGES_OVERRIDE_VIEW_DEFAULT_TITLE="Language Overrides" diff --git a/administrator/language/en-GB/en-GB.com_media.sys.ini b/administrator/language/en-GB/en-GB.com_media.sys.ini index 2a38f514599c1..da606784f52a2 100644 --- a/administrator/language/en-GB/en-GB.com_media.sys.ini +++ b/administrator/language/en-GB/en-GB.com_media.sys.ini @@ -5,3 +5,6 @@ COM_MEDIA="Media" COM_MEDIA_XML_DESCRIPTION="Component for managing site media." + +COM_MEDIA_MEDIA_VIEW_DEFAULT_DESC="Upload or manage images and other media files on you Joomla! website." +COM_MEDIA_MEDIA_VIEW_DEFAULT_TITLE="Media Manager" diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index c2da8c8f3c54f..7cd31f5436127 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -18,7 +18,8 @@ COM_MENUS_EDIT_MENUITEM="Edit Menu Item" COM_MENUS_EDIT_MODULE_SETTINGS="Edit module settings" COM_MENUS_ERROR_ALL_LANGUAGE_ASSOCIATED="A menu item set to All languages can't be associated. Associations have not been set." COM_MENUS_ERROR_ALREADY_HOME="Menu item already set to home." -COM_MENUS_ERROR_MENUTYPE="Please change the Menu type. The terms 'menu' and 'main' are reserved for Backend usage." +COM_MENUS_ERROR_MENUTYPE="Please change the Menu type. The terms 'menu' and 'main' are reserved for internal usage." +COM_MENUS_ERROR_MENUTYPE_HOME="The terms 'menu' and 'main' are reserved for internal usage." COM_MENUS_ERROR_MENUTYPE_NOT_FOUND="The Menu type doesn't exist." COM_MENUS_ERROR_ONE_HOME="Only one menu item can be a home link for each language." COM_MENUS_EXTENSION_PUBLISHED_DISABLED="Component disabled and menu item published." @@ -80,6 +81,10 @@ COM_MENUS_ITEM_FIELD_ASSIGNED_LABEL=" Menu" COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE="- No association -" COM_MENUS_ITEM_FIELD_BROWSERNAV_DESC="Target browser window when the menu item is selected." COM_MENUS_ITEM_FIELD_BROWSERNAV_LABEL="Target Window" +COM_MENUS_ITEM_FIELD_CLIENT_ID_DESC="Choose the client application menu" +COM_MENUS_ITEM_FIELD_CLIENT_ID_LABEL="Client" +COM_MENUS_ITEM_FIELD_COMPONENTS_CONTAINER_DESC="Choose whether this should be a container for the components menu created during installation of new components.

To hide any or all of those menu items from this container you can just unpublish them under the menu type: Main (protected)." +COM_MENUS_ITEM_FIELD_COMPONENTS_CONTAINER_LABEL="Component Menu Container" COM_MENUS_ITEM_FIELD_HIDE_UNASSIGNED="Hide Unassigned Modules" COM_MENUS_ITEM_FIELD_HIDE_UNASSIGNED_DESC="Show or hide modules unassigned to this menu item." COM_MENUS_ITEM_FIELD_HIDE_UNASSIGNED_LABEL="Unassigned Modules" @@ -136,6 +141,8 @@ COM_MENUS_ITEMS_UNSET_HOME="1 menu item successfully unset to home." COM_MENUS_LAYOUT_FEATURED_OPTIONS="Layout" COM_MENUS_LAYOUT_MENUTYPE_OPTIONS_LABEL="Menu Type" COM_MENUS_LINKTYPE_OPTIONS_LABEL="Link Type" +COM_MENUS_MENU_CLIENT_ID_LABEL="Client" +COM_MENUS_MENU_CLIENT_ID_DESC="Choose the client for which this menutype will be used." COM_MENUS_MENU_CONFIRM_DELETE="Are you sure you want to delete these menus? Confirming will delete the selected menu types, all their menu items and the associated menu modules." COM_MENUS_MENU_DESCRIPTION_DESC="A description about the purpose of the menu." COM_MENUS_MENU_DETAILS="Menu Details" @@ -145,9 +152,10 @@ COM_MENUS_MENU_MENUTYPE_LABEL="Menu Type" COM_MENUS_MENU_SAVE_SUCCESS="Menu successfully saved" COM_MENUS_MENU_SEARCH_FILTER="Search in Title or Menu type" COM_MENUS_MENU_SPRINTF="Menu: %s" +COM_MENUS_MENU_TYPE_PROTECTED_MENU_LABEL="Menu (Protected)" +COM_MENUS_MENU_TYPE_PROTECTED_MAIN_LABEL="Main (Protected)" COM_MENUS_TYPE_SYSTEM="System Links" COM_MENUS_MENU_TITLE_DESC="The title of the menu to display in the Administrator Menubar and lists." -COM_MENUS_MENU_TYPE_NOT_ALLOWED="This is a reserved menutype." COM_MENUS_MENUS_FILTER_SEARCH_DESC="Search in title and menu type." COM_MENUS_MENUS_FILTER_SEARCH_LABEL="Search Menus" COM_MENUS_PAGE_OPTIONS_LABEL="Page Display" diff --git a/administrator/language/en-GB/en-GB.com_menus.sys.ini b/administrator/language/en-GB/en-GB.com_menus.sys.ini index 9da0c4fbf1959..14a6169a1cc18 100644 --- a/administrator/language/en-GB/en-GB.com_menus.sys.ini +++ b/administrator/language/en-GB/en-GB.com_menus.sys.ini @@ -6,3 +6,13 @@ COM_MENUS="Menus" COM_MENUS_XML_DESCRIPTION="Component for creating menus." +COM_MENUS_ITEMS_CHOOSE_MENU_DESC="Choose a Menutype for the target page.

Not to be confused with the Menu under which this menu item will be assigned." +COM_MENUS_ITEMS_CHOOSE_MENU_LABEL="Choose a Menutype" +COM_MENUS_ITEMS_VIEW_DEFAULT_DESC="Shows a list of menu items" +COM_MENUS_ITEMS_VIEW_DEFAULT_TITLE="Menu Items" +COM_MENUS_ITEM_VIEW_EDIT_DESC="Shows a form to create a new menu item" +COM_MENUS_ITEM_VIEW_EDIT_TITLE="New Menu Item" +COM_MENUS_MENUS_VIEW_DEFAULT_DESC="Shows a list of Menu Types" +COM_MENUS_MENUS_VIEW_DEFAULT_TITLE="Menus" +COM_MENUS_MENU_VIEW_EDIT_DESC="Shows a form to create a new menu" +COM_MENUS_MENU_VIEW_EDIT_TITLE="New Menu" diff --git a/administrator/language/en-GB/en-GB.com_modules.sys.ini b/administrator/language/en-GB/en-GB.com_modules.sys.ini index 93053f2730a44..ef7198f949260 100644 --- a/administrator/language/en-GB/en-GB.com_modules.sys.ini +++ b/administrator/language/en-GB/en-GB.com_modules.sys.ini @@ -5,6 +5,8 @@ COM_MODULES="Modules" COM_MODULES_GENERAL="General" +COM_MODULES_MODULES_VIEW_DEFAULT_DESC="Shows a list of modules to manage" +COM_MODULES_MODULES_VIEW_DEFAULT_TITLE="Module Manager" COM_MODULES_REDIRECT_EDIT_DESC="Select if module editing should be opened in the site or administration interface." COM_MODULES_REDIRECT_EDIT_LABEL="Edit Module" COM_MODULES_XML_DESCRIPTION="Component for module management on the Backend." diff --git a/administrator/language/en-GB/en-GB.com_plugins.sys.ini b/administrator/language/en-GB/en-GB.com_plugins.sys.ini index 2050176950491..33ab25e666c95 100644 --- a/administrator/language/en-GB/en-GB.com_plugins.sys.ini +++ b/administrator/language/en-GB/en-GB.com_plugins.sys.ini @@ -5,3 +5,6 @@ COM_PLUGINS="Plugins" COM_PLUGINS_XML_DESCRIPTION="This component manages Joomla plugins." + +COM_PLUGINS_PLUGINS_VIEW_DEFAULT_DESC="Shows a list of plugins to manage" +COM_PLUGINS_PLUGINS_VIEW_DEFAULT_TITLE="Plugin Manager" diff --git a/administrator/language/en-GB/en-GB.com_postinstall.sys.ini b/administrator/language/en-GB/en-GB.com_postinstall.sys.ini index 0d778280d8596..f501b45a672ee 100644 --- a/administrator/language/en-GB/en-GB.com_postinstall.sys.ini +++ b/administrator/language/en-GB/en-GB.com_postinstall.sys.ini @@ -4,4 +4,7 @@ ; Note : All ini files need to be saved as UTF-8 COM_POSTINSTALL="Post-installation Messages" -COM_POSTINSTALL_XML_DESCRIPTION="Displays post-installation and post-upgrade messages for Joomla! and its extensions." \ No newline at end of file +COM_POSTINSTALL_XML_DESCRIPTION="Displays post-installation and post-upgrade messages for Joomla! and its extensions." + +COM_POSTINSTALL_MESSAGES_VIEW_DEFAULT_DESC="Displays post-installation and post-upgrade messages for Joomla! and its extensions." +COM_POSTINSTALL_MESSAGES_VIEW_DEFAULT_TITLE="Post-Installation Messages" diff --git a/administrator/language/en-GB/en-GB.com_templates.sys.ini b/administrator/language/en-GB/en-GB.com_templates.sys.ini index b7b0917ff469e..35f7d8e34dc98 100644 --- a/administrator/language/en-GB/en-GB.com_templates.sys.ini +++ b/administrator/language/en-GB/en-GB.com_templates.sys.ini @@ -5,3 +5,8 @@ COM_TEMPLATES="Templates" COM_TEMPLATES_XML_DESCRIPTION="This component manages templates." + +COM_TEMPLATES_STYLE_VIEW_DEFAULT_DESC="Shows a List of Template styles" +COM_TEMPLATES_STYLE_VIEW_DEFAULT_TITLE="Template Styles" +COM_TEMPLATES_TEMPLATES_VIEW_DEFAULT_DESC="Shows a List of Installed Templates" +COM_TEMPLATES_TEMPLATES_VIEW_DEFAULT_TITLE="Templates" diff --git a/administrator/language/en-GB/en-GB.com_users.sys.ini b/administrator/language/en-GB/en-GB.com_users.sys.ini index d19ebe20ab263..7797cece1a16a 100644 --- a/administrator/language/en-GB/en-GB.com_users.sys.ini +++ b/administrator/language/en-GB/en-GB.com_users.sys.ini @@ -3,9 +3,31 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -COM_USERS_CONTENT_TYPE_USER="User" -COM_USERS_CONTENT_TYPE_NOTE="User Notes" +COM_USERS="Users" +COM_USERS_XML_DESCRIPTION="Component for managing users." + COM_USERS_CONTENT_TYPE_CATEGORY="User Notes Category" +COM_USERS_CONTENT_TYPE_NOTE="User Notes" +COM_USERS_CONTENT_TYPE_USER="User" +COM_USERS_GROUPS_VIEW_DEFAULT_DESC="Shows a List of User Groups" +COM_USERS_GROUPS_VIEW_DEFAULT_TITLE="User Groups" +COM_USERS_GROUP_VIEW_EDIT_DESC="Shows a form to create a new User Group" +COM_USERS_GROUP_VIEW_EDIT_TITLE="Create User Group" +COM_USERS_LEVELS_VIEW_DEFAULT_DESC="Shows a List of Access Levels" +COM_USERS_LEVELS_VIEW_DEFAULT_TITLE="Access Levels" +COM_USERS_LEVEL_VIEW_EDIT_DESC="Shows a form to create a new Access Level" +COM_USERS_LEVEL_VIEW_EDIT_TITLE="Create Access Level" +COM_USERS_MAIL_VIEW_DEFAULT_DESC="Shows a form to send mass email to multiple users." +COM_USERS_MAIL_VIEW_DEFAULT_TITLE="Mass Mail Users" +COM_USERS_NOTES_VIEW_DEFAULT_DESC="Shows a List of User Notes" +COM_USERS_NOTES_VIEW_DEFAULT_TITLE="User Notes" +COM_USERS_NOTE_VIEW_EDIT_DESC="Shows a form to create a new User Note" +COM_USERS_NOTE_VIEW_EDIT_TITLE="Create User Note" +COM_USERS_TAGS_CATEGORY="User Note Category" +COM_USERS_USERS_VIEW_DEFAULT_DESC="Shows a List of Users" +COM_USERS_USERS_VIEW_DEFAULT_TITLE="Users" +COM_USERS_USER_VIEW_EDIT_DESC="Shows a form to create a new User Account" +COM_USERS_USER_VIEW_EDIT_TITLE="Create User" COM_USER_LOGIN_VIEW_DEFAULT_DESC="Displays a login form." COM_USER_LOGIN_VIEW_DEFAULT_OPTION="Login Form" COM_USER_LOGIN_VIEW_DEFAULT_TITLE="Login Form" @@ -27,6 +49,3 @@ COM_USER_REMIND_VIEW_DEFAULT_TITLE="Username Reminder Request" COM_USER_RESET_VIEW_DEFAULT_DESC="Displays a request to reset password." COM_USER_RESET_VIEW_DEFAULT_OPTION="Default" COM_USER_RESET_VIEW_DEFAULT_TITLE="Password Reset" -COM_USERS="Users" -COM_USERS_TAGS_CATEGORY="User Note Category" -COM_USERS_XML_DESCRIPTION="Component for managing users." diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 88d2d3ad8c7fd..4e0f80f60383f 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -306,6 +306,8 @@ JGLOBAL_CENTER="Center" JGLOBAL_CHECK_ALL="Check All" JGLOBAL_CHOOSE_CATEGORY_DESC="Choose a category from the list." JGLOBAL_CHOOSE_CATEGORY_LABEL="Choose a Category" +JGLOBAL_CHOOSE_COMPONENT_DESC="Choose a component from the list." +JGLOBAL_CHOOSE_COMPONENT_LABEL="Choose a component" JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Select to sort by this column" JGLOBAL_CLICK_TO_TOGGLE_STATE="Select icon to toggle state." JGLOBAL_CONFIRM_DELETE="Are you sure you want to delete? Confirming will permanently delete the selected item(s)!" diff --git a/administrator/language/en-GB/en-GB.mod_menu.ini b/administrator/language/en-GB/en-GB.mod_menu.ini index b4b380dd662f7..6831ef691cdc9 100644 --- a/administrator/language/en-GB/en-GB.mod_menu.ini +++ b/administrator/language/en-GB/en-GB.mod_menu.ini @@ -36,8 +36,13 @@ MOD_MENU_EXTENSIONS_LANGUAGE_MANAGER="Language(s)" MOD_MENU_EXTENSIONS_MODULE_MANAGER="Modules" MOD_MENU_EXTENSIONS_PLUGIN_MANAGER="Plugins" MOD_MENU_EXTENSIONS_TEMPLATE_MANAGER="Templates" +MOD_MENU_FIELD_CHECK_DESC="Whether to perform the checks for the selected administrator menu for presence of important menu items." +MOD_MENU_FIELD_CHECK_LABEL="Check Menu" MOD_MENU_FIELD_FORUMURL_DESC="Enter the URL to a forum other than the default." MOD_MENU_FIELD_FORUMURL_LABEL="Custom Support Forum" +MOD_MENU_FIELD_MENUTYPE_LABEL="Menu to Show" +MOD_MENU_FIELD_MENUTYPE_DESC="Choose which menu should be rendered with this instance of module." +MOD_MENU_FIELD_MENUTYPE_OPTION_PREDEFINED="Use System Preset" MOD_MENU_FIELD_SHOWHELP="Help Menu" MOD_MENU_FIELD_SHOWHELP_DESC="Show or hide the Help menu which includes links to various joomla.org sites useful to users." MOD_MENU_FIELD_SHOWNEW="Add New Shortcuts" @@ -85,10 +90,15 @@ MOD_MENU_MENU_MANAGER_NEW_MENU_ITEM="Add New Menu Item" MOD_MENU_NEW_PRIVATE_MESSAGE="New Private Message" MOD_MENU_PURGE_EXPIRED_CACHE="Clear Expired Cache" MOD_MENU_READ_PRIVATE_MESSAGES="Read Private Messages" +MOD_MENU_RECOVERY_MENU_ROOT="Menu Recovery" MOD_MENU_SETTINGS="Settings" MOD_MENU_MAINTENANCE="Maintenance" MOD_MENU_SYSTEM_INFORMATION="System Information" MOD_MENU_SYSTEM="System" MOD_MENU_TOOLS="Tools" MOD_MENU_USER_PROFILE="My Profile" +MOD_MENU_WARNING_IMPORTANT_ITEMS_INACCESSIBLE="The active administrator menu does not contain links to Module Manager and Menu Manager. Click to
turn on the menu recovery mode." +MOD_MENU_WARNING_IMPORTANT_ITEMS_INACCESSIBLE_MENUS="The active administrator menu does not contain link to Menu Manager. Click to turn on the menu recovery mode." +MOD_MENU_WARNING_IMPORTANT_ITEMS_INACCESSIBLE_MODULES="The active administrator menu does not contain link to Module Manager. Click to turn on the menu recovery mode." +MOD_MENU_WARNING_IMPORTANT_ITEMS_INACCESSIBLE_RECOVERY="You are currently in menu recovery mode. Click to turn off menu recovery mode." MOD_MENU_XML_DESCRIPTION="This module shows the main administrator navigation module." diff --git a/administrator/modules/mod_menu/helper.php b/administrator/modules/mod_menu/helper.php index 994a15fd6e563..80cbc45134ca3 100644 --- a/administrator/modules/mod_menu/helper.php +++ b/administrator/modules/mod_menu/helper.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die; +use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; /** @@ -60,13 +61,14 @@ public static function getMenus() /** * Get a list of the authorised, non-special components to display in the components menu. * - * @param boolean $authCheck An optional switch to turn off the auth check (to support custom layouts 'grey out' behaviour). + * @param boolean $authCheck An optional switch to turn off the auth check (to support custom layouts 'grey out' behaviour). + * @param boolean $enabledOnly Whether to load only enabled/published menu items. * * @return array A nest array of component objects and submenus * * @since 1.6 */ - public static function getComponents($authCheck = true) + public static function getComponents($authCheck = true, $enabledOnly = false) { $lang = JFactory::getLanguage(); $user = JFactory::getUser(); @@ -75,15 +77,21 @@ public static function getComponents($authCheck = true) $result = array(); // Prepare the query. - $query->select('m.id, m.title, m.alias, m.link, m.parent_id, m.img, e.element') - ->from('#__menu AS m'); - - // Filter on the enabled states. - $query->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') + $query->select('m.id, m.title, m.alias, m.link, m.parent_id, m.img, e.element, m.menutype') + ->from('#__menu AS m') + ->where('(m.menutype = \'menu\' OR m.menutype = \'main\')') ->where('m.client_id = 1') - ->where('e.enabled = 1') ->where('m.id > 1'); + if ($enabledOnly) + { + $query->where('m.published = 1'); + } + + // Filter on the enabled states. + $query->join('INNER', '#__extensions AS e ON m.component_id = e.extension_id') + ->where('e.enabled = 1'); + // Order by lft. $query->order('m.lft'); @@ -130,27 +138,233 @@ public static function getComponents($authCheck = true) // Load the core file then // Load extension-local file. $lang->load($component->element . '.sys', JPATH_BASE, null, false, true) - || $lang->load($component->element . '.sys', JPATH_ADMINISTRATOR . '/components/' . $component->element, null, false, true); + || $lang->load($component->element . '.sys', JPATH_ADMINISTRATOR . '/components/' . $component->element, null, false, true); } $component->text = $lang->hasKey($component->title) ? JText::_($component->title) : $component->alias; } } - else + // Sub-menu level. + // Add the submenu link if it is defined. + elseif (isset($result[$component->parent_id]) && isset($result[$component->parent_id]->submenu) && !empty($component->link)) { - // Sub-menu level. - if (isset($result[$component->parent_id])) + $component->text = $lang->hasKey($component->title) ? JText::_($component->title) : $component->alias; + + $result[$component->parent_id]->submenu[] = &$component; + } + } + + return ArrayHelper::sortObjects($result, 'text', 1, false, true); + } + + /** + * Load the menu items from database for the given menutype + * + * @param string $menutype The selected menu type + * @param boolean $authCheck An optional switch to turn off the auth check (to support custom layouts 'grey out' behaviour). + * + * @return array + * + * @since __DEPLOY_VERSION__ + */ + public static function getMenuItems($menutype, $authCheck = true) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + // Prepare the query. + $query->select('m.*') + ->from('#__menu AS m') + ->where('m.menutype = ' . $db->q($menutype)) + ->where('m.client_id = 1') + ->where('m.published = 1') + ->where('m.id > 1'); + + // Filter on the enabled states. + $query->select('e.element') + ->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') + ->where('(e.enabled = 1 OR e.enabled IS NULL)'); + + // Order by lft. + $query->order('m.lft'); + + $db->setQuery($query); + + // Component list + try + { + $menuItems = $db->loadObjectList(); + + foreach ($menuItems as &$menuitem) + { + $menuitem->params = new Registry($menuitem->params); + } + } + catch (RuntimeException $e) + { + $menuItems = array(); + JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); + } + + // Parse the list of extensions. + $result = self::parseItems($menuItems, $authCheck); + + return $result; + } + + /** + * Parse the list of extensions. + * + * @param array $menuItems List of loaded components + * @param bool $authCheck An optional switch to turn off the auth check (to support custom layouts 'grey out' behaviour). + * + * @return array + * + * @since __DEPLOY_VERSION__ + */ + protected static function parseItems($menuItems, $authCheck = true) + { + $result = array(); + $user = JFactory::getUser(); + $lang = JFactory::getLanguage(); + $levels = $user->getAuthorisedViewLevels(); + + // Process each item + foreach ($menuItems as $i => &$menuitem) + { + /* + * Exclude item with menu item option set to exclude from menu modules + * Exclude item if the component is not authorised + * Exclude item if menu item set access level is not met + */ + if (($menuitem->params->get('menu_show', 1) == 0) + || ($menuitem->element && $authCheck && !$user->authorise('core.manage', $menuitem->element)) + || ($menuitem->access && !in_array($menuitem->access, $levels))) + { + continue; + } + + // Evaluate link url + switch ($menuitem->type) + { + case 'url': + case 'component': + $menuitem->link = trim($menuitem->link); + break; + case 'separator': + case 'heading': + $menuitem->link = '#'; + break; + case 'alias': + $aliasTo = $menuitem->params->get('aliasoptions'); + $menuitem->link = static::getLink($aliasTo); + break; + default: + } + + if ($menuitem->link == '') + { + continue; + } + + // Translate Menu item label, if needed + if (!empty($menuitem->element)) + { + $lang->load($menuitem->element . '.sys', JPATH_BASE, null, false, true) + || $lang->load($menuitem->element . '.sys', JPATH_ADMINISTRATOR . '/components/' . $menuitem->element, null, false, true); + } + + $menuitem->text = $lang->hasKey($menuitem->title) ? JText::_($menuitem->title) : $menuitem->title; + $menuitem->submenu = array(); + + $result[$menuitem->parent_id][$menuitem->id] = $menuitem; + } + + // Do an early exit if there are no top level menu items. + if (!isset($result[1])) + { + return array(); + } + + // Put the items under respective parent menu items. + foreach ($result as $parentId => &$mItems) + { + foreach ($mItems as &$mItem) + { + if (isset($result[$mItem->id])) { - // Add the submenu link if it is defined. - if (isset($result[$component->parent_id]->submenu) && !empty($component->link)) - { - $component->text = $lang->hasKey($component->title) ? JText::_($component->title) : $component->alias; - $result[$component->parent_id]->submenu[] = &$component; - } + static::cleanup($result[$mItem->id]); + + $mItem->submenu = &$result[$mItem->id]; } } } - return ArrayHelper::sortObjects($result, 'text', 1, false, true); + // Return only top level items + return $result[1]; + } + + /** + * Method to get a link to the aliased menu item + * + * @param int $menuId The record id of the referencing menu item + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + protected static function getLink($menuId) + { + $table = JTable::getInstance('Menu'); + $table->load($menuId); + + // Look for an alias-to-alias + if ($table->type == 'alias') + { + $params = new Registry($table->params); + $aliasTo = $params->get('aliasoptions'); + + return static::getLink($aliasTo); + } + + return $table->link; + } + + /** + * Method to cleanup the menu items for repeated, leading or trailing separators in a given menu level + * + * @param array &$items The list of menu items in the selected level + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected static function cleanup(&$items) + { + $b = true; + + foreach ($items as $k => &$item) + { + if ($item->type == 'separator') + { + if ($b) + { + $item = false; + } + + $b = true; + } + else + { + $b = false; + } + } + + if ($b) + { + $item = false; + } + + $items = array_filter($items); } } diff --git a/administrator/modules/mod_menu/menu.php b/administrator/modules/mod_menu/menu.php index 95b84ef477bba..d277f63423341 100644 --- a/administrator/modules/mod_menu/menu.php +++ b/administrator/modules/mod_menu/menu.php @@ -9,12 +9,15 @@ defined('_JEXEC') or die; +use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; + /** * Tree based class to render the admin menu * * @since 1.5 */ -class JAdminCssMenu extends JObject +class JAdminCssMenu { /** * CSS string to add to document head @@ -42,8 +45,8 @@ class JAdminCssMenu extends JObject */ public function __construct() { - $this->_root = new JMenuNode('ROOT'); - $this->_current = & $this->_root; + $this->_root = new JMenuNode('ROOT'); + $this->_current = &$this->_root; } /** @@ -77,10 +80,17 @@ public function getParent() /** * Method to get the parent * + * @param bool $clear Whether to clear the existing menu items or just reset the pointer to root element + * * @return void */ - public function reset() + public function reset($clear = false) { + if ($clear) + { + $this->_root = new JMenuNode('ROOT'); + } + $this->_current = &$this->_root; } @@ -180,14 +190,14 @@ public function renderLevel($depth) echo ''; // Print a link if it exists - $linkClass = array(); - $dataToggle = ''; + $linkClass = array(); + $dataToggle = ''; $dropdownCaret = ''; if ($this->_current->hasChildren()) { $linkClass[] = 'dropdown-toggle'; - $dataToggle = ' data-toggle="dropdown"'; + $dataToggle = ' data-toggle="dropdown"'; if (!$this->_current->getParent()->hasParent()) { @@ -305,7 +315,7 @@ public function getIconClass($identifier) $class = preg_replace('#\.\.[^A-Za-z0-9\.\_\- ]#', '', $class); $this->_css .= "\n.menu-$class {\n" . - "\tbackground: url($identifier) no-repeat;\n" . + " background: url($identifier) no-repeat;\n" . "}\n"; $classes[$identifier] = "menu-$class"; @@ -314,6 +324,144 @@ public function getIconClass($identifier) return $classes[$identifier]; } + + /** + * Populate the menu items in the menu object for disabled state + * + * @param Registry $params Menu configuration parameters + * @param bool $enabled Whether the menu should be enabled or disabled + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function load($params, $enabled) + { + $menutype = $params->get('menutype', '*'); + + $this->reset(true); + + if ($menutype == '*') + { + require_once __DIR__ . '/preset/' . ($enabled ? 'enabled.php' : 'disabled.php'); + } + else + { + $items = ModMenuHelper::getMenuItems($menutype); + $app = JFactory::getApplication(); + $me = JFactory::getUser(); + + $authMenus = $me->authorise('core.manage', 'com_menus'); + $authModules = $me->authorise('core.manage', 'com_modules'); + + if ($enabled && $params->get('check') && ($authMenus || $authModules)) + { + $elements = ArrayHelper::getColumn($items, 'element'); + + $rMenu = $authMenus && !in_array('com_menus', $elements); + $rModule = $authModules && !in_array('com_modules', $elements); + + if ($rMenu || $rModule) + { + $recovery = $app->getUserStateFromRequest('mod_menu.recovery', 'recover_menu', 0, 'int'); + + if ($recovery) + { + $app->enqueueMessage(JText::_('MOD_MENU_WARNING_IMPORTANT_ITEMS_INACCESSIBLE_RECOVERY'), 'info'); + + $params->set('recovery', true); + + // In recovery mode, load the preset inside a special root node. + $this->addChild(new JMenuNode(JText::_('MOD_MENU_RECOVERY_MENU_ROOT'), '#'), true); + + require_once __DIR__ . '/preset/enabled.php'; + + $this->getParent(); + } + elseif ($rMenu && $rModule) + { + $app->enqueueMessage(JText::_('MOD_MENU_WARNING_IMPORTANT_ITEMS_INACCESSIBLE'), 'warning'); + } + else + { + $app->enqueueMessage(JText::_('MOD_MENU_WARNING_IMPORTANT_ITEMS_INACCESSIBLE_' . ($rMenu ? 'MENUS' : 'MODULES')), 'warning'); + } + } + } + + // Menu items for dynamic db driven setup to load here + $this->loadItems($items, $enabled); + } + } + + /** + * Load the menu items from an array + * + * @param array $items Menu items loaded from database + * @param bool $enabled Whether the menu should be enabled or disabled + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function loadItems($items, $enabled = true) + { + foreach ($items as $item) + { + if ($item->type == 'separator') + { + $this->addSeparator(); + + continue; + } + + $container = $item->params->get('components_container'); + $components = $container ? ModMenuHelper::getComponents(true, true) : array(); + + if ($item->type == 'heading' && !count($components) && !count($item->submenu)) + { + // Exclude if it is a heading type menu item, and has no children. + } + elseif (!$enabled) + { + $this->addChild(new JMenuNode($item->text, $item->link, 'disabled')); + } + else + { + $this->addChild(new JMenuNode($item->text, $item->link, $item->parent_id == 1 ? null : 'class:'), true); + + $this->loadItems($item->submenu); + + // Add a separator between dynamic menu items and components menu items + if (count($item->submenu) && count($components)) + { + $this->addSeparator(); + } + + // Adding component submenu the old way, this assumes 2-level menu only + foreach ($components as &$component) + { + if (empty($component->submenu)) + { + $this->addChild(new JMenuNode($component->text, $component->link, $component->img)); + } + else + { + $this->addChild(new JMenuNode($component->text, $component->link, $component->img), true); + + foreach ($component->submenu as $sub) + { + $this->addChild(new JMenuNode($sub->text, $sub->link, $sub->img)); + } + + $this->getParent(); + } + } + + $this->getParent(); + } + } + } } /** @@ -322,7 +470,7 @@ public function getIconClass($identifier) * @see JAdminCssMenu * @since 1.5 */ -class JMenuNode extends JObject +class JMenuNode { /** * Node Title @@ -445,15 +593,15 @@ public function setParent(JMenuNode &$parent = null) if (!is_null($this->_parent)) { - unset($this->_parent->children[$hash]); + unset($this->_parent->_children[$hash]); } if (!is_null($parent)) { - $parent->_children[$hash] = & $this; + $parent->_children[$hash] = &$this; } - $this->_parent = & $parent; + $this->_parent = &$parent; } /** diff --git a/administrator/modules/mod_menu/mod_menu.php b/administrator/modules/mod_menu/mod_menu.php index 925c65da399e4..a625f99b0b11e 100644 --- a/administrator/modules/mod_menu/mod_menu.php +++ b/administrator/modules/mod_menu/mod_menu.php @@ -9,15 +9,20 @@ defined('_JEXEC') or die; +use Joomla\Registry\Registry; + // Include the module helper classes. JLoader::register('ModMenuHelper', __DIR__ . '/helper.php'); JLoader::register('JAdminCssMenu', __DIR__ . '/menu.php'); +/** @var Registry $params */ $lang = JFactory::getLanguage(); $user = JFactory::getUser(); $input = JFactory::getApplication()->input; -$menu = new JAdminCssMenu; -$enabled = $input->getBool('hidemainmenu') ? false : true; +$enabled = !$input->getBool('hidemainmenu'); + +$menu = new JAdminCssMenu; +$menu->load($params, $enabled); // Render the module layout require JModuleHelper::getLayoutPath('mod_menu', $params->get('layout', 'default')); diff --git a/administrator/modules/mod_menu/mod_menu.xml b/administrator/modules/mod_menu/mod_menu.xml index a854b08c23c2c..de772a19d8dff 100644 --- a/administrator/modules/mod_menu/mod_menu.xml +++ b/administrator/modules/mod_menu/mod_menu.xml @@ -11,6 +11,7 @@ MOD_MENU_XML_DESCRIPTION mod_menu.php + preset tmpl helper.php menu.php @@ -23,6 +24,26 @@
+ + + + + + + addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), null, 'disabled')); +$this->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), null, 'disabled')); /** * Users Submenu */ if ($user->authorise('core.manage', 'com_users')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS'), null, 'disabled')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS'), null, 'disabled')); } /** @@ -27,7 +31,7 @@ */ if ($user->authorise('core.manage', 'com_menus')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), null, 'disabled')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), null, 'disabled')); } /** @@ -35,7 +39,7 @@ */ if ($user->authorise('core.manage', 'com_content')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), null, 'disabled')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), null, 'disabled')); } /** @@ -48,7 +52,7 @@ // Check if there are any components, otherwise, don't display the components menu item if ($components) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), null, 'disabled')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), null, 'disabled')); } /** @@ -62,7 +66,7 @@ if ($im || $mm || $pm || $tm || $lm) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), null, 'disabled')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), null, 'disabled')); } /** @@ -70,5 +74,5 @@ */ if ($params->get('showhelp', 1)) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled')); } diff --git a/administrator/modules/mod_menu/tmpl/default_enabled.php b/administrator/modules/mod_menu/preset/enabled.php similarity index 54% rename from administrator/modules/mod_menu/tmpl/default_enabled.php rename to administrator/modules/mod_menu/preset/enabled.php index 3f87d473ae915..115746d5f7333 100644 --- a/administrator/modules/mod_menu/tmpl/default_enabled.php +++ b/administrator/modules/mod_menu/preset/enabled.php @@ -11,91 +11,94 @@ use Joomla\Utilities\ArrayHelper; -/* @var $menu JAdminCSSMenu */ +/* @var $this JAdminCSSMenu */ +/* @var $params Joomla\Registry\Registry */ +$recovery = (boolean) $params->get('recovery', 0); $shownew = (boolean) $params->get('shownew', 1); $showhelp = (boolean) $params->get('showhelp', 1); $user = JFactory::getUser(); $lang = JFactory::getLanguage(); +$rootClass = $recovery ? 'class:' : null; /** * Site Submenu */ -$menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), '#'), true); -$menu->addChild(new JMenuNode(JText::_('MOD_MENU_CONTROL_PANEL'), 'index.php', 'class:cpanel')); +$this->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), '#', $rootClass), true); +$this->addChild(new JMenuNode(JText::_('MOD_MENU_CONTROL_PANEL'), 'index.php', 'class:cpanel')); if ($user->authorise('core.admin')) { - $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_CONFIGURATION'), 'index.php?option=com_config', 'class:config')); + $this->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_CONFIGURATION'), 'index.php?option=com_config', 'class:config')); } if ($user->authorise('core.manage', 'com_checkin')) { - $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_GLOBAL_CHECKIN'), 'index.php?option=com_checkin', 'class:checkin')); + $this->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_GLOBAL_CHECKIN'), 'index.php?option=com_checkin', 'class:checkin')); } if ($user->authorise('core.manage', 'com_cache')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_CLEAR_CACHE'), 'index.php?option=com_cache', 'class:clear')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_PURGE_EXPIRED_CACHE'), 'index.php?option=com_cache&view=purge', 'class:purge')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_CLEAR_CACHE'), 'index.php?option=com_cache', 'class:clear')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_PURGE_EXPIRED_CACHE'), 'index.php?option=com_cache&view=purge', 'class:purge')); } if ($user->authorise('core.admin')) { - $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM_INFORMATION'), 'index.php?option=com_admin&view=sysinfo', 'class:info')); + $this->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM_INFORMATION'), 'index.php?option=com_admin&view=sysinfo', 'class:info')); } -$menu->getParent(); +$this->getParent(); /** * Users Submenu */ if ($user->authorise('core.manage', 'com_users')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_USERS'), '#'), true); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_USERS'), '#', $rootClass), true); $createUser = $shownew && $user->authorise('core.create', 'com_users'); $createGrp = $user->authorise('core.admin', 'com_users'); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_USER_MANAGER'), 'index.php?option=com_users&view=users', 'class:user'), $createUser); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_USER_MANAGER'), 'index.php?option=com_users&view=users', 'class:user'), $createUser); if ($createUser) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_USER'), 'index.php?option=com_users&task=user.add', 'class:newarticle')); - $menu->getParent(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_USER'), 'index.php?option=com_users&task=user.add', 'class:newarticle')); + $this->getParent(); } if ($createGrp) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_GROUPS'), 'index.php?option=com_users&view=groups', 'class:groups'), $createUser); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_GROUPS'), 'index.php?option=com_users&view=groups', 'class:groups'), $createUser); if ($createUser) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_GROUP'), 'index.php?option=com_users&task=group.add', 'class:newarticle')); - $menu->getParent(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_GROUP'), 'index.php?option=com_users&task=group.add', 'class:newarticle')); + $this->getParent(); } - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_LEVELS'), 'index.php?option=com_users&view=levels', 'class:levels'), $createUser); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_LEVELS'), 'index.php?option=com_users&view=levels', 'class:levels'), $createUser); if ($createUser) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_LEVEL'), 'index.php?option=com_users&task=level.add', 'class:newarticle')); - $menu->getParent(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_LEVEL'), 'index.php?option=com_users&task=level.add', 'class:newarticle')); + $this->getParent(); } } - $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_NOTES'), 'index.php?option=com_users&view=notes', 'class:user-note'), $createUser); + $this->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_NOTES'), 'index.php?option=com_users&view=notes', 'class:user-note'), $createUser); if ($createUser) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_NOTE'), 'index.php?option=com_users&task=note.add', 'class:newarticle')); - $menu->getParent(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_NOTE'), 'index.php?option=com_users&task=note.add', 'class:newarticle')); + $this->getParent(); } - $menu->addChild( + $this->addChild( new JMenuNode( JText::_('MOD_MENU_COM_USERS_NOTE_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_users', 'class:category'), $createUser @@ -103,23 +106,23 @@ if ($createUser) { - $menu->addChild( + $this->addChild( new JMenuNode( JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_users', 'class:newarticle' ) ); - $menu->getParent(); + $this->getParent(); } if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_users')->get('custom_fields_enable', '1')) { - $menu->addChild( + $this->addChild( new JMenuNode( JText::_('MOD_MENU_FIELDS'), 'index.php?option=com_fields&context=com_users.user', 'class:fields') ); - $menu->addChild( + $this->addChild( new JMenuNode( JText::_('MOD_MENU_FIELDS_GROUP'), 'index.php?option=com_fields&view=groups&context=com_users.user', 'class:category') ); @@ -127,11 +130,11 @@ if (JFactory::getApplication()->get('massmailoff') != 1) { - $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MASS_MAIL_USERS'), 'index.php?option=com_users&view=mail', 'class:massmail')); + $this->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_MASS_MAIL_USERS'), 'index.php?option=com_users&view=mail', 'class:massmail')); } - $menu->getParent(); + $this->getParent(); } /** @@ -139,27 +142,29 @@ */ if ($user->authorise('core.manage', 'com_menus')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), '#'), true); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), '#', $rootClass), true); $createMenu = $shownew && $user->authorise('core.create', 'com_menus'); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER'), 'index.php?option=com_menus&view=menus', 'class:menumgr'), $createMenu); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER'), 'index.php?option=com_menus&view=menus', 'class:menumgr'), $createMenu); if ($createMenu) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU'), 'index.php?option=com_menus&view=menu&layout=edit', 'class:newarticle')); - $menu->getParent(); + $this->addChild( + new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU'), 'index.php?option=com_menus&view=menu&layout=edit', 'class:newarticle') + ); + $this->getParent(); } - $menu->addSeparator(); + $this->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS_ALL_ITEMS'), 'index.php?option=com_menus&view=items&menutype=', 'class:allmenu')); - $menu->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS_ALL_ITEMS'), 'index.php?option=com_menus&view=items&menutype=', 'class:allmenu')); + $this->addSeparator(); // Menu Types $menuTypes = ModMenuHelper::getMenus(); - $menuTypes = ArrayHelper::sortObjects($menuTypes, 'title', 1, false); + $menuTypes = ArrayHelper::sortObjects($menuTypes, array('client_id', 'title'), 1, false); - foreach ($menuTypes as $menuType) + foreach ($menuTypes as $mti => $menuType) { if (!$user->authorise('core.manage', 'com_menus.menu.' . (int) $menuType->id)) { @@ -184,14 +189,20 @@ } elseif ($menuType->image && JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', null, null, true, true)) { - $titleicon = ' ' . JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', $alt, array('title' => $menuType->title_native), true) . ''; + $titleicon = ' ' . + JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', $alt, array('title' => $menuType->title_native), true) . ''; } else { $titleicon = ' ' . $menuType->sef . ''; } - $menu->addChild( + if (isset($menuTypes[$mti - 1]) && $menuTypes[$mti - 1]->client_id != $menuType->client_id) + { + $this->addSeparator(); + } + + $this->addChild( new JMenuNode( $menuType->title, 'index.php?option=com_menus&view=items&menutype=' . $menuType->menutype, 'class:menu', null, null, $titleicon ), @@ -200,17 +211,18 @@ if ($user->authorise('core.create', 'com_menus.menu.' . (int) $menuType->id)) { - $menu->addChild( + $this->addChild( new JMenuNode( - JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU_ITEM'), 'index.php?option=com_menus&view=item&layout=edit&menutype=' . $menuType->menutype, - 'class:newarticle') + JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU_ITEM'), + 'index.php?option=com_menus&view=item&layout=edit&menutype=' . $menuType->menutype, 'class:newarticle' + ) ); - $menu->getParent(); + $this->getParent(); } } - $menu->getParent(); + $this->getParent(); } /** @@ -218,55 +230,59 @@ */ if ($user->authorise('core.manage', 'com_content')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), '#'), true); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), '#', $rootClass), true); $createContent = $shownew && $user->authorise('core.create', 'com_content'); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_ARTICLE_MANAGER'), 'index.php?option=com_content', 'class:article'), $createContent); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_ARTICLE_MANAGER'), 'index.php?option=com_content', 'class:article'), $createContent); if ($createContent) { - $menu->addChild( + $this->addChild( new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_ARTICLE'), 'index.php?option=com_content&task=article.add', 'class:newarticle') ); - $menu->getParent(); + $this->getParent(); } - $menu->addChild( + $this->addChild( new JMenuNode( - JText::_('MOD_MENU_COM_CONTENT_CATEGORY_MANAGER'), 'index.php?option=com_categories&extension=com_content', 'class:category'), + JText::_('MOD_MENU_COM_CONTENT_CATEGORY_MANAGER'), 'index.php?option=com_categories&extension=com_content', 'class:category' + ), $createContent ); if ($createContent) { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_content', 'class:newarticle') + $this->addChild( + new JMenuNode( + JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), + 'index.php?option=com_categories&task=category.add&extension=com_content', 'class:newarticle' + ) ); - $menu->getParent(); + $this->getParent(); } if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_content')->get('custom_fields_enable', '1')) { - $menu->addChild( + $this->addChild( new JMenuNode( JText::_('MOD_MENU_FIELDS'), 'index.php?option=com_fields&context=com_content.article', 'class:fields') ); - $menu->addChild( + $this->addChild( new JMenuNode( JText::_('MOD_MENU_FIELDS_GROUP'), 'index.php?option=com_fields&view=groups&context=com_content.article', 'class:category') ); } - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured', 'class:featured')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured', 'class:featured')); if ($user->authorise('core.manage', 'com_media')) { - $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media', 'class:media')); + $this->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media', 'class:media')); } - $menu->getParent(); + $this->getParent(); } /** @@ -279,29 +295,29 @@ // Check if there are any components, otherwise, don't render the menu if ($components) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), '#'), true); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), '#', $rootClass), true); foreach ($components as &$component) { if (!empty($component->submenu)) { // This component has a db driven submenu. - $menu->addChild(new JMenuNode($component->text, $component->link, $component->img), true); + $this->addChild(new JMenuNode($component->text, $component->link, $component->img), true); foreach ($component->submenu as $sub) { - $menu->addChild(new JMenuNode($sub->text, $sub->link, $sub->img)); + $this->addChild(new JMenuNode($sub->text, $sub->link, $sub->img)); } - $menu->getParent(); + $this->getParent(); } else { - $menu->addChild(new JMenuNode($component->text, $component->link, $component->img)); + $this->addChild(new JMenuNode($component->text, $component->link, $component->img)); } } - $menu->getParent(); + $this->getParent(); } /** @@ -315,58 +331,70 @@ if ($im || $mm || $pm || $tm || $lm) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), '#'), true); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), '#', $rootClass), true); if ($im) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSION_MANAGER'), 'index.php?option=com_installer', 'class:install'), $im); - - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_INSTALL'), 'index.php?option=com_installer', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_UPDATE'), 'index.php?option=com_installer&view=update', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_MANAGE'), 'index.php?option=com_installer&view=manage', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_DISCOVER'), 'index.php?option=com_installer&view=discover', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_DATABASE'), 'index.php?option=com_installer&view=database', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_WARNINGS'), 'index.php?option=com_installer&view=warnings', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_LANGUAGES'), 'index.php?option=com_installer&view=languages', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_UPDATESITES'), 'index.php?option=com_installer&view=updatesites', 'class:install')); - $menu->getParent(); + $cls = 'class:install'; + + $this->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSION_MANAGER'), 'index.php?option=com_installer', $cls), $im); + + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_INSTALL'), 'index.php?option=com_installer', $cls)); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_UPDATE'), 'index.php?option=com_installer&view=update', $cls)); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_MANAGE'), 'index.php?option=com_installer&view=manage', $cls)); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_DISCOVER'), 'index.php?option=com_installer&view=discover', $cls)); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_DATABASE'), 'index.php?option=com_installer&view=database', $cls)); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_WARNINGS'), 'index.php?option=com_installer&view=warnings', $cls)); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_LANGUAGES'), 'index.php?option=com_installer&view=languages', $cls)); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_UPDATESITES'), 'index.php?option=com_installer&view=updatesites', $cls)); + $this->getParent(); } if ($im && ($mm || $pm || $tm || $lm)) { - $menu->addSeparator(); + $this->addSeparator(); } if ($mm) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_MODULE_MANAGER'), 'index.php?option=com_modules', 'class:module')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_MODULE_MANAGER'), 'index.php?option=com_modules', 'class:module')); } if ($pm) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_PLUGIN_MANAGER'), 'index.php?option=com_plugins', 'class:plugin')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_PLUGIN_MANAGER'), 'index.php?option=com_plugins', 'class:plugin')); } if ($tm) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_TEMPLATE_MANAGER'), 'index.php?option=com_templates', 'class:themes'), $tm); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_TEMPLATE_MANAGER'), 'index.php?option=com_templates', 'class:themes'), $tm); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_TEMPLATES_SUBMENU_STYLES'), 'index.php?option=com_templates&view=styles', 'class:themes')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_TEMPLATES_SUBMENU_TEMPLATES'), 'index.php?option=com_templates&view=templates', 'class:themes')); - $menu->getParent(); + $this->addChild( + new JMenuNode(JText::_('MOD_MENU_COM_TEMPLATES_SUBMENU_STYLES'), 'index.php?option=com_templates&view=styles', 'class:themes') + ); + $this->addChild( + new JMenuNode(JText::_('MOD_MENU_COM_TEMPLATES_SUBMENU_TEMPLATES'), 'index.php?option=com_templates&view=templates', 'class:themes') + ); + $this->getParent(); } if ($lm) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_LANGUAGE_MANAGER'), 'index.php?option=com_languages', 'class:language'), $lm); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_LANGUAGE_MANAGER'), 'index.php?option=com_languages', 'class:language'), $lm); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_INSTALLED'), 'index.php?option=com_languages&view=installed', 'class:language')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_CONTENT'), 'index.php?option=com_languages&view=languages', 'class:language')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_OVERRIDES'), 'index.php?option=com_languages&view=overrides', 'class:language')); - $menu->getParent(); + $this->addChild( + new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_INSTALLED'), 'index.php?option=com_languages&view=installed', 'class:language') + ); + $this->addChild( + new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_CONTENT'), 'index.php?option=com_languages&view=languages', 'class:language') + ); + $this->addChild( + new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_OVERRIDES'), 'index.php?option=com_languages&view=overrides', 'class:language') + ); + $this->getParent(); } - $menu->getParent(); + $this->getParent(); } /** @@ -374,15 +402,15 @@ */ if ($showhelp == 1) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), '#'), true); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_JOOMLA'), 'index.php?option=com_admin&view=help', 'class:help')); - $menu->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), '#', $rootClass), true); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_JOOMLA'), 'index.php?option=com_admin&view=help', 'class:help')); + $this->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM'), 'https://forum.joomla.org/', 'class:help-forum', false, '_blank')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM'), 'https://forum.joomla.org', 'class:help-forum', false, '_blank')); if ($forum_url = $params->get('forum_url')) { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')); } $debug = $lang->setDebug(false); @@ -391,24 +419,26 @@ { $forum_url = 'https://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE'); $lang->setDebug($debug); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank')); } $lang->setDebug($debug); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DOCUMENTATION'), 'https://docs.joomla.org', 'class:help-docs', false, '_blank')); - $menu->addSeparator(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DOCUMENTATION'), 'https://docs.joomla.org', 'class:help-docs', false, '_blank')); + $this->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_EXTENSIONS'), 'https://extensions.joomla.org', 'class:help-jed', false, '_blank')); - $menu->addChild( + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_EXTENSIONS'), 'https://extensions.joomla.org', 'class:help-jed', false, '_blank')); + $this->addChild( new JMenuNode(JText::_('MOD_MENU_HELP_TRANSLATIONS'), 'https://community.joomla.org/translations.html', 'class:help-trans', false, '_blank') ); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_RESOURCES'), 'http://resources.joomla.org', 'class:help-jrd', false, '_blank')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_COMMUNITY'), 'https://community.joomla.org', 'class:help-community', false, '_blank')); - $menu->addChild( + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_RESOURCES'), 'http://resources.joomla.org', 'class:help-jrd', false, '_blank')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_COMMUNITY'), 'https://community.joomla.org', 'class:help-community', false, '_blank')); + $this->addChild( new JMenuNode(JText::_('MOD_MENU_HELP_SECURITY'), 'https://developer.joomla.org/security-centre.html', 'class:help-security', false, '_blank') ); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DEVELOPER'), 'https://developer.joomla.org', 'class:help-dev', false, '_blank')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_XCHANGE'), 'https://joomla.stackexchange.com', 'class:help-dev', false, '_blank')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SHOP'), 'https://community.joomla.org/the-joomla-shop.html', 'class:help-shop', false, '_blank')); - $menu->getParent(); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DEVELOPER'), 'https://developer.joomla.org', 'class:help-dev', false, '_blank')); + $this->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_XCHANGE'), 'https://joomla.stackexchange.com', 'class:help-dev', false, '_blank')); + $this->addChild( + new JMenuNode(JText::_('MOD_MENU_HELP_SHOP'), 'https://community.joomla.org/the-joomla-shop.html', 'class:help-shop', false, '_blank') + ); + $this->getParent(); } diff --git a/administrator/modules/mod_menu/tmpl/default.php b/administrator/modules/mod_menu/tmpl/default.php index 8e66dde2cbfbc..ff9edb4c9e2ef 100644 --- a/administrator/modules/mod_menu/tmpl/default.php +++ b/administrator/modules/mod_menu/tmpl/default.php @@ -11,6 +11,4 @@ $direction = JFactory::getDocument()->direction == 'rtl' ? 'pull-right' : ''; -require JModuleHelper::getLayoutPath('mod_menu', $enabled ? 'default_enabled' : 'default_disabled'); - $menu->renderMenu('menu', $enabled ? 'nav ' . $direction : 'nav disabled ' . $direction); diff --git a/administrator/templates/hathor/html/com_menus/items/default.php b/administrator/templates/hathor/html/com_menus/items/default.php index 3c581035ba68e..40368585044e4 100644 --- a/administrator/templates/hathor/html/com_menus/items/default.php +++ b/administrator/templates/hathor/html/com_menus/items/default.php @@ -114,9 +114,11 @@ + state->get('filter.client_id') == 0): ?> + @@ -189,6 +191,7 @@ escape($item->item_type); ?> + state->get('filter.client_id') == 0): ?> type == 'component') : ?> language == '*' || $item->home == '0'):?> @@ -210,6 +213,7 @@ + diff --git a/administrator/templates/hathor/html/mod_menu/default_enabled.php b/administrator/templates/hathor/html/mod_menu/default_enabled.php deleted file mode 100644 index dd0b3006b5111..0000000000000 --- a/administrator/templates/hathor/html/mod_menu/default_enabled.php +++ /dev/null @@ -1,412 +0,0 @@ -get('shownew', 1); -$showhelp = $params->get('showhelp', 1); -$user = JFactory::getUser(); -$lang = JFactory::getLanguage(); - -// -// Site SubMenu -// -$menu->addChild( - new JMenuNode(JText::_('MOD_MENU_CONTROL_PANEL'), 'index.php', 'class:cpanel'), true -); - -$menu->getParent(); - -// -// Users Submenu -// -if ($user->authorise('core.manage', 'com_users')) -{ - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_USERS'), '#'), true - ); - $createUser = $shownew && $user->authorise('core.create', 'com_users'); - $createGrp = $user->authorise('core.admin', 'com_users'); - - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_USER_MANAGER'), 'index.php?option=com_users&view=users', 'class:user'), $createUser - ); - - if ($createUser) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_USER'), 'index.php?option=com_users&task=user.add', 'class:newarticle') - ); - $menu->getParent(); - } - - if ($createGrp) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_GROUPS'), 'index.php?option=com_users&view=groups', 'class:groups'), $createUser - ); - if ($createUser) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_GROUP'), 'index.php?option=com_users&task=group.add', 'class:newarticle') - ); - $menu->getParent(); - } - - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_LEVELS'), 'index.php?option=com_users&view=levels', 'class:levels'), $createUser - ); - if ($createUser) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_LEVEL'), 'index.php?option=com_users&task=level.add', 'class:newarticle') - ); - $menu->getParent(); - } - } - - $menu->addSeparator(); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_NOTES'), 'index.php?option=com_users&view=notes', 'class:user-note'), $createUser - ); - if ($createUser) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_NOTE'), 'index.php?option=com_users&task=note.add', 'class:newarticle') - ); - $menu->getParent(); - } - - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_USERS_NOTE_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_users', 'class:category'), $createUser - ); - if ($createUser) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_users', 'class:newarticle') - ); - $menu->getParent(); - } - - if (JFactory::getApplication()->get('massmailoff', 0) != 1) - { - $menu->addSeparator(); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_MASS_MAIL_USERS'), 'index.php?option=com_users&view=mail', 'class:massmail') - ); - } - - $menu->getParent(); -} - -// -// Menus Submenu -// -if ($user->authorise('core.manage', 'com_menus')) -{ - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_MENUS'), '#'), true - ); - $createMenu = $shownew && $user->authorise('core.create', 'com_menus'); - - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER'), 'index.php?option=com_menus&view=menus', 'class:menumgr'), $createMenu - ); - if ($createMenu) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU'), 'index.php?option=com_menus&view=menu&layout=edit', 'class:newarticle') - ); - $menu->getParent(); - } - $menu->addSeparator(); - - // Menu Types - $menuTypes = ModMenuHelper::getMenus(); - $menuTypes = ArrayHelper::sortObjects($menuTypes, 'title', 1, false); - - foreach ($menuTypes as $menuType) - { - if (!$user->authorise('core.manage', 'com_menus.menu.' . (int) $menuType->id)) - { - continue; - } - - $alt = '*' .$menuType->sef. '*'; - if ($menuType->home == 0) - { - $titleicon = ''; - } - elseif ($menuType->home == 1 && $menuType->language == '*') - { - $titleicon = ' '; - } - elseif ($menuType->home > 1) - { - $titleicon = ' '.JHtml::_('image', 'mod_languages/icon-16-language.png', $menuType->home, array('title' => JText::_('MOD_MENU_HOME_MULTIPLE')), true).''; - } - elseif ($menuType->image && JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', null, null, true, true)) - { - $titleicon = ' ' . JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', $alt, array('title' => $menuType->title_native), true) . ''; - } - else - { - $titleicon = ' ' . $menuType->sef . ''; - } - - $menu->addChild( - new JMenuNode($menuType->title, 'index.php?option=com_menus&view=items&menutype='.$menuType->menutype, 'class:menu', null, null, $titleicon), - $user->authorise('core.create', 'com_menus.menu.' . (int) $menuType->id) - ); - - if ($user->authorise('core.create', 'com_menus.menu.' . (int) $menuType->id)) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU_ITEM'), 'index.php?option=com_menus&view=item&layout=edit&menutype='.$menuType->menutype, 'class:newarticle') - ); - $menu->getParent(); - } - } - $menu->getParent(); -} - -// -// Content Submenu -// -if ($user->authorise('core.manage', 'com_content')) -{ - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), '#'), true - ); - $createContent = $shownew && $user->authorise('core.create', 'com_content'); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_ARTICLE_MANAGER'), 'index.php?option=com_content', 'class:article'), $createContent - ); - if ($createContent) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_ARTICLE'), 'index.php?option=com_content&task=article.add', 'class:newarticle') - ); - $menu->getParent(); - } - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_CATEGORY_MANAGER'), 'index.php?option=com_categories&extension=com_content', 'class:category'), $createContent - ); - if ($createContent) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_content', 'class:newarticle') - ); - $menu->getParent(); - } - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured', 'class:featured') - ); - $menu->addSeparator(); - if ($user->authorise('core.manage', 'com_media')) - { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media', 'class:media')); - } - $menu->getParent(); -} - -// -// Components Submenu -// - -// Get the authorised components and sub-menus. -$components = ModMenuHelper::getComponents(true); - -// Check if there are any components, otherwise, don't render the menu -if ($components) -{ - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), '#'), true); - - foreach ($components as &$component) - { - if (!empty($component->submenu)) - { - // This component has a db driven submenu. - $menu->addChild(new JMenuNode($component->text, $component->link, $component->img), true); - foreach ($component->submenu as $sub) - { - $menu->addChild(new JMenuNode($sub->text, $sub->link, $sub->img)); - } - $menu->getParent(); - } - else - { - $menu->addChild(new JMenuNode($component->text, $component->link, $component->img)); - } - } - $menu->getParent(); -} - -// -// Extensions Submenu -// -$im = $user->authorise('core.manage', 'com_installer'); -$mm = $user->authorise('core.manage', 'com_modules'); -$pm = $user->authorise('core.manage', 'com_plugins'); -$tm = $user->authorise('core.manage', 'com_templates'); -$lm = $user->authorise('core.manage', 'com_languages'); - -if ($im || $mm || $pm || $tm || $lm) -{ - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), '#'), true); - - if ($im) - { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSION_MANAGER'), 'index.php?option=com_installer', 'class:install'), $im); - - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_INSTALL'), 'index.php?option=com_installer', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_UPDATE'), 'index.php?option=com_installer&view=update', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_MANAGE'), 'index.php?option=com_installer&view=manage', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_DISCOVER'), 'index.php?option=com_installer&view=discover', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_DATABASE'), 'index.php?option=com_installer&view=database', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_WARNINGS'), 'index.php?option=com_installer&view=warnings', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_LANGUAGES'), 'index.php?option=com_installer&view=languages', 'class:install')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_INSTALLER_SUBMENU_UPDATESITES'), 'index.php?option=com_installer&view=updatesites', 'class:install')); - $menu->getParent(); - $menu->addSeparator(); - } - - if ($mm) - { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_MODULE_MANAGER'), 'index.php?option=com_modules', 'class:module')); - } - - if ($pm) - { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_PLUGIN_MANAGER'), 'index.php?option=com_plugins', 'class:plugin')); - } - - if ($tm) - { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_TEMPLATE_MANAGER'), 'index.php?option=com_templates', 'class:themes')); - } - - if ($lm) - { - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_LANGUAGE_MANAGER'), 'index.php?option=com_languages', 'class:language'), $lm); - - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_INSTALLED'), 'index.php?option=com_languages&view=installed', 'class:language')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_CONTENT'), 'index.php?option=com_languages&view=languages', 'class:language')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_LANGUAGES_SUBMENU_OVERRIDES'), 'index.php?option=com_languages&view=overrides', 'class:language')); - $menu->getParent(); - - } - $menu->getParent(); -} - -// -// Help Submenu -// -if ($showhelp == 1) -{ - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP'), '#'), true - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_JOOMLA'), 'index.php?option=com_admin&view=help', 'class:help') - ); - $menu->addSeparator(); - - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM'), 'https://forum.joomla.org/', 'class:help-forum', false, '_blank') - ); - if ($forum_url = $params->get('forum_url')) - { - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank') - ); - } - $debug = $lang->setDebug(false); - if ($lang->hasKey('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') && JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') != '') - { - $forum_url = 'https://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE'); - $lang->setDebug($debug); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank') - ); - } - $lang->setDebug($debug); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_DOCUMENTATION'), 'https://docs.joomla.org', 'class:help-docs', false, '_blank') - ); - $menu->addSeparator(); - - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_EXTENSIONS'), 'https://extensions.joomla.org', 'class:help-jed', false, '_blank') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_TRANSLATIONS'), 'https://community.joomla.org/translations.html', 'class:help-trans', false, '_blank') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_RESOURCES'), 'http://resources.joomla.org', 'class:help-jrd', false, '_blank') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_COMMUNITY'), 'https://community.joomla.org', 'class:help-community', false, '_blank') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_SECURITY'), 'https://developer.joomla.org/security-centre.html', 'class:help-security', false, '_blank') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_DEVELOPER'), 'https://developer.joomla.org', 'class:help-dev', false, '_blank') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_XCHANGE'), 'https://joomla.stackexchange.com', 'class:help-dev', false, '_blank') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_SHOP'), 'https://community.joomla.org/the-joomla-shop.html', 'class:help-shop', false, '_blank') - ); - $menu->getParent(); -} -// -// Admin Settingss Submenu -// -$su = $user->authorise('core.admin'); -$cam = $user->authorise('core.manage', 'com_cache'); -$cim = $user->authorise('core.manage', 'com_checkin'); - - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_SETTINGS'), '#'), true); - - if ($su): - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_CONFIGURATION'), 'index.php?option=com_config', 'class:config') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_SYSTEM_INFORMATION'), 'index.php?option=com_admin&view=sysinfo', 'class:info') - ); - endif; - if ($cam): - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_CLEAR_CACHE'), 'index.php?option=com_cache', 'class:clear') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_PURGE_EXPIRED_CACHE'), 'index.php?option=com_cache&view=purge', 'class:purge') - ); - endif; - if ($cim): - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_GLOBAL_CHECKIN'), 'index.php?option=com_checkin', 'class:checkin') - ); - endif; - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_USER_PROFILE'), 'index.php?option=com_admin&task=profile.edit&id='. $user->id, 'class:profile') - ); - $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_LOGOUT'), 'index.php?option=com_login&task=logout&'. JSession::getFormToken() .'=1', 'class:logout') - ); - - $menu->getParent(); diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index d149a35174471..773c6d9a38f5d 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -1384,25 +1384,25 @@ CREATE TABLE IF NOT EXISTS `#__menu` ( INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`) VALUES (1, '', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '', 0, '', 0, 43, 0, '*', 0), -(2, 'menu', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 0, 1, 1, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1), -(3, 'menu', 'com_banners', 'Banners', '', 'Banners/Banners', 'index.php?option=com_banners', 'component', 0, 2, 2, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners', 0, '', 2, 3, 0, '*', 1), -(4, 'menu', 'com_banners_categories', 'Categories', '', 'Banners/Categories', 'index.php?option=com_categories&extension=com_banners', 'component', 0, 2, 2, 6, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners-cat', 0, '', 4, 5, 0, '*', 1), -(5, 'menu', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'index.php?option=com_banners&view=clients', 'component', 0, 2, 2, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners-clients', 0, '', 6, 7, 0, '*', 1), -(6, 'menu', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 0, 2, 2, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1), -(7, 'menu', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 0, 1, 1, 8, 0, '0000-00-00 00:00:00', 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1), -(8, 'menu', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact', 'component', 0, 7, 2, 8, 0, '0000-00-00 00:00:00', 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1), -(9, 'menu', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&extension=com_contact', 'component', 0, 7, 2, 6, 0, '0000-00-00 00:00:00', 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1), -(10, 'menu', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 0, 1, 1, 15, 0, '0000-00-00 00:00:00', 0, 0, 'class:messages', 0, '', 17, 22, 0, '*', 1), -(11, 'menu', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 0, 10, 2, 15, 0, '0000-00-00 00:00:00', 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1), -(13, 'menu', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 0, 1, 1, 17, 0, '0000-00-00 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 23, 28, 0, '*', 1), -(14, 'menu', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds', 'component', 0, 13, 2, 17, 0, '0000-00-00 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 24, 25, 0, '*', 1), -(15, 'menu', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&extension=com_newsfeeds', 'component', 0, 13, 2, 6, 0, '0000-00-00 00:00:00', 0, 0, 'class:newsfeeds-cat', 0, '', 26, 27, 0, '*', 1), -(16, 'menu', 'com_redirect', 'Redirect', '', 'Redirect', 'index.php?option=com_redirect', 'component', 0, 1, 1, 24, 0, '0000-00-00 00:00:00', 0, 0, 'class:redirect', 0, '', 29, 30, 0, '*', 1), -(17, 'menu', 'com_search', 'Basic Search', '', 'Basic Search', 'index.php?option=com_search', 'component', 0, 1, 1, 19, 0, '0000-00-00 00:00:00', 0, 0, 'class:search', 0, '', 31, 32, 0, '*', 1), -(18, 'menu', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder', 'component', 0, 1, 1, 27, 0, '0000-00-00 00:00:00', 0, 0, 'class:finder', 0, '', 33, 34, 0, '*', 1), +(2, 'menu', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 1, 1, 1, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1), +(3, 'menu', 'com_banners', 'Banners', '', 'Banners/Banners', 'index.php?option=com_banners', 'component', 1, 2, 2, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners', 0, '', 2, 3, 0, '*', 1), +(4, 'menu', 'com_banners_categories', 'Categories', '', 'Banners/Categories', 'index.php?option=com_categories&extension=com_banners', 'component', 1, 2, 2, 6, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners-cat', 0, '', 4, 5, 0, '*', 1), +(5, 'menu', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'index.php?option=com_banners&view=clients', 'component', 1, 2, 2, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners-clients', 0, '', 6, 7, 0, '*', 1), +(6, 'menu', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 1, 2, 2, 4, 0, '0000-00-00 00:00:00', 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1), +(7, 'menu', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 1, 1, 1, 8, 0, '0000-00-00 00:00:00', 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1), +(8, 'menu', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact', 'component', 1, 7, 2, 8, 0, '0000-00-00 00:00:00', 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1), +(9, 'menu', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&extension=com_contact', 'component', 1, 7, 2, 6, 0, '0000-00-00 00:00:00', 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1), +(10, 'menu', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 1, 1, 1, 15, 0, '0000-00-00 00:00:00', 0, 0, 'class:messages', 0, '', 17, 22, 0, '*', 1), +(11, 'menu', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 1, 10, 2, 15, 0, '0000-00-00 00:00:00', 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1), +(13, 'menu', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 1, 1, 17, 0, '0000-00-00 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 23, 28, 0, '*', 1), +(14, 'menu', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 13, 2, 17, 0, '0000-00-00 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 24, 25, 0, '*', 1), +(15, 'menu', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&extension=com_newsfeeds', 'component', 1, 13, 2, 6, 0, '0000-00-00 00:00:00', 0, 0, 'class:newsfeeds-cat', 0, '', 26, 27, 0, '*', 1), +(16, 'menu', 'com_redirect', 'Redirect', '', 'Redirect', 'index.php?option=com_redirect', 'component', 1, 1, 1, 24, 0, '0000-00-00 00:00:00', 0, 0, 'class:redirect', 0, '', 29, 30, 0, '*', 1), +(17, 'menu', 'com_search', 'Basic Search', '', 'Basic Search', 'index.php?option=com_search', 'component', 1, 1, 1, 19, 0, '0000-00-00 00:00:00', 0, 0, 'class:search', 0, '', 31, 32, 0, '*', 1), +(18, 'menu', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder', 'component', 1, 1, 1, 27, 0, '0000-00-00 00:00:00', 0, 0, 'class:finder', 0, '', 33, 34, 0, '*', 1), (19, 'menu', 'com_joomlaupdate', 'Joomla! Update', '', 'Joomla! Update', 'index.php?option=com_joomlaupdate', 'component', 1, 1, 1, 28, 0, '0000-00-00 00:00:00', 0, 0, 'class:joomlaupdate', 0, '', 35, 36, 0, '*', 1), -(20, 'main', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 0, 1, 1, 29, 0, '0000-00-00 00:00:00', 0, 1, 'class:tags', 0, '', 37, 38, 0, '', 1), -(21, 'main', 'com_postinstall', 'Post-installation messages', '', 'Post-installation messages', 'index.php?option=com_postinstall', 'component', 0, 1, 1, 32, 0, '0000-00-00 00:00:00', 0, 1, 'class:postinstall', 0, '', 39, 40, 0, '*', 1), +(20, 'main', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 1, 1, 1, 29, 0, '0000-00-00 00:00:00', 0, 1, 'class:tags', 0, '', 37, 38, 0, '', 1), +(21, 'main', 'com_postinstall', 'Post-installation messages', '', 'Post-installation messages', 'index.php?option=com_postinstall', 'component', 1, 1, 1, 32, 0, '0000-00-00 00:00:00', 0, 1, 'class:postinstall', 0, '', 39, 40, 0, '*', 1), (101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, 22, 0, '0000-00-00 00:00:00', 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 41, 42, 1, '*', 0); -- -------------------------------------------------------- @@ -1417,6 +1417,7 @@ CREATE TABLE IF NOT EXISTS `#__menu_types` ( `menutype` varchar(24) NOT NULL, `title` varchar(48) NOT NULL, `description` varchar(255) NOT NULL DEFAULT '', + `client_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `idx_menutype` (`menutype`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; @@ -1425,8 +1426,8 @@ CREATE TABLE IF NOT EXISTS `#__menu_types` ( -- Dumping data for table `#__menu_types` -- -INSERT INTO `#__menu_types` (`id`, `menutype`, `title`, `description`) VALUES -(1, 'mainmenu', 'Main Menu', 'The main menu for the site'); +INSERT INTO `#__menu_types` (`id`, `menutype`, `title`, `description` , `client_id`) VALUES +(1, 'mainmenu', 'Main Menu', 'The main menu for the site', 0); -- -------------------------------------------------------- diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index ae34c38941d98..a1cdd5518ddaa 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -1329,25 +1329,25 @@ COMMENT ON COLUMN "#__menu"."home" IS 'Indicates if this menu item is the home o -- INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id") VALUES (1, '', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, '1970-01-01 00:00:00', 0, 0, '', 0, '', 0, 43, 0, '*', 0), -(2, 'menu', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 0, 1, 1, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1), -(3, 'menu', 'com_banners', 'Banners', '', 'Banners/Banners', 'index.php?option=com_banners', 'component', 0, 2, 2, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 2, 3, 0, '*', 1), -(4, 'menu', 'com_banners_categories', 'Categories', '', 'Banners/Categories', 'index.php?option=com_categories&extension=com_banners', 'component', 0, 2, 2, 6, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners-cat', 0, '', 4, 5, 0, '*', 1), -(5, 'menu', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'index.php?option=com_banners&view=clients', 'component', 0, 2, 2, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners-clients', 0, '', 6, 7, 0, '*', 1), -(6, 'menu', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 0, 2, 2, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1), -(7, 'menu', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 0, 1, 1, 8, 0, '1970-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1), -(8, 'menu', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact', 'component', 0, 7, 2, 8, 0, '1970-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1), -(9, 'menu', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&extension=com_contact', 'component', 0, 7, 2, 6, 0, '1970-01-01 00:00:00', 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1), -(10, 'menu', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 0, 1, 1, 15, 0, '1970-01-01 00:00:00', 0, 0, 'class:messages', 0, '', 17, 22, 0, '*', 1), -(11, 'menu', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 0, 10, 2, 15, 0, '1970-01-01 00:00:00', 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1), -(13, 'menu', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 0, 1, 1, 17, 0, '1970-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 23, 28, 0, '*', 1), -(14, 'menu', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds', 'component', 0, 13, 2, 17, 0, '1970-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 24, 25, 0, '*', 1), -(15, 'menu', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&extension=com_newsfeeds', 'component', 0, 13, 2, 6, 0, '1970-01-01 00:00:00', 0, 0, 'class:newsfeeds-cat', 0, '', 26, 27, 0, '*', 1), -(16, 'menu', 'com_redirect', 'Redirect', '', 'Redirect', 'index.php?option=com_redirect', 'component', 0, 1, 1, 24, 0, '1970-01-01 00:00:00', 0, 0, 'class:redirect', 0, '', 29, 30, 0, '*', 1), -(17, 'menu', 'com_search', 'Basic Search', '', 'Basic Search', 'index.php?option=com_search', 'component', 0, 1, 1, 19, 0, '1970-01-01 00:00:00', 0, 0, 'class:search', 0, '', 31, 32, 0, '*', 1), -(18, 'menu', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder', 'component', 0, 1, 1, 27, 0, '1970-01-01 00:00:00', 0, 0, 'class:finder', 0, '', 33, 34, 0, '*', 1), +(2, 'menu', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 1, 1, 1, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1), +(3, 'menu', 'com_banners', 'Banners', '', 'Banners/Banners', 'index.php?option=com_banners', 'component', 1, 2, 2, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 2, 3, 0, '*', 1), +(4, 'menu', 'com_banners_categories', 'Categories', '', 'Banners/Categories', 'index.php?option=com_categories&extension=com_banners', 'component', 1, 2, 2, 6, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners-cat', 0, '', 4, 5, 0, '*', 1), +(5, 'menu', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'index.php?option=com_banners&view=clients', 'component', 1, 2, 2, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners-clients', 0, '', 6, 7, 0, '*', 1), +(6, 'menu', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 1, 2, 2, 4, 0, '1970-01-01 00:00:00', 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1), +(7, 'menu', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 1, 1, 1, 8, 0, '1970-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1), +(8, 'menu', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact', 'component', 1, 7, 2, 8, 0, '1970-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1), +(9, 'menu', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&extension=com_contact', 'component', 1, 7, 2, 6, 0, '1970-01-01 00:00:00', 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1), +(10, 'menu', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 1, 1, 1, 15, 0, '1970-01-01 00:00:00', 0, 0, 'class:messages', 0, '', 17, 22, 0, '*', 1), +(11, 'menu', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 1, 10, 2, 15, 0, '1970-01-01 00:00:00', 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1), +(13, 'menu', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 1, 1, 17, 0, '1970-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 23, 28, 0, '*', 1), +(14, 'menu', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 13, 2, 17, 0, '1970-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 24, 25, 0, '*', 1), +(15, 'menu', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&extension=com_newsfeeds', 'component', 1, 13, 2, 6, 0, '1970-01-01 00:00:00', 0, 0, 'class:newsfeeds-cat', 0, '', 26, 27, 0, '*', 1), +(16, 'menu', 'com_redirect', 'Redirect', '', 'Redirect', 'index.php?option=com_redirect', 'component', 1, 1, 1, 24, 0, '1970-01-01 00:00:00', 0, 0, 'class:redirect', 0, '', 29, 30, 0, '*', 1), +(17, 'menu', 'com_search', 'Basic Search', '', 'Basic Search', 'index.php?option=com_search', 'component', 1, 1, 1, 19, 0, '1970-01-01 00:00:00', 0, 0, 'class:search', 0, '', 31, 32, 0, '*', 1), +(18, 'menu', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder', 'component', 1, 1, 1, 27, 0, '1970-01-01 00:00:00', 0, 0, 'class:finder', 0, '', 33, 34, 0, '*', 1), (19, 'menu', 'com_joomlaupdate', 'Joomla! Update', '', 'Joomla! Update', 'index.php?option=com_joomlaupdate', 'component', 1, 1, 1, 28, 0, '1970-01-01 00:00:00', 0, 0, 'class:joomlaupdate', 0, '', 35, 36, 0, '*', 1), -(20, 'main', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 0, 1, 1, 29, 0, '1970-01-01 00:00:00', 0, 1, 'class:tags', 0, '', 37, 38, 0, '', 1), -(21, 'main', 'com_postinstall', 'Post-installation messages', '', 'Post-installation messages', 'index.php?option=com_postinstall', 'component', 0, 1, 1, 32, 0, '1970-01-01 00:00:00', 0, 1, 'class:postinstall', 0, '', 39, 40, 0, '*', 1), +(20, 'main', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 1, 1, 1, 29, 0, '1970-01-01 00:00:00', 0, 1, 'class:tags', 0, '', 37, 38, 0, '', 1), +(21, 'main', 'com_postinstall', 'Post-installation messages', '', 'Post-installation messages', 'index.php?option=com_postinstall', 'component', 1, 1, 1, 32, 0, '1970-01-01 00:00:00', 0, 1, 'class:postinstall', 0, '', 39, 40, 0, '*', 1), (101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, 22, 0, '1970-01-01 00:00:00', 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 41, 42, 1, '*', 0); SELECT setval('#__menu_id_seq', 102, false); @@ -1361,6 +1361,7 @@ CREATE TABLE "#__menu_types" ( "menutype" varchar(24) NOT NULL, "title" varchar(48) NOT NULL, "description" varchar(255) DEFAULT '' NOT NULL, + "client_id" int DEFAULT 0 NOT NULL, PRIMARY KEY ("id"), CONSTRAINT "#__menu_types_idx_menutype" UNIQUE ("menutype") ); @@ -1368,8 +1369,8 @@ CREATE TABLE "#__menu_types" ( -- -- Dumping data for table #__menu_types -- -INSERT INTO "#__menu_types" ("id", "menutype", "title", "description") VALUES -(1, 'mainmenu', 'Main Menu', 'The main menu for the site'); +INSERT INTO "#__menu_types" ("id", "menutype", "title", "description", "client_id") VALUES +(1, 'mainmenu', 'Main Menu', 'The main menu for the site', 0); SELECT setval('#__menu_types_id_seq', 2, false); diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index 698a2fed5e5c3..ac38e0d4b8012 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -2266,43 +2266,43 @@ SET IDENTITY_INSERT [#__menu] ON; INSERT INTO [#__menu] ([id], [menutype], [title], [alias], [note], [path], [link], [type], [published], [parent_id], [level], [component_id], [checked_out], [checked_out_time], [browserNav], [access], [img], [template_style_id], [params], [lft], [rgt], [home], [language], [client_id]) SELECT 1, '', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, '1900-01-01 00:00:00', 0, 0, '', 0, '', 0, 43, 0, '*', 0 UNION ALL -SELECT 2, 'menu', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 0, 1, 1, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1 +SELECT 2, 'menu', 'com_banners', 'Banners', '', 'Banners', 'index.php?option=com_banners', 'component', 1, 1, 1, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 1, 10, 0, '*', 1 UNION ALL -SELECT 3, 'menu', 'com_banners', 'Banners', '', 'Banners/Banners', 'index.php?option=com_banners', 'component', 0, 2, 2, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 2, 3, 0, '*', 1 +SELECT 3, 'menu', 'com_banners', 'Banners', '', 'Banners/Banners', 'index.php?option=com_banners', 'component', 1, 2, 2, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners', 0, '', 2, 3, 0, '*', 1 UNION ALL -SELECT 4, 'menu', 'com_banners_categories', 'Categories', '', 'Banners/Categories', 'index.php?option=com_categories&extension=com_banners', 'component', 0, 2, 2, 6, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners-cat', 0, '', 4, 5, 0, '*', 1 +SELECT 4, 'menu', 'com_banners_categories', 'Categories', '', 'Banners/Categories', 'index.php?option=com_categories&extension=com_banners', 'component', 1, 2, 2, 6, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners-cat', 0, '', 4, 5, 0, '*', 1 UNION ALL -SELECT 5, 'menu', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'index.php?option=com_banners&view=clients', 'component', 0, 2, 2, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners-clients', 0, '', 6, 7, 0, '*', 1 +SELECT 5, 'menu', 'com_banners_clients', 'Clients', '', 'Banners/Clients', 'index.php?option=com_banners&view=clients', 'component', 1, 2, 2, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners-clients', 0, '', 6, 7, 0, '*', 1 UNION ALL -SELECT 6, 'menu', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 0, 2, 2, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1 +SELECT 6, 'menu', 'com_banners_tracks', 'Tracks', '', 'Banners/Tracks', 'index.php?option=com_banners&view=tracks', 'component', 1, 2, 2, 4, 0, '1900-01-01 00:00:00', 0, 0, 'class:banners-tracks', 0, '', 8, 9, 0, '*', 1 UNION ALL -SELECT 7, 'menu', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 0, 1, 1, 8, 0, '1900-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1 +SELECT 7, 'menu', 'com_contact', 'Contacts', '', 'Contacts', 'index.php?option=com_contact', 'component', 1, 1, 1, 8, 0, '1900-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 11, 16, 0, '*', 1 UNION ALL -SELECT 8, 'menu', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact', 'component', 0, 7, 2, 8, 0, '1900-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1 +SELECT 8, 'menu', 'com_contact_contacts', 'Contacts', '', 'Contacts/Contacts', 'index.php?option=com_contact', 'component', 1, 7, 2, 8, 0, '1900-01-01 00:00:00', 0, 0, 'class:contact', 0, '', 12, 13, 0, '*', 1 UNION ALL -SELECT 9, 'menu', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&extension=com_contact', 'component', 0, 7, 2, 6, 0, '1900-01-01 00:00:00', 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1 +SELECT 9, 'menu', 'com_contact_categories', 'Categories', '', 'Contacts/Categories', 'index.php?option=com_categories&extension=com_contact', 'component', 1, 7, 2, 6, 0, '1900-01-01 00:00:00', 0, 0, 'class:contact-cat', 0, '', 14, 15, 0, '*', 1 UNION ALL -SELECT 10, 'menu', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 0, 1, 1, 15, 0, '1900-01-01 00:00:00', 0, 0, 'class:messages', 0, '', 17, 22, 0, '*', 1 +SELECT 10, 'menu', 'com_messages', 'Messaging', '', 'Messaging', 'index.php?option=com_messages', 'component', 1, 1, 1, 15, 0, '1900-01-01 00:00:00', 0, 0, 'class:messages', 0, '', 17, 22, 0, '*', 1 UNION ALL -SELECT 11, 'menu', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 0, 10, 2, 15, 0, '1900-01-01 00:00:00', 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1 +SELECT 11, 'menu', 'com_messages_add', 'New Private Message', '', 'Messaging/New Private Message', 'index.php?option=com_messages&task=message.add', 'component', 1, 10, 2, 15, 0, '1900-01-01 00:00:00', 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1 UNION ALL -SELECT 13, 'menu', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 0, 1, 1, 17, 0, '1900-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 23, 28, 0, '*', 1 +SELECT 13, 'menu', 'com_newsfeeds', 'News Feeds', '', 'News Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 1, 1, 17, 0, '1900-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 23, 28, 0, '*', 1 UNION ALL -SELECT 14, 'menu', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds', 'component', 0, 13, 2, 17, 0, '1900-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 24, 25, 0, '*', 1 +SELECT 14, 'menu', 'com_newsfeeds_feeds', 'Feeds', '', 'News Feeds/Feeds', 'index.php?option=com_newsfeeds', 'component', 1, 13, 2, 17, 0, '1900-01-01 00:00:00', 0, 0, 'class:newsfeeds', 0, '', 24, 25, 0, '*', 1 UNION ALL -SELECT 15, 'menu', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&extension=com_newsfeeds', 'component', 0, 13, 2, 6, 0, '1900-01-01 00:00:00', 0, 0, 'class:newsfeeds-cat', 0, '', 26, 27, 0, '*', 1 +SELECT 15, 'menu', 'com_newsfeeds_categories', 'Categories', '', 'News Feeds/Categories', 'index.php?option=com_categories&extension=com_newsfeeds', 'component', 1, 13, 2, 6, 0, '1900-01-01 00:00:00', 0, 0, 'class:newsfeeds-cat', 0, '', 26, 27, 0, '*', 1 UNION ALL -SELECT 16, 'menu', 'com_redirect', 'Redirect', '', 'Redirect', 'index.php?option=com_redirect', 'component', 0, 1, 1, 24, 0, '1900-01-01 00:00:00', 0, 0, 'class:redirect', 0, '', 29, 30, 0, '*', 1 +SELECT 16, 'menu', 'com_redirect', 'Redirect', '', 'Redirect', 'index.php?option=com_redirect', 'component', 1, 1, 1, 24, 0, '1900-01-01 00:00:00', 0, 0, 'class:redirect', 0, '', 29, 30, 0, '*', 1 UNION ALL -SELECT 17, 'menu', 'com_search', 'Basic Search', '', 'Basic Search', 'index.php?option=com_search', 'component', 0, 1, 1, 19, 0, '1900-01-01 00:00:00', 0, 0, 'class:search', 0, '', 31, 32, 0, '*', 1 +SELECT 17, 'menu', 'com_search', 'Basic Search', '', 'Basic Search', 'index.php?option=com_search', 'component', 1, 1, 1, 19, 0, '1900-01-01 00:00:00', 0, 0, 'class:search', 0, '', 31, 32, 0, '*', 1 UNION ALL -SELECT 18, 'menu', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder', 'component', 0, 1, 1, 27, 0, '1900-01-01 00:00:00', 0, 0, 'class:finder', 0, '', 33, 34, 0, '*', 1 +SELECT 18, 'menu', 'com_finder', 'Smart Search', '', 'Smart Search', 'index.php?option=com_finder', 'component', 1, 1, 1, 27, 0, '1900-01-01 00:00:00', 0, 0, 'class:finder', 0, '', 33, 34, 0, '*', 1 UNION ALL SELECT 19, 'menu', 'com_joomlaupdate', 'Joomla! Update', '', 'Joomla! Update', 'index.php?option=com_joomlaupdate', 'component', 1, 1, 1, 28, 0, '1900-01-01 00:00:00', 0, 0, 'class:joomlaupdate', 0, '', 35, 36, 0, '*', 1 UNION ALL -SELECT 20, 'menu', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 0, 1, 1, 29, 0, '1900-01-01 00:00:00', 0, 1, 'class:tags', 0, '', 37, 38, 0, '*', 1 +SELECT 20, 'menu', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 1, 1, 1, 29, 0, '1900-01-01 00:00:00', 0, 1, 'class:tags', 0, '', 37, 38, 0, '*', 1 UNION ALL -SELECT 21, 'menu', 'com_postinstall', 'Post-installation messages', '', 'Post-installation messages', 'index.php?option=com_postinstall', 'component', 0, 1, 1, 32, 0, '1900-01-01 00:00:00', 0, 1, 'class:postinstall', 0, '', 39, 40, 0, '*', 1 +SELECT 21, 'menu', 'com_postinstall', 'Post-installation messages', '', 'Post-installation messages', 'index.php?option=com_postinstall', 'component', 1, 1, 1, 32, 0, '1900-01-01 00:00:00', 0, 1, 'class:postinstall', 0, '', 39, 40, 0, '*', 1 UNION ALL SELECT 101, 'mainmenu', 'Home', 'home', '', 'home', 'index.php?option=com_content&view=featured', 'component', 1, 1, 1, 22, 0, '1900-01-01 00:00:00', 0, 1, '', 0, '{"featured_categories":[""],"layout_type":"blog","num_leading_articles":"1","num_intro_articles":"3","num_columns":"3","num_links":"0","multi_column_order":"1","orderby_pri":"","orderby_sec":"front","order_date":"","show_pagination":"2","show_pagination_results":"1","show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_readmore":"","show_readmore_title":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","show_noauth":"","show_feed_link":"1","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 41, 42, 1, '*', 0; @@ -2317,6 +2317,7 @@ CREATE TABLE [#__menu_types]( [menutype] [nvarchar](24) NOT NULL, [title] [nvarchar](48) NOT NULL, [description] [nvarchar](255) NOT NULL DEFAULT '', + [client_id] [tinyint] NOT NULL DEFAULT 0, CONSTRAINT [PK_#__menu_types_id] PRIMARY KEY CLUSTERED ( [id] ASC @@ -2329,8 +2330,8 @@ CREATE TABLE [#__menu_types]( SET IDENTITY_INSERT [#__menu_types] ON; -INSERT INTO [#__menu_types] ([id], [menutype], [title], [description]) -SELECT 1, 'mainmenu', 'Main Menu', 'The main menu for the site'; +INSERT INTO [#__menu_types] ([id], [menutype], [title], [description], [client_id]) +SELECT 1, 'mainmenu', 'Main Menu', 'The main menu for the site', 0; SET IDENTITY_INSERT [#__menu_types] OFF; diff --git a/libraries/cms/form/field/menu.php b/libraries/cms/form/field/menu.php index 265749b0c40ca..e96bdf0f73e55 100644 --- a/libraries/cms/form/field/menu.php +++ b/libraries/cms/form/field/menu.php @@ -12,14 +12,14 @@ // Import the com_menus helper. require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); -JFormHelper::loadFieldClass('list'); +JFormHelper::loadFieldClass('GroupedList'); /** * Supports an HTML select list of menus * * @since 1.6 */ -class JFormFieldMenu extends JFormFieldList +class JFormFieldMenu extends JFormFieldGroupedList { /** * The form field type. @@ -30,29 +30,43 @@ class JFormFieldMenu extends JFormFieldList public $type = 'Menu'; /** - * Method to get the list of menus for the field options. + * Method to get the field option groups. * - * @return array The field option objects. + * @return array The field option objects as a nested array in groups. * - * @since 1.6 + * @since 11.1 + * @throws UnexpectedValueException */ - protected function getOptions() + protected function getGroups() { - $menus = JHtml::_('menu.menus'); + $clientId = (string) $this->element['clientid']; + $accessType = (string) $this->element['accesstype']; + $showAll = (string) $this->element['showAll'] == 'true'; - $accesstype = $this->element['accesstype']; + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->qn(array('id', 'menutype', 'title', 'client_id'), array('id', 'value', 'text', 'client_id'))) + ->from($db->quoteName('#__menu_types')) + ->order('client_id, title'); - if ($accesstype) + if (strlen($clientId)) + { + $query->where('client_id = ' . (int) $clientId); + } + + $menus = $db->setQuery($query)->loadObjectList(); + + if ($accessType) { $user = JFactory::getUser(); foreach ($menus as $key => $menu) { - switch ($accesstype) + switch ($accessType) { case 'create': case 'manage': - if (!$user->authorise('core.' . $accesstype, 'com_menus.menu.' . (int) $menu->id)) + if (!$user->authorise('core.' . $accessType, 'com_menus.menu.' . (int) $menu->id)) { unset($menus[$key]); } @@ -60,7 +74,6 @@ protected function getOptions() // Editing a menu item is a bit tricky, we have to check the current menutype for core.edit and all others for core.create case 'edit': - $check = $this->value == $menu->value ? 'edit' : 'create'; if (!$user->authorise('core.' . $check, 'com_menus.menu.' . (int) $menu->id)) @@ -72,9 +85,45 @@ protected function getOptions() } } + $opts = array(); + + // Protected menutypes can be shown if requested + if ($clientId == 1 && $showAll) + { + $opts[] = (object) array( + 'value' => 'main', + 'text' => JText::_('COM_MENUS_MENU_TYPE_PROTECTED_MAIN_LABEL'), + 'client_id' => 1, + ); + + $opts[] = (object) array( + 'value' => 'menu', + 'text' => JText::_('COM_MENUS_MENU_TYPE_PROTECTED_MENU_LABEL'), + 'client_id' => 1, + ); + } + + $options = array_merge($opts, $menus); + $groups = array(); + + if (strlen($clientId)) + { + $groups[0] = $options; + } + else + { + foreach ($options as $option) + { + // If client id is not specified we group the items. + $label = ($option->client_id == 1 ? JText::_('JADMINISTRATOR') : JText::_('JSITE')); + + $groups[$label][] = $option; + } + } + // Merge any additional options in the XML definition. - $options = array_merge(parent::getOptions(), $menus); + $groups = array_merge(parent::getGroups(), $groups); - return $options; + return $groups; } } diff --git a/libraries/cms/installer/adapter/component.php b/libraries/cms/installer/adapter/component.php index b4985b326b340..72fa9cedd4b01 100644 --- a/libraries/cms/installer/adapter/component.php +++ b/libraries/cms/installer/adapter/component.php @@ -963,7 +963,7 @@ protected function _buildAdminMenus($component_id = null) $data['alias'] = (string) $menuElement; $data['link'] = 'index.php?option=' . $option; $data['type'] = 'component'; - $data['published'] = 0; + $data['published'] = 1; $data['parent_id'] = 1; $data['component_id'] = $component_id; $data['img'] = ((string) $menuElement->attributes()->img) ? (string) $menuElement->attributes()->img : 'class:component'; @@ -981,7 +981,7 @@ protected function _buildAdminMenus($component_id = null) $data['alias'] = $option; $data['link'] = 'index.php?option=' . $option; $data['type'] = 'component'; - $data['published'] = 0; + $data['published'] = 1; $data['parent_id'] = 1; $data['component_id'] = $component_id; $data['img'] = 'class:component'; @@ -1016,7 +1016,7 @@ protected function _buildAdminMenus($component_id = null) $data['title'] = (string) trim($child); $data['alias'] = (string) $child; $data['type'] = 'component'; - $data['published'] = 0; + $data['published'] = 1; $data['parent_id'] = $parent_id; $data['component_id'] = $component_id; $data['img'] = ((string) $child->attributes()->img) ? (string) $child->attributes()->img : 'class:component'; diff --git a/libraries/joomla/form/fields/components.php b/libraries/joomla/form/fields/components.php new file mode 100644 index 0000000000000..a0bec115f0cb4 --- /dev/null +++ b/libraries/joomla/form/fields/components.php @@ -0,0 +1,74 @@ +getQuery(true) + ->select('name AS text, element AS value') + ->from('#__extensions') + ->where('enabled >= 1') + ->where('type =' . $db->quote('component')); + + $items = $db->setQuery($query)->loadObjectList(); + + if ($items) + { + $lang = JFactory::getLanguage(); + + foreach ($items as &$item) + { + // Load language + $extension = $item->value; + + $lang->load("$extension.sys", JPATH_ADMINISTRATOR, null, false, true) + || $lang->load("$extension.sys", JPATH_ADMINISTRATOR . '/components/' . $extension, null, false, true); + + // Translate component name + $item->text = JText::_($item->text); + } + + // Sort by component name + $items = ArrayHelper::sortObjects($items, 'text', 1, true, true); + } + + // Merge any additional options in the XML definition. + $options = array_merge(parent::getOptions(), $items); + + return $options; + } +} diff --git a/libraries/legacy/table/menu.php b/libraries/legacy/table/menu.php index 30530d85f5290..3ee1910de5316 100644 --- a/libraries/legacy/table/menu.php +++ b/libraries/legacy/table/menu.php @@ -148,22 +148,25 @@ public function store($updateNulls = false) $this->alias = !$originalAlias ? $this->title : $originalAlias; $this->alias = JApplicationHelper::stringURLSafe(trim($this->alias), $this->language); - // Verify that a first level menu item alias is not 'component'. - if ($this->parent_id == 1 && $this->alias == 'component') + if ($this->parent_id == 1 && $this->client_id == 0) { - $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_COMPONENT')); + // Verify that a first level menu item alias is not 'component'. + if ( $this->alias == 'component') + { + $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_COMPONENT')); - return false; - } + return false; + } - // Verify that a first level menu item alias is not the name of a folder. - jimport('joomla.filesystem.folder'); + // Verify that a first level menu item alias is not the name of a folder. + jimport('joomla.filesystem.folder'); - if ($this->parent_id == 1 && in_array($this->alias, JFolder::folders(JPATH_ROOT))) - { - $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER', $this->alias, $this->alias)); + if (in_array($this->alias, JFolder::folders(JPATH_ROOT))) + { + $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER', $this->alias, $this->alias)); - return false; + return false; + } } // If alias still empty (for instance, new menu item with chinese characters with no unicode alias setting). @@ -244,8 +247,8 @@ public function store($updateNulls = false) return false; } - // Verify that the home page for this language is unique - if ($table->load(array('home' => '1', 'language' => $this->language))) + // Verify that the home page for this language is unique per client id + if ($table->load(array('home' => '1', 'language' => $this->language, 'client_id' => (int) $this->client_id))) { if ($table->checked_out && $table->checked_out != $this->checked_out) { diff --git a/modules/mod_menu/mod_menu.xml b/modules/mod_menu/mod_menu.xml index b930a44032cc1..887b1792ddbf9 100644 --- a/modules/mod_menu/mod_menu.xml +++ b/modules/mod_menu/mod_menu.xml @@ -27,6 +27,7 @@