コード例 #1
0
function smtp_tls_policy_maps_table()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $sock = new sockets();
    $q = new mysql();
    if (!$q->TABLE_EXISTS("smtp_tls_policy_maps", "artica_backup")) {
        $q = new mysql_builder();
        if (!$q->CheckTablePostfixTls()) {
            echo FATAL_ERROR_SHOW_128($q->mysql_error_html());
            return;
        }
    }
    $t = time();
    $hostname = $_GET["hostname"];
    $hostname_enc = urlencode($hostname);
    $title = $tpl->javascript_parse_text("{tls_table_explain}");
    $about = $tpl->javascript_parse_text("{about2}");
    $about_text = $tpl->javascript_parse_text("{tls_table_explain}");
    $add_tls_smtp_server = $tpl->javascript_parse_text("{add_tls_smtp_server}");
    $servername = $tpl->javascript_parse_text("{servername2}");
    $option = $tpl->javascript_parse_text("{option}");
    $delete = $tpl->javascript_parse_text("{delete}");
    $add = "{name: '{$add_tls_smtp_server}', bclass: 'add', onpress : add_tls_smtp_server{$t}},";
    $aboutButton = "{name: '{$about}', bclass: 'Help', onpress : About{$t}},";
    $buttons = "\n\t\tbuttons : [\n\t\t{$add}\n\t\t{$aboutButton}\n\t\t],";
    $explain = $tpl->javascript_parse_text("{postfix_transport_table_explain}");
    $html = "\n<table class='POSTFIX_TLS_TABLE' style='display: none' id='POSTFIX_TLS_TABLE' style='width:100%'></table>\n<script>\n\$(document).ready(function(){\n\t\t\$('#POSTFIX_TLS_TABLE').flexigrid({\n\t\turl: '{$page}?list=yes&hostname={$hostname_enc}&t={$t}',\n\t\tdataType: 'json',\n\t\tcolModel : [\n\t\t{display: '{$servername}', name : 'servername', width : 546, sortable : true, align: 'left'},\n\t\t{display: '{$option}', name : 'tls_option', width :309, sortable : true, align: 'left'},\n\t\t{display: '{$delete}', name : 'delete', width : 77, sortable : false, align: 'center'},\n\t\t],\n\t\t{$buttons}\n\t\tsearchitems : [\n\t\t{display: '{$servername}', name : 'servername'},\n\t\t],\n\t\tsortname: 'servername',\n\t\tsortorder: 'asc',\n\t\tusepager: true,\n\t\ttitle: '<span style=font-size:18px>{$title}</span>',\n\t\tuseRp: true,\n\t\trp: 50,\n\t\tshowTableToggleBtn: false,\n\t\twidth: '99%',\n\t\theight: 450,\n\t\tsingleSelect: true,\n\t\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});\n});\n\t\nfunction About{$t}(){\n\talert('{$about_text}');\n}\n\t\nfunction add_tls_smtp_server{$t}(){\n\tLoadjs('{$page}?tls-js=yes&ID=0&t={$t}&hostname={$hostname_enc}');\n}\n\t\n</script>\n\t";
    echo $html;
}