Skip to content

Commit

Permalink
Ticket #4582 - Notifications: Add setting for ContentMaxLen.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Jan 12, 2024
1 parent 81b1c2d commit 5f56197
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
9 changes: 6 additions & 3 deletions modules/boonex/notifications/classes/BxNtfsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public function __construct($aModule)
'option' => 'bx_notifications_'
);

$this->_iOwnerNameMaxLen = 21;
$this->_iContentMaxLen = 32;
$this->_iPushMaxLen = 190;
$this->_iOwnerNameMaxLen = 0;
$this->_iContentMaxLen = 0;
$this->_iEmailSubjectMaxLen = 0;
$this->_iPushMaxLen = 0;

$this->_aHandlerDescriptor = array('module_name' => '', 'module_method' => '', 'module_class' => '');
$this->_sHandlersMethod = 'get_notifications_data';
Expand Down Expand Up @@ -143,7 +143,10 @@ public function init(&$oDb)

$this->_bClickedIndicator = getParam($sOptionPrefix . 'enable_clicked_indicator') == 'on';

$this->_iOwnerNameMaxLen = (int)getParam($sOptionPrefix . 'owner_name_chars');
$this->_iContentMaxLen = (int)getParam($sOptionPrefix . 'content_chars');
$this->_iEmailSubjectMaxLen = (int)getParam($sOptionPrefix . 'email_subject_chars');
$this->_iPushMaxLen = (int)getParam($sOptionPrefix . 'push_message_chars');
}

public function getOwnerNameMaxLen()
Expand Down
6 changes: 3 additions & 3 deletions modules/boonex/notifications/install/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
'name' => 'bx_notifications',
'title' => 'Notifications',
'note' => 'Notifications module.',
'version' => '13.0.15.DEV',
'vendor' => 'BoonEx',
'version' => '14.0.0.DEV',
'vendor' => 'UNA INC',
'help_url' => 'http://feed.una.io/?section={module_name}',

'compatible_with' => array(
'13.0.x'
'14.0.x'
),

/**
Expand Down
3 changes: 3 additions & 0 deletions modules/boonex/notifications/install/langs/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<string name="_bx_ntfs_option_processed_event"><![CDATA[The last processed event upon notifications sending]]></string>
<string name="_bx_ntfs_option_clear_interval"><![CDATA[Notification lifetime, in days (0 - no limit)]]></string>
<string name="_bx_ntfs_option_enable_comment_post_ext"><![CDATA[Notify a user about new comments for a content he's previously commented]]></string>
<string name="_bx_ntfs_option_owner_name_chars"><![CDATA[Number of characters in auto-cropped author name in notification text]]></string>
<string name="_bx_ntfs_option_content_chars"><![CDATA[Number of characters in auto-cropped content title in notification text]]></string>
<string name="_bx_ntfs_option_email_subject_chars"><![CDATA[Number of characters in auto-cropped email notification subject (0 - no limit)]]></string>
<string name="_bx_ntfs_option_push_message_chars"><![CDATA[Number of characters in auto-cropped push notification message]]></string>

<string name="_bx_ntfs_privacy_view"><![CDATA[View event]]></string>

Expand Down
5 changes: 4 additions & 1 deletion modules/boonex/notifications/install/sql/enable.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
('bx_notifications_delivery_timeout', '120', @iCategId, '_bx_ntfs_option_delivery_timeout', 'digit', '', '', '', '', 20),
('bx_notifications_clear_interval', '90', @iCategId, '_bx_ntfs_option_clear_interval', 'digit', '', '', '', '', 30),
('bx_notifications_enable_comment_post_ext', '', @iCategId, '_bx_ntfs_option_enable_comment_post_ext', 'checkbox', '', '', '', '', 40),
('bx_notifications_email_subject_chars', '30', @iCategId, '_bx_ntfs_option_email_subject_chars', 'digit', '', '', '', '', 50);
('bx_notifications_owner_name_chars', '21', @iCategId, '_bx_ntfs_option_owner_name_chars', 'digit', '', '', '', '', 50),
('bx_notifications_content_chars', '32', @iCategId, '_bx_ntfs_option_content_chars', 'digit', '', '', '', '', 51),
('bx_notifications_email_subject_chars', '30', @iCategId, '_bx_ntfs_option_email_subject_chars', 'digit', '', '', '', '', 52),
('bx_notifications_push_message_chars', '190', @iCategId, '_bx_ntfs_option_push_message_chars', 'digit', '', '', '', '', 53);


-- PRIVACY
Expand Down
5 changes: 4 additions & 1 deletion modules/boonex/russian/data/langs/bx_notifications/ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<string name="_bx_ntfs_option_clear_interval"><![CDATA[Срок жизни уведомления, в днях (0 - без ограничений)]]></string>
<string name="_bx_ntfs_option_processed_event"><![CDATA[Последнее событие, обработанное в процессе отправки оповещений]]></string>
<string name="_bx_ntfs_option_enable_comment_post_ext"><![CDATA[Оповещать пользователя о новых комментариях к контенту, котороый он комментировал ранее]]></string>
<string name="_bx_ntfs_option_email_subject_chars"><![CDATA[Количество символов в автогенерируемой теме Email сообщения (0 - без ограничений)]]></string>
<string name="_bx_ntfs_option_owner_name_chars"><![CDATA[Количество символов в автоматически обрезаемом имени автора в тексте уведомления]]></string>
<string name="_bx_ntfs_option_content_chars"><![CDATA[Количество символов в автоматически обрезаемом заголовке контента в тексте уведомления]]></string>
<string name="_bx_ntfs_option_email_subject_chars"><![CDATA[Количество символов в автоматически обрезаемой теме Email сообщения (0 - без ограничений)]]></string>
<string name="_bx_ntfs_option_push_message_chars"><![CDATA[Количество символов в автоматически обрезаемом сообщении push-уведомления]]></string>

<string name="_bx_ntfs_privacy_view"><![CDATA[Просматривать события]]></string>

Expand Down

0 comments on commit 5f56197

Please sign in to comment.