Skip to content
Permalink
Browse files

Add option to disable Re on subject

  • Loading branch information...
810 committed Aug 8, 2019
1 parent e23e0e4 commit 33f71bd76965ba954eb3c99c923d19e4cd761221
@@ -614,6 +614,8 @@ COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL = "Set if you want allow the user to
COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL_DESC = "Set if you want allow user to edit the poll after someone has voted"
COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL_ALLOW = "Allow to edit"
COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL_DISALLOW = "Not allow to edit"
COM_KUNENA_DISABLE_RE="Disable Re: on subject"
COM_KUNENA_DISABLE_RE_DESC="When you enable the option, the Re: will be hidden on the subject."

; JROOT/administrator/components/com_kunena/views/config/tmpl/modal.php

@@ -27,8 +27,8 @@ class KunenaAdminModelConfig extends KunenaModel
{
/**
* @return array
* @throws Exception
* @since Kunena
* @throws Exception
*/
public function getConfiglists()
{
@@ -516,17 +516,19 @@ public function getConfiglists()
$avatar_type[] = HTMLHelper::_('select.option', '1', Text::_('COM_KUNENA_AVATAR_ICONTYPE'));
$lists ['avatar_type'] = HTMLHelper::_('select.genericlist', $avatar_type, 'cfg_avatar_type', 'class="inputbox" size="1"', 'value', 'text', $this->config->avatar_type);
$lists ['sef_redirect'] = HTMLHelper::_('select.genericlist', $yesno, 'cfg_sef_redirect', 'class="inputbox" size="1"', 'value', 'text', $this->config->sef_redirect);
$lists ['sef_redirect'] = HTMLHelper::_('select.genericlist', $yesno, 'cfg_sef_redirect', 'class="inputbox" size="1"', 'value', 'text', $this->config->sef_redirect);
$user_edit_poll = array();
$user_edit_poll[] = HTMLHelper::_('select.option', '1', Text::_('COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL_ALLOW'));
$user_edit_poll[] = HTMLHelper::_('select.option', '0', Text::_('COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL_DISALLOW'));
$user_edit_poll = array();
$user_edit_poll[] = HTMLHelper::_('select.option', '1', Text::_('COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL_ALLOW'));
$user_edit_poll[] = HTMLHelper::_('select.option', '0', Text::_('COM_KUNENA_CONFIG_POLL_ALLOW_USER_EDIT_POLL_DISALLOW'));
$lists ['allow_user_edit_poll'] = HTMLHelper::_('select.genericlist', $user_edit_poll, 'cfg_allow_edit_poll', 'class="inputbox" size="1"', 'value', 'text', $this->config->allow_edit_poll);
$lists ['allow_user_edit_poll'] = HTMLHelper::_('select.genericlist', $user_edit_poll, 'cfg_allow_edit_poll', 'class="inputbox" size="1"', 'value', 'text', $this->config->allow_edit_poll);
// K 5.1.2
$lists ['use_system_emails'] = HTMLHelper::_('select.genericlist', $yesno, 'cfg_use_system_emails', 'class="inputbox" size="1"', 'value', 'text', $this->config->use_system_emails);
$lists ['autoembedinstagram'] = HTMLHelper::_('select.genericlist', $yesno, 'cfg_autoembedinstagram', 'class="inputbox" size="1"', 'value', 'text', $this->config->autoembedinstagram);
$lists ['use_system_emails'] = HTMLHelper::_('select.genericlist', $yesno, 'cfg_use_system_emails', 'class="inputbox" size="1"', 'value', 'text', $this->config->use_system_emails);
$lists ['autoembedinstagram'] = HTMLHelper::_('select.genericlist', $yesno, 'cfg_autoembedinstagram', 'class="inputbox" size="1"', 'value', 'text', $this->config->autoembedinstagram);
$lists ['disable_re'] = HTMLHelper::_('select.genericlist', $yesno, 'cfg_disable_re', 'class="inputbox" size="1"', 'value', 'text', $this->config->disable_re);
return $lists;
}
@@ -436,6 +436,11 @@
<td><?php echo $this->lists ['quickreply'] ?></td>
<td><?php echo Text::_('COM_KUNENA_A_QUICK_REPLY_DESC') ?></td>
</tr>
<tr <?php if ($this->config->disable_re != 0) : echo 'class="changed"'; endif; ?>>
<td><?php echo Text::_('COM_KUNENA_DISABLE_RE') ?></td>
<td><?php echo $this->lists ['disable_re'] ?></td>
<td><?php echo Text::_('COM_KUNENA_DISABLE_RE_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
@@ -432,6 +432,11 @@
<td><?php echo $this->lists ['quickreply'] ?></td>
<td><?php echo Text::_('COM_KUNENA_A_QUICK_REPLY_DESC') ?></td>
</tr>
<tr <?php if ($this->config->disable_re != 0) : echo 'class="changed"'; endif; ?>>
<td><?php echo Text::_('COM_KUNENA_DISABLE_RE') ?></td>
<td><?php echo $this->lists ['disable_re'] ?></td>
<td><?php echo Text::_('COM_KUNENA_DISABLE_RE_DESC') ?></td>
</tr>
</tbody>
</table>
</fieldset>
@@ -229,7 +229,15 @@ public function getLastPostLink($category, $content = null, $title = null, $clas
if (!$content)
{
$content = KunenaHtmlParser::parseText($category->getLastTopic()->subject, $length);
if (KunenaConfig::getInstance()->disable_re)
{
$content = KunenaHtmlParser::parseText($category->getLastTopic()->subject, $length);
}
else
{
$content = $lastTopic->first_post_id != $lastTopic->last_post_id ? Text::_('COM_KUNENA_RE') . ' ' : '';
$content .= KunenaHtmlParser::parseText($category->getLastTopic()->subject, $length);
}
}
if ($title === null)
@@ -1345,6 +1345,12 @@ class KunenaConfig extends CMSObject
*/
public $autoembedinstagram = 1;
/**
* @var integer
* @since K5.1.14
*/
public $disable_re = 0;
/**
* @since Kunena
*/
@@ -354,8 +354,15 @@ public function getLastPostLink($category, $content = null, $title = null, $clas
if (!$content)
{
$content = $lastTopic->first_post_id != $lastTopic->last_post_id ? Text::_('COM_KUNENA_RE') . ' ' : '';
$content .= KunenaHtmlParser::parseText($lastTopic->subject, $length);
if (KunenaConfig::getInstance()->disable_re)
{
$content = KunenaHtmlParser::parseText($lastTopic->subject, $length);
}
else
{
$content = $lastTopic->first_post_id != $lastTopic->last_post_id ? Text::_('COM_KUNENA_RE') . ' ' : '';
$content .= KunenaHtmlParser::parseText($lastTopic->subject, $length);
}
}
if ($title === null)

0 comments on commit 33f71bd

Please sign in to comment.
You can’t perform that action at this time.