Skip to content

Commit

Permalink
Add lan constants and implement them for some 'preference value labels'
Browse files Browse the repository at this point in the history
Update description term in global LAN file.
Bump up plugin version for the current changeset.
  • Loading branch information
arunshekher committed Apr 5, 2018
1 parent 1d69cbc commit 9cd8cdc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
36 changes: 16 additions & 20 deletions admin_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,23 @@ class mentions_ui extends e_admin_ui
];

protected $maxNotificationEmails = [
5 => '5',
10 => '10',
15 => '15',
20 => '20',
25 => '25',
5 => LAN_MENTIONS_PREF_VAL_MAX_EMAIL_5,
10 => LAN_MENTIONS_PREF_VAL_MAX_EMAIL_10,
15 => LAN_MENTIONS_PREF_VAL_MAX_EMAIL_15,
20 => LAN_MENTIONS_PREF_VAL_MAX_EMAIL_20,
25 => LAN_MENTIONS_PREF_VAL_MAX_EMAIL_25,
];

protected $avatarSizesList = [
16 => '16',
24 => '24',
32 => '32'
16 => LAN_MENTIONS_PREF_VAL_AVATAR_SIZE_16,
24 => LAN_MENTIONS_PREF_VAL_AVATAR_SIZE_24,
32 => LAN_MENTIONS_PREF_VAL_AVATAR_SIZE_32
];
/**
* @todo language constants for these
*/

protected $avatarBorderList = [
'circle' => 'Circle',
'rounded' => 'Rounded',
'none' => 'Square'
'circle' => LAN_MENTIONS_PREF_VAL_AVATAR_BORDER_CIRCLE,
'rounded' => LAN_MENTIONS_PREF_VAL_AVATAR_BORDER_ROUNDED,
'none' => LAN_MENTIONS_PREF_VAL_AVATAR_BORDER_SQUARE
];

protected $preftabs = [
Expand Down Expand Up @@ -191,21 +189,19 @@ class mentions_ui extends e_admin_ui
'data' => 'int',
'help' => LAN_MENTIONS_PREF_LBL_HINT_MAX_EMAILS_1,
],
// todo: replace with language constants
'avatar_size' => [
'title' => 'Avatar Size',
'title' => LAN_MENTIONS_PREF_LBL_AVATAR_SIZE,
'tab' => 1,
'type' => 'dropdown',
'data' => 'int',
'help' => 'Set avatar size',
'help' => LAN_MENTIONS_PREF_LBL_HINT_AVATAR_SIZE,
],
// todo: replace with language constants
'avatar_border' => [
'title' => 'Avatar Border Style',
'title' => LAN_MENTIONS_PREF_LBL_AVATAR_BORDER,
'tab' => 1,
'type' => 'dropdown',
'data' => 'str',
'help' => 'Set avatar border style',
'help' => LAN_MENTIONS_PREF_LBL_HINT_AVATAR_BORDER,
]

];
Expand Down
17 changes: 16 additions & 1 deletion languages/English/English_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
define('LAN_MENTIONS_PREF_LBL_FORUM_EMAIL', 'Forum mentions email notification:');
define('LAN_MENTIONS_PREF_LBL_FORUMREPLY_EMAIL', 'Forum reply mentions email notification:');
define('LAN_MENTIONS_PREF_LBL_EMAIL_SUBJECT', 'Email subject-line text:');
define('LAN_MENTIONS_PREF_LBL_MAX_EMAILS', 'Max. number of mention emails allowed per post.');
define('LAN_MENTIONS_PREF_LBL_MAX_EMAILS', 'Max. number of mention emails allowed per post.');
define('LAN_MENTIONS_PREF_LBL_AVATAR_SIZE', 'Choose avatar size:');
define('LAN_MENTIONS_PREF_LBL_AVATAR_BORDER', 'Choose avatar border style:');

