choongii
2013-01-30 d097c76b311ee5a03ffc9c522b978f21999308d9
Implemented checkboxes in Interface Config to enable showing/hiding the tabs Mail Filters, Autoresponders and Custom Rules for mailboxes.

See also http://www.howtoforge.com/forums/showthread.php?t=59539

5 files modified
53 ■■■■■ changed files
interface/web/admin/form/system_config.tform.php 18 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_system_config.lng 3 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/nl_system_config.lng 3 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/system_config_mail_edit.htm 18 ●●●●● patch | view | raw | blame | history
interface/web/mail/form/mail_user.tform.php 11 ●●●● patch | view | raw | blame | history
interface/web/admin/form/system_config.tform.php
@@ -180,6 +180,24 @@
      'default' => 'n',
      'value' => array(0 => 'n', 1 => 'y')
    ),
        'mailbox_show_autoresponder_tab' => array (
            'datatype' => 'VARCHAR',
            'formtype' => 'CHECKBOX',
            'default'  => 'y',
            'value'    => array(0 => 'n',1 => 'y')
        ),
        'mailbox_show_mail_filter_tab' => array (
            'datatype' => 'VARCHAR',
            'formtype' => 'CHECKBOX',
            'default'  => 'y',
            'value'    => array(0 => 'n',1 => 'y')
        ),
        'mailbox_show_custom_rules_tab' => array (
            'datatype' => 'VARCHAR',
            'formtype' => 'CHECKBOX',
            'default'  => 'y',
            'value'    => array(0 => 'n',1 => 'y')
        ),
        'mailboxlist_webmail_link' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
interface/web/admin/lib/lang/en_system_config.lng
@@ -23,6 +23,9 @@
$wb["dblist_phpmyadmin_link_txt"] = 'Link to phpmyadmin in DB list';
$wb['enable_custom_login_txt'] = 'Allow custom login name';
$wb["mailboxlist_webmail_link_txt"] = 'Link to webmail in Mailbox list';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show Autoresponder tab in Mailbox detail';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show Mail Filter tab in Mailbox detail';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show Custom Rules tab in Mailbox detail';
$wb["webmail_url_txt"] = 'Webmail URL';
$wb["mailmailinglist_link_txt"] = 'Link to mailing list in Mailing list list';
$wb["mailmailinglist_url_txt"] = 'Mailing list URL';
interface/web/admin/lib/lang/nl_system_config.lng
@@ -16,6 +16,9 @@
$wb['webdavuser_prefix_error_regex'] = 'Char niet toegestaan in webdav gebruiker voorvoegsel.';
$wb['dblist_phpmyadmin_link_txt'] = 'Link naar phpmyadmin in DB lijst';
$wb['mailboxlist_webmail_link_txt'] = 'Link naar webmail in Mailbox lijst';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Toon Autoresponder tabblad in Mailbox detail';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Toon Mail Filter tabblad in Mailbox detail';
$wb['mailbox_show_custom_rules_tab_txt'] 'Toon Custom Rules tabblad in Mailbox detail';
$wb['webmail_url_txt'] = 'Webmail URL';
$wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL';
$wb['use_domain_module_txt'] = 'Gebruik de domein-module om nieuwe domeinen toe te voegen';
interface/web/admin/templates/system_config_mail_edit.htm
@@ -12,6 +12,24 @@
                </div>
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='mailbox_show_autoresponder_tab_txt'}</p>
                <div class="multiField">
                    {tmpl_var name='mailbox_show_autoresponder_tab'}
                </div>
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='mailbox_show_mail_filter_tab_txt'}</p>
                <div class="multiField">
                    {tmpl_var name='mailbox_show_mail_filter_tab'}
                </div>
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='mailbox_show_custom_rules_tab_txt'}</p>
                <div class="multiField">
                    {tmpl_var name='mailbox_show_custom_rules_tab'}
                </div>
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='mailboxlist_webmail_link_txt'}</p>
                <div class="multiField">
                    {tmpl_var name='mailboxlist_webmail_link'}
interface/web/mail/form/mail_user.tform.php
@@ -38,6 +38,8 @@
*/
global $app;
$app->uses('getconf');
$global_config = $app->getconf->get_global_config();
$form["title"]             = "Mailbox";
$form["description"]     = "";
@@ -230,6 +232,7 @@
    )
);
if ($global_config['mail']['mailbox_show_autoresponder_tab'] === 'y') {
$form["tabs"]['autoresponder'] = array (
    'title'     => "Autoresponder",
    'width'     => 100,
@@ -283,7 +286,10 @@
    ##################################
    )
);
}
if ($global_config['mail']['mailbox_show_mail_filter_tab'] === 'y') {
$form["tabs"]['filter_records'] = array (
    'title'     => "Mail Filter",
    'width'     => 100,
@@ -313,9 +319,10 @@
        )
    )
);
}
if($_SESSION["s"]["user"]["typ"] == 'admin') {
if ($_SESSION["s"]["user"]["typ"] == 'admin' && $global_config['mail']['mailbox_show_custom_rules_tab'] === 'y') {
$form["tabs"]['mailfilter'] = array (
    'title'     => "Custom Rules",
    'width'     => 100,
@@ -337,8 +344,6 @@
    ##################################
    )
);
}
?>