function BindInterfaceForm_old($noecho = 0) { $page = CurrentPageName(); $ip = new networking(1); $array_IP = $ip->ALL_IPS_GET_ARRAY(); $array_IP["all"] = "{all}"; $array_IP[null] = "{select}"; $fieldIP = Field_array_Hash($array_IP, "inet_interface_select", null, null, null, 0, "padding:3px;font-size:14px"); $BindInterfaceTable = BindInterfaceTable(); $sock = new sockets(); $PostfixBindInterfacePort = $sock->GET_INFO("PostfixBindInterfacePort"); if (!is_numeric($PostfixBindInterfacePort)) { $PostfixBindInterfacePort = 25; } $html = "\n\t<div id='interface_table' style='padding:10px'>{$BindInterfaceTable}</div>\n\t<script>\n\t\t\n\t\n\t</script>\n\t"; $tpl = new templates(); if ($noecho == 1) { return $tpl->_ENGINE_parse_body($html); } echo $tpl->_ENGINE_parse_body($html); }
function BindInterfaceForm($noecho=0){ $page=CurrentPageName(); $ip=new networking(1); $array_IP=$ip->ALL_IPS_GET_ARRAY(); $array_IP["all"]="{all}"; $array_IP[null]="{select}"; $fieldIP=Field_array_Hash($array_IP,"inet_interface_select",null,null,null,0,"padding:3px;font-size:13px"); $BindInterfaceTable=BindInterfaceTable(); $html="<div id='BindInterfaceForm'> <table style='width:90%' align='center'> <tr> <td align='right' valign='top' nowrap class=legend>{give the new interface} :</strong></td> <td align='left'>" . Field_text('inet_interface_add',null,'width:80%;padding:3px;font-size:13px',null,null,'{inet_interfaces_text}') ."</td> </tr> <tr> <td align='right' valign='top' nowrap class=legend>{or} {select_ip_address} :</strong></td> <td align='left'>$fieldIP</td> </tr> <tr><td colspan=2 align='right'> <hr>". button("{add}","PostfixAddInterface()")." </td> </table> </div> <div id='interface_table' style='padding:10px'>$BindInterfaceTable</div> <script> var x_ReloadInterface= function (obj) { RefreshTab('main_config_postfix_net'); } function PostfixAddInterface(){ var ip_selected=document.getElementById('inet_interface_select').value; var inet_interface_add=document.getElementById('inet_interface_add').value; if (inet_interface_add.length==0){ if(ip_selected.length>0){ inet_interface_add=ip_selected; } } document.getElementById('inet_interface_add').value=''; document.getElementById('inet_interface_select').value=''; var XHR = new XHRConnection(); document.getElementById('BindInterfaceForm').innerHTML=\"<center style='width:100%'><img src='img/wait_verybig.gif'></center>\"; XHR.appendData('inet_interface_add',inet_interface_add); XHR.sendAndLoad('$page', 'GET',x_ReloadInterface); } function ReloadInterfaceTable(){ LoadAjax('BindInterfaceForm','postfix.network.php?section=BindInterfaceForm'); } function PostfixDeleteInterface(num){ var XHR = new XHRConnection(); XHR.appendData('PostfixDeleteInterface',num); document.getElementById('BindInterfaceForm').innerHTML=\"<center style='width:100%'><img src='img/wait_verybig.gif'></center>\"; XHR.sendAndLoad('$page', 'GET',x_ReloadInterface); } </script> "; $tpl=new templates(); if($noecho==1){return $tpl->_ENGINE_parse_body($html);} echo $tpl->_ENGINE_parse_body($html); }
function BindInterfaceForm($noecho = 0) { $page = CurrentPageName(); $ip = new networking(1); $array_IP = $ip->ALL_IPS_GET_ARRAY(); $array_IP["all"] = "{all}"; $array_IP[null] = "{select}"; $fieldIP = Field_array_Hash($array_IP, "inet_interface_select", null, null, null, 0, "padding:3px;font-size:14px"); $BindInterfaceTable = BindInterfaceTable(); $sock = new sockets(); $PostfixBindInterfacePort = $sock->GET_INFO("PostfixBindInterfacePort"); if (!is_numeric($PostfixBindInterfacePort)) { $PostfixBindInterfacePort = 25; } $html = "<div id='BindInterfaceForm'>\n\t<table style='width:90%' align='center' class=form>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap class=legend>{give the new interface} :</strong></td>\n\t\t<td align='left'>" . Field_text('inet_interface_add', null, 'width:80%;padding:3px;font-size:14px', null, null, '{inet_interfaces_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap class=legend>{or} {select_ip_address} :</strong></td>\n\t\t<td align='left'>{$fieldIP}</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap class=legend>{listen_port} :</strong></td>\n\t\t<td align='left'>" . Field_text('PostfixBindInterfacePort', $PostfixBindInterfacePort, 'width:60px;padding:3px;font-size:14px', null, null) . "</td>\n\t</tr>\t\t\n\t<tr><td colspan=2 align='right'> \n\t<hr>" . button("{add}", "PostfixAddInterface()") . "\n\t</td>\n\t</table>\n\t</div>\n\t<div id='interface_table' style='padding:10px'>{$BindInterfaceTable}</div>\n\t<script>\n\t\tvar x_ReloadInterface= function (obj) {\n\t\t\tRefreshTab('main_config_postfix_net');\n\t\t\t}\n\t\n\t\n\t\tfunction PostfixAddInterface(){\n\t\t\tvar ip_selected=document.getElementById('inet_interface_select').value;\n\t\t\tvar inet_interface_add=document.getElementById('inet_interface_add').value;\n\t\t\tif (inet_interface_add.length==0){\n\t\t\t\tif(ip_selected.length>0){\n\t\t\t\t\tinet_interface_add=ip_selected;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById('inet_interface_add').value='';\n\t\t\tdocument.getElementById('inet_interface_select').value='';\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('inet_interface_add',inet_interface_add);\n\t\t\tif(!document.getElementById('PostfixBindInterfacePort')){alert('PostfixBindInterfacePort no such field');return;}\n\t\t\tXHR.appendData('PostfixBindInterfacePort',document.getElementById('PostfixBindInterfacePort').value);\n\t\t\tAnimateDiv('BindInterfaceForm');\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_ReloadInterface);\t\n\t\t\t\n\t\t}\n\t\t\n\t\tfunction ReloadInterfaceTable(){\n\t\t\tLoadAjax('BindInterfaceForm','postfix.network.php?section=BindInterfaceForm');\n\t\t\t}\t\n\t\t\t\n\t\tfunction PostfixDeleteInterface(num){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('PostfixDeleteInterface',num);\n\t\t\tdocument.getElementById('BindInterfaceForm').innerHTML=\"<center style='width:100%'><img src='img/wait_verybig.gif'></center>\";\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_ReloadInterface);\n\t\t\t}\t\t\t\n\t\n\t</script>\n\t"; $tpl = new templates(); if ($noecho == 1) { return $tpl->_ENGINE_parse_body($html); } echo $tpl->_ENGINE_parse_body($html); }