Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #362 from joomla/quickicon-improvements
Browse files Browse the repository at this point in the history
Quickicon improvements
  • Loading branch information
bembelimen authored Jul 15, 2019
2 parents 82cec65 + cc56555 commit 0c52cdf
Show file tree
Hide file tree
Showing 22 changed files with 228 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class DisplayController extends BaseController

/**
* Method to get The Cache Size
*
* @return integer The cache size in kB
*
* @since 4.0
*/
Expand All @@ -44,7 +42,7 @@ public function getQuickiconContent()

$data = $model->getData();

$size = '0.0';
$size = 0;

if (!empty($data))
{
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\Response\JsonResponse;

Expand Down Expand Up @@ -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
*/
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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);
}
}
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_cache.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 -"
Expand Down
6 changes: 6 additions & 0 deletions administrator/language/en-GB/en-GB.com_categories.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
3 changes: 3 additions & 0 deletions administrator/language/en-GB/en-GB.com_checkin.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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="<em>%s</em> table"
COM_CHECKIN_TABLE_CAPTION="Table of Checked Out Items"
COM_CHECKIN_XML_DESCRIPTION="Check-in Component."
Expand Down
6 changes: 6 additions & 0 deletions administrator/language/en-GB/en-GB.com_content.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions administrator/language/en-GB/en-GB.com_menus.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
6 changes: 6 additions & 0 deletions administrator/language/en-GB/en-GB.com_modules.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
4 changes: 4 additions & 0 deletions administrator/language/en-GB/en-GB.com_plugins.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions administrator/language/en-GB/en-GB.com_users.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 6 additions & 7 deletions administrator/language/en-GB/en-GB.mod_quickicon.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 <strong>Quick Icons</strong> 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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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)."
Loading

0 comments on commit 0c52cdf

Please sign in to comment.