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

Quickicon improvements #362

Merged
merged 27 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4fccafa
Improvements for quickicons - params for icon count, sr-only text
chmst Jul 8, 2019
d1ab7a9
Set correct amount of data into quickicon sr-only description
fancyFranci Jul 8, 2019
2f99ec0
accidetally comitted
chmst Jul 8, 2019
49c61f7
Update administrator/language/en-GB/en-GB.mod_quickicon.ini
bembelimen Jul 8, 2019
0614bb8
Update administrator/language/en-GB/en-GB.mod_quickicon.ini
bembelimen Jul 8, 2019
81e3f51
Update administrator/language/en-GB/en-GB.mod_quickicon.ini
chmst Jul 8, 2019
2712621
name - type - label
chmst Jul 8, 2019
3f2c913
Update layouts/joomla/quickicons/icon.php
chmst Jul 9, 2019
f699075
Update layouts/joomla/quickicons/icon.php
chmst Jul 9, 2019
af6c875
Update layouts/joomla/quickicons/icon.php
chmst Jul 9, 2019
ae17b23
Update administrator/modules/mod_quickicon/Helper/QuickIconHelper.php
chmst Jul 9, 2019
282b963
Update administrator/components/com_cache/Controller/DisplayControlle…
chmst Jul 9, 2019
68a1954
align =>, remove unused language string
chmst Jul 10, 2019
4f9d27a
Correct use of language plural for quickicons
chmst Jul 13, 2019
c0756b0
Correct use of _N_, unify usage of :, alphaordering quickicon text st…
chmst Jul 13, 2019
a94e953
Merge branch 'release' into quickicon-improvements
Hackwar Jul 13, 2019
fffcfd1
Fixing codestyle
Hackwar Jul 13, 2019
9ea77b7
Fixing codestyle
Hackwar Jul 13, 2019
8cd79b8
Codestyle
Hackwar Jul 14, 2019
2bb2a56
Codestyle
Hackwar Jul 14, 2019
0f9f192
RTL for cache
chmst Jul 14, 2019
bd5ecc0
Better sr-only texts for cache.
chmst Jul 14, 2019
1fd8829
Change string
chmst Jul 14, 2019
fec4b4a
Merge branch 'release' into quickicon-improvements
chmst Jul 14, 2019
643bf10
Scss rtl-fixes for quickicons
chmst Jul 14, 2019
319cab4
Using template instead of concatenation
Hackwar Jul 14, 2019
cc56555
Fixing JS template
Hackwar Jul 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,7 +53,20 @@ 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);

$mb = strstr($bytes, '.', true);

// No dot found, so just take the converted size
if (!$mb)
{
$mb = $bytes;
}

$result = [];

$result['amount'] = $mb;
$result['sronly'] = Text::sprintf('COM_CACHE_N_QUICKICON_SRONLY', $mb);
chmst marked this conversation as resolved.
Show resolved Hide resolved

// 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 void
*
* @since 4.0
*/
Expand All @@ -52,10 +52,16 @@ public function getQuickiconContent()
$model = $this->getModel('Categories');
$model->setState('filter.published', 1);
$model->setState('filter.extension', 'com_content');

$amount = (int) $model->getTotal();

$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($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 @@ -138,8 +138,6 @@ 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
*
* @since 4.0
*/
Expand All @@ -151,6 +149,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 @@ -63,7 +63,7 @@ public function getModel($name = 'Item', $prefix = 'Administrator', $config = ar

/**
* Method to get the number of published frontend menu items for quickicons
*
*
* @return integer The amount of items
*
* @since 4.0
Expand All @@ -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 @@ -75,8 +75,6 @@ public function getModel($name = 'Module', $prefix = 'Administrator', $config =

/**
* Method to get the number of frontend modules
*
* @return integer The amount of modules
*
* @since 4.0
*/
Expand All @@ -87,8 +85,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 @@ -39,8 +40,6 @@ public function getModel($name = 'Plugin', $prefix = 'Administrator', $config =

/**
* Method to get the number of activated plugins
*
* @return integer The amount of items
*
* @since 4.0
*/
Expand All @@ -52,6 +51,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 @@ -155,8 +155,6 @@ public function activate()

/**
* Method to get the number of active users
*
* @return integer The amount of users
*
* @since 4.0
*/
Expand All @@ -168,6 +166,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);
}
}
1 change: 1 addition & 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,7 @@ 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_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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugins? do you mean extensions? Is this even used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have icons for languages and extensions. So better delete the language keys

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"
chmst marked this conversation as resolved.
Show resolved Hide resolved
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