diff --git a/administrator/components/com_cache/Controller/DisplayController.php b/administrator/components/com_cache/Controller/DisplayController.php index de02963b282..cb37d7a60f6 100644 --- a/administrator/components/com_cache/Controller/DisplayController.php +++ b/administrator/components/com_cache/Controller/DisplayController.php @@ -33,8 +33,6 @@ class DisplayController extends BaseController /** * Method to get The Cache Size - * - * @return integer The cache size in kB * * @since 4.0 */ @@ -44,7 +42,7 @@ public function getQuickiconContent() $data = $model->getData(); - $size = '0.0'; + $size = 0; if (!empty($data)) { @@ -55,9 +53,19 @@ public function getQuickiconContent() } // Number bytes are returned in format xxx.xx MB - $result = strstr(HTMLHelper::_('number.bytes', $size, 'MB', 1, false), '.', true); + $bytes = HTMLHelper::_('number.bytes', $size, 'MB', 1); + + if (!empty($bytes)) + { + $result['amount'] = $bytes; + $result['sronly'] = Text::sprintf('COM_CACHE_QUICKICON_SRONLY', $bytes); + } + else + { + $result['amount'] = 0; + $result['sronly'] = Text::sprintf('COM_CACHE_QUICKICON_SRONLY_NOCACHE'); + } - // Return number only echo new JsonResponse($result); } diff --git a/administrator/components/com_categories/Controller/CategoriesController.php b/administrator/components/com_categories/Controller/CategoriesController.php index 5de5333be78..bc5a5ccfd13 100644 --- a/administrator/components/com_categories/Controller/CategoriesController.php +++ b/administrator/components/com_categories/Controller/CategoriesController.php @@ -43,7 +43,7 @@ public function getModel($name = 'Category', $prefix = 'Administrator', $config /** * Method to get the number of content categories * - * @return integer The amount of published content categories + * @return string The JSON-encoded amount of published content categories * * @since 4.0 */ @@ -55,7 +55,13 @@ public function getQuickiconContent() $amount = (int) $model->getTotal(); - echo new JsonResponse($amount); + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_CATEGORIES_N_QUICKICON_SRONLY', $amount); + $result['name'] = Text::plural('COM_CATEGORIES_N_QUICKICON', $amount); + + echo new JsonResponse($result); } /** diff --git a/administrator/components/com_checkin/Controller/DisplayController.php b/administrator/components/com_checkin/Controller/DisplayController.php index cee16d1f62f..e08d60dfe11 100644 --- a/administrator/components/com_checkin/Controller/DisplayController.php +++ b/administrator/components/com_checkin/Controller/DisplayController.php @@ -93,4 +93,30 @@ public function getMenuBadgeData() echo new JsonResponse($amount); } + + /** + * Method to get the number of locked icons + * + * @return void + * + * @since 4.0 + */ + public function getQuickiconContent() + { + if (!Factory::getUser()->authorise('core.manage', 'com_checkin')) + { + throw new \Exception(Text::_('JGLOBAL_AUTH_ACCESS_DENIED')); + } + + $model = $this->getModel('Checkin'); + + $amount = (int) count($model->getItems()); + + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_CHECKIN_N_QUICKICON_SRONLY', $amount); + + echo new JsonResponse($result); + } } diff --git a/administrator/components/com_content/Controller/ArticlesController.php b/administrator/components/com_content/Controller/ArticlesController.php index 9959e36cfc4..ad2aae724b3 100644 --- a/administrator/components/com_content/Controller/ArticlesController.php +++ b/administrator/components/com_content/Controller/ArticlesController.php @@ -139,7 +139,7 @@ public function getModel($name = 'Article', $prefix = 'Administrator', $config = /** * Method to get the number of published articles for quickicons * - * @return integer The amount of published articles + * @return string The JSON-encoded amount of published articles * * @since 4.0 */ @@ -151,6 +151,12 @@ public function getQuickiconContent() $amount = (int) $model->getTotal(); - echo new JsonResponse($amount); + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_CONTENT_N_QUICKICON_SRONLY', $amount); + $result['name'] = Text::plural('COM_CONTENT_N_QUICKICON', $amount); + + echo new JsonResponse($result); } } diff --git a/administrator/components/com_menus/Controller/ItemsController.php b/administrator/components/com_menus/Controller/ItemsController.php index ffd5432db90..6e7c94101bf 100644 --- a/administrator/components/com_menus/Controller/ItemsController.php +++ b/administrator/components/com_menus/Controller/ItemsController.php @@ -77,7 +77,13 @@ public function getQuickiconContent() $amount = (int) $model->getTotal(); - echo new JsonResponse($amount); + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_MENUS_ITEMS_N_QUICKICON_SRONLY', $amount); + $result['name'] = Text::plural('COM_MENUS_ITEMS_N_QUICKICON', $amount); + + echo new JsonResponse($result); } /** diff --git a/administrator/components/com_modules/Controller/ModulesController.php b/administrator/components/com_modules/Controller/ModulesController.php index d580bf6c219..43effc674db 100644 --- a/administrator/components/com_modules/Controller/ModulesController.php +++ b/administrator/components/com_modules/Controller/ModulesController.php @@ -76,7 +76,7 @@ public function getModel($name = 'Module', $prefix = 'Administrator', $config = /** * Method to get the number of frontend modules * - * @return integer The amount of modules + * @return string The JSON-encoded amount of modules * * @since 4.0 */ @@ -87,8 +87,14 @@ public function getQuickiconContent() $model->setState('filter.published', 1); $model->setState('filter.client_id', 0); - $amount = $model->getTotal() ? $model->getTotal() : '0'; + $amount = (int) $model->getTotal(); - echo new JsonResponse($amount); + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_MODULES_N_QUICKICON_SRONLY', $amount); + $result['name'] = Text::plural('COM_MODULES_N_QUICKICON', $amount); + + echo new JsonResponse($result); } } diff --git a/administrator/components/com_plugins/Controller/PluginsController.php b/administrator/components/com_plugins/Controller/PluginsController.php index 0face3ced6d..582e4c9610c 100644 --- a/administrator/components/com_plugins/Controller/PluginsController.php +++ b/administrator/components/com_plugins/Controller/PluginsController.php @@ -11,6 +11,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\Response\JsonResponse; @@ -40,7 +41,7 @@ public function getModel($name = 'Plugin', $prefix = 'Administrator', $config = /** * Method to get the number of activated plugins * - * @return integer The amount of items + * @return string The JSON-encoded amount of items * * @since 4.0 */ @@ -52,6 +53,12 @@ public function getQuickiconContent() $amount = (int) $model->getTotal(); - echo new JsonResponse($amount); + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_PLUGINS_N_QUICKICON_SRONLY', $amount); + $result['name'] = Text::plural('COM_PLUGINS_N_QUICKICON', $amount); + + echo new JsonResponse($result); } } diff --git a/administrator/components/com_users/Controller/UsersController.php b/administrator/components/com_users/Controller/UsersController.php index a96fc133512..1c27713ec5e 100644 --- a/administrator/components/com_users/Controller/UsersController.php +++ b/administrator/components/com_users/Controller/UsersController.php @@ -156,7 +156,7 @@ public function activate() /** * Method to get the number of active users * - * @return integer The amount of users + * @return string The JSON-encoded amount of users * * @since 4.0 */ @@ -168,6 +168,12 @@ public function getQuickiconContent() $amount = (int) $model->getTotal(); - echo new JsonResponse($amount); + $result = []; + + $result['amount'] = $amount; + $result['sronly'] = Text::plural('COM_USERS_N_QUICKICON_SRONLY', $amount); + $result['name'] = Text::plural('COM_USERS_N_QUICKICON', $amount); + + echo new JsonResponse($result); } } diff --git a/administrator/language/en-GB/en-GB.com_cache.ini b/administrator/language/en-GB/en-GB.com_cache.ini index 9622d4ea0c1..71a96c4298b 100644 --- a/administrator/language/en-GB/en-GB.com_cache.ini +++ b/administrator/language/en-GB/en-GB.com_cache.ini @@ -28,6 +28,8 @@ COM_CACHE_NUMBER_OF_FILES="Number of Files" COM_CACHE_PURGE_EXPIRED="Clear Expired Cache" COM_CACHE_PURGE_EXPIRED_ITEMS="Clear expired items" COM_CACHE_PURGE_INSTRUCTIONS="Select the Clear Expired Cache icon in the toolbar to delete all expired cache files. Note: Cache files that are still current will not be deleted." +COM_CACHE_QUICKICON_SRONLY="Cache: Size of cache is %s." +COM_CACHE_QUICKICON_SRONLY_NOCACHE="Cache is not enabled." COM_CACHE_RESOURCE_INTENSIVE_WARNING="This can be resource intensive on sites with a large number of items!" COM_CACHE_SIZE="Size" COM_CACHE_SELECT_CLIENT="- Select Location -" diff --git a/administrator/language/en-GB/en-GB.com_categories.ini b/administrator/language/en-GB/en-GB.com_categories.ini index 957362b7df8..85214d0bd66 100644 --- a/administrator/language/en-GB/en-GB.com_categories.ini +++ b/administrator/language/en-GB/en-GB.com_categories.ini @@ -49,6 +49,12 @@ COM_CATEGORIES_N_ITEMS_UNPUBLISHED_1="%d category unpublished." COM_CATEGORIES_NEW_CATEGORY="New Category" COM_CATEGORIES_NO_ITEM_SELECTED="Please first make a selection from the list." COM_CATEGORIES_PATH_LABEL="Category Path" +COM_CATEGORIES_N_QUICKICON="Article Categories" +COM_CATEGORIES_N_QUICKICON_0="Article Categories" +COM_CATEGORIES_N_QUICKICON_1="Article Category" +COM_CATEGORIES_N_QUICKICON_SRONLY="Categories: %s categories are available" +COM_CATEGORIES_N_QUICKICON_SRONLY_0="Categories: No category is available" +COM_CATEGORIES_N_QUICKICON_SRONLY_1="Categories: One categoy is available" COM_CATEGORIES_REBUILD_FAILURE="Failed rebuilding Categories tree data." COM_CATEGORIES_REBUILD_SUCCESS="Categories tree data rebuilt." COM_CATEGORIES_SAVE_SUCCESS="Category saved." diff --git a/administrator/language/en-GB/en-GB.com_checkin.ini b/administrator/language/en-GB/en-GB.com_checkin.ini index 270a7f09ef7..50495e1a2d8 100644 --- a/administrator/language/en-GB/en-GB.com_checkin.ini +++ b/administrator/language/en-GB/en-GB.com_checkin.ini @@ -17,6 +17,9 @@ COM_CHECKIN_ITEMS_TO_CHECK_IN_DESC="Items to check-in descending" COM_CHECKIN_N_ITEMS_CHECKED_IN_1="1 item checked in." COM_CHECKIN_N_ITEMS_CHECKED_IN_MORE="%s items checked in." COM_CHECKIN_NO_ITEMS="There are no tables with checked out items or there are no tables with checked out items that match your search." +COM_CHECKIN_N_QUICKICON_SRONLY="Global Checkin: %s Items are locked." +COM_CHECKIN_N_QUICKICON_SRONLY_0="Global Checkin: No Items are locked." +COM_CHECKIN_N_QUICKICON_SRONLY_1="Global Checkin: One Item is locked." COM_CHECKIN_TABLE="%s table" COM_CHECKIN_TABLE_CAPTION="Table of Checked Out Items" COM_CHECKIN_XML_DESCRIPTION="Check-in Component." diff --git a/administrator/language/en-GB/en-GB.com_content.ini b/administrator/language/en-GB/en-GB.com_content.ini index 286d35188a3..9da222db214 100644 --- a/administrator/language/en-GB/en-GB.com_content.ini +++ b/administrator/language/en-GB/en-GB.com_content.ini @@ -6,6 +6,12 @@ COM_CONTENT="Articles" COM_CONTENT_ADD_NEW_MENU_ITEM="New Menu Item" COM_CONTENT_ARTICLE_CONTENT="Content" +COM_CONTENT_N_QUICKICON="Articles" +COM_CONTENT_N_QUICKICON_0="Articles" +COM_CONTENT_N_QUICKICON_1="Article" +COM_CONTENT_N_QUICKICON_SRONLY="Articles: %s articles are available" +COM_CONTENT_N_QUICKICON_SRONLY_0="Articles: No article is available" +COM_CONTENT_N_QUICKICON_SRONLY_1="Articles: One article is available" COM_CONTENT_ARTICLES_TABLE_CAPTION="Table of Articles" COM_CONTENT_ARTICLES_TITLE="Articles" COM_CONTENT_ATTRIBS_ARTICLE_SETTINGS_LABEL="Options" diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index ced1567ab6e..9c78ab34ed4 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -108,6 +108,12 @@ COM_MENUS_ITEM_FIELD_TITLE_LABEL="Menu Title" COM_MENUS_ITEM_FIELD_TYPE_LABEL="Menu Item Type" COM_MENUS_ITEM_MODULE_ASSIGNMENT="Module Assignment" COM_MENUS_ITEM_ROOT="Menu Item Root" +COM_MENUS_ITEMS_N_QUICKICON="Menus Items" +COM_MENUS_ITEMS_N_QUICKICON_0="Menus Items" +COM_MENUS_ITEMS_N_QUICKICON_1="Menu Item" +COM_MENUS_ITEMS_N_QUICKICON_SRONLY="Menu Items: %s Menu Items are available." +COM_MENUS_ITEMS_N_QUICKICON_SRONLY_0="Menu Items: No Menu Items are available." +COM_MENUS_ITEMS_N_QUICKICON_SRONLY_1="Menu Items: One Menu item is available." COM_MENUS_ITEMS_REBUILD_FAILED="Failed rebuilding Menu Items list." COM_MENUS_ITEMS_REBUILD_SUCCESS="Menu items list rebuilt." COM_MENUS_ITEMS_SEARCH_FILTER="Search in title, alias and notes. Prefix with ID: to search for a menu item ID." diff --git a/administrator/language/en-GB/en-GB.com_modules.ini b/administrator/language/en-GB/en-GB.com_modules.ini index 627d59b9b74..9d5e2541345 100644 --- a/administrator/language/en-GB/en-GB.com_modules.ini +++ b/administrator/language/en-GB/en-GB.com_modules.ini @@ -163,6 +163,12 @@ COM_MODULES_POSITION_USER5="User 5" COM_MODULES_POSITION_USER6="User 6" COM_MODULES_POSITION_USER7="User 7" COM_MODULES_POSITION_USER8="User 8" +COM_MODULES_N_QUICKICON="Modules" +COM_MODULES_N_QUICKICON_0="Modules" +COM_MODULES_N_QUICKICON_1="Module" +COM_MODULES_N_QUICKICON_SRONLY="Modules: %s Modules are available" +COM_MODULES_N_QUICKICON_SRONLY_0="Modules: No Module is available" +COM_MODULES_N_QUICKICON_SRONLY_1="Modules: One Module is available" COM_MODULES_SAVE_SUCCESS="Module saved" COM_MODULES_TABLE_CAPTION="Table of Modules" COM_MODULES_TYPE_CHOOSE="Select a Module Type:" diff --git a/administrator/language/en-GB/en-GB.com_plugins.ini b/administrator/language/en-GB/en-GB.com_plugins.ini index a2c935e2191..0af2aafb5e0 100644 --- a/administrator/language/en-GB/en-GB.com_plugins.ini +++ b/administrator/language/en-GB/en-GB.com_plugins.ini @@ -29,6 +29,10 @@ COM_PLUGINS_NO_ITEM_SELECTED="No plugins selected." COM_PLUGINS_OPTION_ELEMENT="- Select Element -" COM_PLUGINS_OPTION_FOLDER="- Select Type -" COM_PLUGINS_PLUGIN="Plugin" +COM_PLUGINS_N_QUICKICON="Plugins" +COM_PLUGINS_N_QUICKICON_1="Plugin" +COM_PLUGINS_N_QUICKICON_SRONLY="Plugins: %s plugins are active" +COM_PLUGINS_N_QUICKICON_SRONLY_1="Plugins: One plugins is active" COM_PLUGINS_SAVE_SUCCESS="Plugin saved." COM_PLUGINS_SEARCH_IN_TITLE="Search in plugin name. Prefix with ID: to search for a plugin ID." COM_PLUGINS_TABLE_CAPTION="Table of Plugins" diff --git a/administrator/language/en-GB/en-GB.com_users.ini b/administrator/language/en-GB/en-GB.com_users.ini index 4ddba011f3b..25838b8bb23 100644 --- a/administrator/language/en-GB/en-GB.com_users.ini +++ b/administrator/language/en-GB/en-GB.com_users.ini @@ -243,6 +243,10 @@ COM_USERS_OPTION_SELECT_COMPONENT="- Select Component -" COM_USERS_OPTION_SELECT_LEVEL_END="- Select End Level -" COM_USERS_OPTION_SELECT_LEVEL_START="- Select Start Level -" COM_USERS_PASSWORD_RESET_REQUIRED="Password Reset Required" +COM_USERS_N_QUICKICON="Users" +COM_USERS_N_QUICKICON_1="User" +COM_USERS_N_QUICKICON_SRONLY="Users: %s users are avctive" +COM_USERS_N_QUICKICON_SRONLY_1="Users: One user is active" COM_USERS_REQUIRE_PASSWORD_RESET="Require Password Reset" COM_USERS_REVIEW_HEADING="Review Date" COM_USERS_SEARCH_ACCESS_LEVELS="Search Viewing Access Levels" diff --git a/administrator/language/en-GB/en-GB.mod_quickicon.ini b/administrator/language/en-GB/en-GB.mod_quickicon.ini index ef66e982b53..f03e680aa02 100644 --- a/administrator/language/en-GB/en-GB.mod_quickicon.ini +++ b/administrator/language/en-GB/en-GB.mod_quickicon.ini @@ -5,26 +5,22 @@ MOD_QUICKICON="Quick Icons" MOD_QUICKICON_ADD_NEW="New %s" -MOD_QUICKICON_AMOUNT_THSD="THSD" MOD_QUICKICON_ARTICLE_MANAGER="Articles" MOD_QUICKICON_ARTICLE_MANAGER_1="Article" -MOD_QUICKICON_CACHE="Cache (MB)" +MOD_QUICKICON_CACHE="Cache" MOD_QUICKICON_CATEGORY_ADD="New Category" MOD_QUICKICON_CATEGORY_MANAGER="Article Categories" MOD_QUICKICON_CATEGORY_MANAGER_1="Article Category" MOD_QUICKICON_CHECKIN="Checkin" MOD_QUICKICON_CHECKINS="Global Checkin" -MOD_QUICKICON_CHECKIN_ALL="Global Checkin" MOD_QUICKICON_CONFIGURATION="Configuration" MOD_QUICKICON_CONTENT="Content" -MOD_QUICKICON_EXTENSIONS="Extensions" -MOD_QUICKICON_EXTENSION_MANAGER="Extension Manager" MOD_QUICKICON_GLOBAL_CONFIGURATION="Global Configuration" MOD_QUICKICON_GROUP_DESC="The group of this module (this value is compared with the group value used in Quick Icons plugins to inject icons). The 'mod_quickicon' group always displays the Joomla! core icons." MOD_QUICKICON_GROUP_LABEL="Group" MOD_QUICKICON_HEADER_ICON_LABEL="Header Icon" MOD_QUICKICON_INSTALL_EXTENSIONS="Install Extensions" -MOD_QUICKICON_LANGUAGE_MANAGER="Languages" +MOD_QUICKICON_LOAD_PLUGINS_LABEL="Load 3rd party plugins" MOD_QUICKICON_MAINTENANCE="Maintenance" MOD_QUICKICON_MEDIA_MANAGER="Media" MOD_QUICKICON_MENUITEMS_ADD="New Menu Item" @@ -35,6 +31,7 @@ MOD_QUICKICON_MODULE_MANAGER="Modules" MOD_QUICKICON_MODULE_MANAGER_1="Module" MOD_QUICKICON_NAV_LABEL="Quick Links" MOD_QUICKICON_PLUGIN_MANAGER="Plugins" +MOD_QUICKICON_PLUGIN_MANAGER_1="Plugin" MOD_QUICKICON_SHOW_ARTICLES_LABEL="Articles Icon" MOD_QUICKICON_SHOW_CACHE_LABEL="Cache Icon" MOD_QUICKICON_SHOW_CATEGORIES_LABEL="Categories Icon" @@ -49,7 +46,6 @@ MOD_QUICKICON_SHOW_MODULES_LABEL="Modules Icon" MOD_QUICKICON_SHOW_OVERRIDEUPDATE_LABEL="Override Update Check" MOD_QUICKICON_SHOW_PLUGINS_LABEL="Plugins Icon" MOD_QUICKICON_SHOW_PRIVACYREQUEST_LABEL="Privacy Requests" -MOD_QUICKICON_LOAD_PLUGINS_LABEL="Load 3rd party plugins" MOD_QUICKICON_SHOW_TEMPLATES_LABEL="Templates Icon" MOD_QUICKICON_SHOW_USERS_LABEL="User Icon" MOD_QUICKICON_SITE="Icons Site" @@ -63,4 +59,7 @@ MOD_QUICKICON_UPDATE="Icons Update" MOD_QUICKICON_USERS="Users" MOD_QUICKICON_USER_MANAGER="Users" MOD_QUICKICON_USER_MANAGER_1="User" +MOD_QUICKICON_USER_SRONLY="Users: %s Users are activated." +MOD_QUICKICON_USER_SRONLY_1="Users: One User is activated." +MOD_QUICKICON_WITH_COUNT="Show Items with Count" MOD_QUICKICON_XML_DESCRIPTION="This module shows Quick Icons that are visible on the Dashboard (administrator area home page)." diff --git a/administrator/modules/mod_quickicon/Helper/QuickIconHelper.php b/administrator/modules/mod_quickicon/Helper/QuickIconHelper.php index 1a54ad362bf..04ee5ea3f52 100644 --- a/administrator/modules/mod_quickicon/Helper/QuickIconHelper.php +++ b/administrator/modules/mod_quickicon/Helper/QuickIconHelper.php @@ -65,21 +65,26 @@ public static function &getButtons(Registry $params, CMSApplication $application if ($params->get('show_users')) { - self::$buttons[$key][] = [ - 'ajaxurl' => 'index.php?option=com_users&task=users.getQuickiconContent&format=json', + $tmp = [ 'image' => 'fa fa-users', 'link' => Route::_('index.php?option=com_users'), - 'linkadd' => Route::_('index.php?option=com_users&task=user.add'), + 'linkadd' => Route::_('index.php?option=com_users&task=users.add'), 'name' => 'MOD_QUICKICON_USER_MANAGER', 'access' => array('core.manage', 'com_users', 'core.create', 'com_users'), 'group' => 'MOD_QUICKICON_SITE', ]; + + if ($params->get('show_users') == 2) + { + $tmp['ajaxurl'] = 'index.php?option=com_users&task=users.getQuickiconContent&format=json'; + } + + self::$buttons[$key][] = $tmp; } - if ($params->get('show_menuItems')) + if ($params->get('show_menuitems')) { - self::$buttons[$key][] = [ - 'ajaxurl' => 'index.php?option=com_menus&task=items.getQuickiconContent&format=json', + $tmp = [ 'image' => 'fa fa-list', 'link' => Route::_('index.php?option=com_menus'), 'linkadd' => Route::_('index.php?option=com_menus&task=item.add'), @@ -87,12 +92,18 @@ public static function &getButtons(Registry $params, CMSApplication $application 'access' => array('core.manage', 'com_menus', 'core.create', 'com_menus'), 'group' => 'MOD_QUICKICON_STRUCTURE', ]; + + if ($params->get('show_menuitems') == 2) + { + $tmp['ajaxurl'] = 'index.php?option=com_menus&task=items.getQuickiconContent&format=json'; + } + + self::$buttons[$key][] = $tmp; } if ($params->get('show_articles')) { - self::$buttons[$key][] = [ - 'ajaxurl' => 'index.php?option=com_content&task=articles.getQuickiconContent&format=json', + $tmp = [ 'image' => 'fa fa-file-alt', 'link' => Route::_('index.php?option=com_content'), 'linkadd' => Route::_('index.php?option=com_content&task=article.add'), @@ -100,12 +111,18 @@ public static function &getButtons(Registry $params, CMSApplication $application 'access' => array('core.manage', 'com_content', 'core.create', 'com_content'), 'group' => 'MOD_QUICKICON_SITE', ]; + + if ($params->get('show_articles') == 2) + { + $tmp['ajaxurl'] = 'index.php?option=com_content&task=articles.getQuickiconContent&format=json'; + } + + self::$buttons[$key][] = $tmp; } if ($params->get('show_categories')) { - self::$buttons[$key][] = [ - 'ajaxurl' => 'index.php?option=com_categories&task=categories.getQuickiconContent&format=json', + $tmp = [ 'image' => 'fa fa-folder-open', 'link' => Route::_('index.php?option=com_categories'), 'linkadd' => Route::_('index.php?option=com_categories&task=category.add'), @@ -113,6 +130,13 @@ public static function &getButtons(Registry $params, CMSApplication $application 'access' => array('core.manage', 'com_categories', 'core.create', 'com_categories'), 'group' => 'MOD_QUICKICON_SITE', ]; + + if ($params->get('show_categories') == 2) + { + $tmp['ajaxurl'] = 'index.php?option=com_categories&task=categories.getQuickiconContent&format=json'; + } + + self::$buttons[$key][] = $tmp; } if ($params->get('show_media')) @@ -128,8 +152,7 @@ public static function &getButtons(Registry $params, CMSApplication $application if ($params->get('show_modules')) { - self::$buttons[$key][] = [ - 'ajaxurl' => 'index.php?option=com_modules&task=modules.getQuickiconContent&format=json', + $tmp = [ 'image' => 'fa fa-cube', 'link' => Route::_('index.php?option=com_modules'), 'linkadd' => Route::_('index.php?option=com_modules&view=select'), @@ -137,18 +160,31 @@ public static function &getButtons(Registry $params, CMSApplication $application 'access' => array('core.manage', 'com_modules'), 'group' => 'MOD_QUICKICON_SITE' ]; + + if ($params->get('show_modules') == 2) + { + $tmp['ajaxurl'] = 'index.php?option=com_modules&task=modules.getQuickiconContent&format=json'; + } + + self::$buttons[$key][] = $tmp; } if ($params->get('show_plugins')) { - self::$buttons[$key][] = [ - 'ajaxurl' => 'index.php?option=com_plugins&task=plugins.getQuickiconContent&format=json', - 'image' => 'fa fa-plug', - 'link' => Route::_('index.php?option=com_plugins'), - 'name' => 'MOD_QUICKICON_PLUGIN_MANAGER', - 'access' => array('core.manage', 'com_plugins'), - 'group' => 'MOD_QUICKICON_SITE' + $tmp = [ + 'image' => 'fa fa-plug', + 'link' => Route::_('index.php?option=com_plugins'), + 'name' => 'MOD_QUICKICON_PLUGIN_MANAGER', + 'access' => array('core.manage', 'com_plugins'), + 'group' => 'MOD_QUICKICON_SITE' ]; + + if ($params->get('show_plugins') == 2) + { + $tmp['ajaxurl'] = 'index.php?option=com_plugins&task=plugins.getQuickiconContent&format=json'; + } + + self::$buttons[$key][] = $tmp; } if ($params->get('show_templates')) @@ -165,7 +201,7 @@ public static function &getButtons(Registry $params, CMSApplication $application if ($params->get('show_checkin')) { self::$buttons[$key][] = [ - 'ajaxurl' => 'index.php?option=com_checkin&task=getMenuBadgeData&format=json', + 'ajaxurl' => 'index.php?option=com_checkin&task=getQuickiconContent&format=json', 'image' => 'fa fa-unlock-alt', 'link' => Route::_('index.php?option=com_checkin'), 'name' => 'MOD_QUICKICON_CHECKINS', diff --git a/administrator/modules/mod_quickicon/mod_quickicon.xml b/administrator/modules/mod_quickicon/mod_quickicon.xml index 0ddf7d5b853..91095120e60 100644 --- a/administrator/modules/mod_quickicon/mod_quickicon.xml +++ b/administrator/modules/mod_quickicon/mod_quickicon.xml @@ -69,48 +69,48 @@ + + + + @@ -118,24 +118,24 @@ + + + + JGLOBAL_USE_GLOBAL + { @@ -36,18 +37,20 @@ } // Set name in singular or plural - if (name && name.dataset.nameSingular && name.dataset.namePlural) { - if (response.data <= 1) { - nameSpan.textContent = name.dataset.nameSingular; - } else { - nameSpan.textContent = name.dataset.namePlural; - } - + if (response.data.name && name) { + nameSpan.textContent = response.data.name; name.replaceChild(nameSpan, name.firstChild); } // Set amount of number into counter span - counter.textContent = response.data; + counter.textContent = `\u200E${response.data.amount}`; + + // Insert screenreader text + const sronly = quickicon.querySelector('.quickicon-sr-desc'); + + if (response.data.sronly && sronly) { + sronly.textContent = response.data.sronly; + } } else if (pulse) { pulse.classList.add('error'); } diff --git a/layouts/joomla/quickicons/icon.php b/layouts/joomla/quickicons/icon.php index 02444256b2e..3658850527d 100644 --- a/layouts/joomla/quickicons/icon.php +++ b/layouts/joomla/quickicons/icon.php @@ -42,7 +42,7 @@ } // Add the button class -if (!empty($displayData['class']) && is_string($displayData['class'])) +if (!empty($displayData['class'])) { $tmp[] = $this->escape($displayData['class']); } @@ -66,19 +66,18 @@ href="">
- +
-