define('LAN_MENTIONS_PREF_LBL_HINT_ACTIVATION', 'Turn On/Off Mentions Globally');
define('LAN_MENTIONS_PREF_LBL_HINT_CONTEXT', 'All content contexts that require parsing of \'mentions\'.');
Expand All @@ -43,11 +45,24 @@
define('LAN_MENTIONS_PREF_LBL_HINT_EMAIL_SUBJECT_2', ' in subject-line text, and it will be substituted with actual mentioner\'s username in the email subject field.');
define('LAN_MENTIONS_PREF_LBL_HINT_MAX_EMAILS_1', 'Maximum allowed number of notification emails that would be sent-out per comment/chatbox-post/forum-post.');
define('LAN_MENTIONS_PREF_LBL_HINT_MAX_EMAILS_2', 'Any more number of mentioned users than this limit (in one post) will not get email notification about their mentions.');
define('LAN_MENTIONS_PREF_LBL_HINT_AVATAR_SIZE', 'Choose the avatar size');
define('LAN_MENTIONS_PREF_LBL_HINT_AVATAR_BORDER', 'Choose avatar border style');


define('LAN_MENTIONS_PREF_VAL_CONTEXT_01', 'Forum + Chatbox');
define('LAN_MENTIONS_PREF_VAL_CONTEXT_02', 'Forum + Chatbox + Comments');
define('LAN_MENTIONS_PREF_VAL_CONTEXT_03', 'Forum + Chatbox + Comments + News');
define('LAN_MENTIONS_PREF_VAL_AVATAR_SIZE_16', '16x16px');
define('LAN_MENTIONS_PREF_VAL_AVATAR_SIZE_24', '24x24px');
define('LAN_MENTIONS_PREF_VAL_AVATAR_SIZE_32', '32x32px');
define('LAN_MENTIONS_PREF_VAL_AVATAR_BORDER_CIRCLE', 'Circle');
define('LAN_MENTIONS_PREF_VAL_AVATAR_BORDER_ROUNDED', 'Rounded');
define('LAN_MENTIONS_PREF_VAL_AVATAR_BORDER_SQUARE', 'Square');
define('LAN_MENTIONS_PREF_VAL_MAX_EMAIL_5', '5');
define('LAN_MENTIONS_PREF_VAL_MAX_EMAIL_10', '10');
define('LAN_MENTIONS_PREF_VAL_MAX_EMAIL_15', '15');
define('LAN_MENTIONS_PREF_VAL_MAX_EMAIL_20', '20');
define('LAN_MENTIONS_PREF_VAL_MAX_EMAIL_25', '25');

// Project Info Menu
define('LAN_MENTIONS_INFO_MENU_TITLE', 'Project Info');
Expand Down
3 changes: 2 additions & 1 deletion languages/English/English_global.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
define('LAN_MENTIONS_PLUGIN_NAME', 'Mentions');
define('LAN_MENTIONS_PLUGIN_DESCRIPTION', 'It provides Twitter or GitHub like \'@username\' mention functionality for e107.');
define('LAN_MENTIONS_PLUGIN_SUMMARY', 'A user @mention plugin');
define('LAN_MENTIONS_PLUGIN_DESCRIPTION', 'It brings Twitter or GitHub like \'@username\' mentioning functionality for e107.');
define('LAN_MENTIONS_PLUGIN_CONFIGURE', 'Configure Mentions Plugin');

define('LAN_MENTIONS_TAG_CHATBOX', 'chatbox');
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<e107Plugin name="Mentions" lan="LAN_MENTIONS_PLUGIN_NAME" version="1.6.2" date="2018-04-04" compatibility="2.0" installRequired="true" >
<e107Plugin name="Mentions" lan="LAN_MENTIONS_PLUGIN_NAME" version="1.6.3" date="2018-04-04" compatibility="2.0" installRequired="true" >
<author name="Arun S. Sekher" url="https://github.com/arunshekher" />
<summary>An @mention plugin</summary>
<summary lan="LAN_MENTIONS_PLUGIN_SUMMARY">A user @mention plugin</summary>
<description lan="LAN_MENTIONS_PLUGIN_DESCRIPTION">It provides Twitter or GitHub like '@username' mention functionality for e107.</description>
<copyright>Copyright Arun S. Sekher, Licensed under AGPL (https://www.gnu.org/licenses/agpl-3.0)</copyright>
<category>users</category>
Expand Down

0 comments on commit 9cd8cdc

Please sign in to comment.