本文整理汇总了PHP中CompileTr2函数的典型用法代码示例。如果您正苦于以下问题:PHP CompileTr2函数的具体用法?PHP CompileTr2怎么用?PHP CompileTr2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CompileTr2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: squid_cache_status
function squid_cache_status()
{
$page = CurrentPageName();
$squid = new squidnodes($_GET["nodeid"]);
$tpl = new templates();
$q = new mysql_blackbox();
$t = $_GET["t"];
$sql = "SELECT * FROM cachestatus WHERE nodeid='{$_GET["nodeid"]}'";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo "<H3>Error: {$q->mysql_error}</H3>";
return;
}
//$squid->
$tr[] = "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/parameters2-64.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top><strong style='font-size:14px'>\n\t\t\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('nodes.squid.caches32.parms.php?hostid={$_GET["hostid"]}&nodeid={$_GET["nodeid"]}');\"\n\t\t\t\t\t\t\tstyle='font-size:14px;text-decoration:underline;font-weight:bold'>\n\t\t\t\t\t\t\t{caches_parameters}</a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><span style='font-size:14px'>{cache_parameters_node_explain}</span></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$tr[] = "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/disk-64.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top><strong style='font-size:14px'>" . basename($ligne["cachedir"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><strong style='font-size:14px'>" . FormatBytes($ligne["currentsize"]) . "/" . FormatBytes($ligne["maxsize"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'>" . pourcentage($ligne["pourc"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
}
$html = CompileTr2($tr);
$html = $html . "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('squid-caches-status{$t}','{$page}?squid-caches-status=yes&nodeid={$_GET["nodeid"]}');") . "</div>";
echo $tpl->_ENGINE_parse_body($html);
}
示例2: loggers_status
function loggers_status()
{
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$data = unserialize(base64_decode($sock->getFrameWork("squid.php?loggers-status=yes")));
if (!is_array($data)) {
return;
}
while (list($PID, $ARRAY) = each($data)) {
$timettl = $ARRAY["TTL"];
$PURGED = $ARRAY["PURGED"];
$COUNT_RQS = $ARRAY["COUNT_RQS"];
$PURGED = FormatNumber($PURGED);
$COUNT_RQS = FormatNumber($COUNT_RQS);
if ($ARRAY["LASTTIME"] > 0) {
$Laststatus = distanceOfTimeInWords($ARRAY["LASTTIME"], time(), true);
} else {
$Laststatus = "-";
}
$f[] = "\n\t\t<div style='width:550px;margin-bottom:20px' class=form>\n\t\t<table>\n\t\t<tr>\n\t\t\t<td style='min-width:68px;vertical-align:top'><img src='img/process-64.png'></td>\n\t\t\t<td style='min-width:482px;vertical-align:top'>\t\t\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{PID}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$PID}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{running_since}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$timettl}mn</td>\n\t\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{purged_events}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$PURGED}</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{received_connections}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$COUNT_RQS}</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{last_status}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$Laststatus}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t</div>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t";
}
echo $tpl->_ENGINE_parse_body(CompileTr2($f) . "\n\t\t\t<div style='width:100%;height:160px'>\n\t\t\t <div style='float:right;margin-left:10px;'>" . button("{refresh}", "LoadAjax('logger-status','{$page}?logger-status=yes',true);", 26) . "</div>\n\t\t\t<div style='float:right'>" . button("{reload_proxy}", "Loadjs('squid.reload.php');", 26) . "</div></div>");
}
示例3: status_section
function status_section()
{
$page = CurrentPageName();
$user = new usersMenus();
$sock = new sockets();
$tpl = new templates();
if (!$user->POWER_DNS_INSTALLED) {
not_installed();
return null;
}
$PDNSRestartIfUpToMB = $sock->GET_INFO("PDNSRestartIfUpToMB");
$DisablePowerDnsManagement = $sock->GET_INFO("DisablePowerDnsManagement");
$EnablePDNS = $sock->GET_INFO("EnablePDNS");
$PowerDNSMySQLEngine = $sock->GET_INFO("PowerDNSMySQLEngine");
$PowerDNSDisableLDAP = $sock->GET_INFO("PowerDNSDisableLDAP");
$rebuild_database_warn = $tpl->javascript_parse_text("{rebuild_database_warn}");
if (!is_numeric($EnablePDNS)) {
$EnablePDNS = 0;
}
if (!is_numeric($PowerDNSMySQLEngine)) {
$PowerDNSMySQLEngine = 1;
}
if (!is_numeric($PDNSRestartIfUpToMB)) {
$PDNSRestartIfUpToMB = 700;
}
if (!is_numeric($DisablePowerDnsManagement)) {
$DisablePowerDnsManagement = 0;
}
if (!is_numeric($PowerDNSDisableLDAP)) {
$PowerDNSDisableLDAP = 1;
}
$PowerDNSMySQLEngine = 1;
$DisablePowerDnsManagement_text = $tpl->javascript_parse_text("{DisablePowerDnsManagement_text}");
$add = Paragraphe("dns-cp-add-64.png", "{ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "javascript:AddPDNSEntry()");
$restart = Paragraphe("64-recycle.png", "{restart_pdns}", "{restart_pdns_text}", "javascript:RestartPDNS()");
$nic = Buildicon64('DEF_ICO_IFCFG');
$check_resolution = $tpl->_ENGINE_parse_body("{check_resolution}");
$tests = Paragraphe("check-64.png", "{$check_resolution}", "{check_resolution_dns_engine}", "javascript:YahooWin5('650','{$page}?digg=yes','{$check_resolution}')");
if ($DisablePowerDnsManagement == 1) {
$add = Paragraphe("dns-cp-add-64-grey.png", "{ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "");
}
if ($EnablePDNS == 0) {
$add = Paragraphe("dns-cp-add-64-grey.png", "{ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "");
}
if ($PowerDNSDisableLDAP == 1) {
$add = null;
}
$t = time();
$ADD_DNS_ENTRY = $tpl->_ENGINE_parse_body("{ADD_DNS_ENTRY}");
if ($PowerDNSMySQLEngine == 1) {
$add = Paragraphe("dns-cp-add-64.png", "{$ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "javascript:YahooWin5('550','pdns.mysql.php?item-id=0&t={$t}','PowerDNS:{$ADD_DNS_ENTRY}');");
if ($user->POWERADMIN_INSTALLED) {
if ($EnablePDNS == 1) {
$poweradmin = Paragraphe("poweradmin-64.png", "{APP_POWERADMIN}", "{APP_POWERADMIN_TEXT}", "javascript:s_PopUp('powerdns/index.php',750,650);");
if (!function_exists('mcrypt_encrypt')) {
$poweradmin = Paragraphe("warning64.png", "{APP_POWERADMIN}", "{APP_POWERADMIN_NO_MCRYPT_ENCRYPT}", "");
}
}
}
}
if ($PowerDNSMySQLEngine == 1) {
$repair_database = Paragraphe("database-error-64.png", "{recreate_database}", "{recreate_database_text}", "javascript:RebuildPDNSDB();");
}
if ($user->APP_UFDBGUARD_INSTALLED) {
$dns_filter = Paragraphe("Firewall-Secure-64.png", "{dns_filter}", "{dns_filters_ufdb_text}", "javascript:Loadjs('pdns.ufdb.php')");
}
$help = Paragraphe("help-64.png", "{help}", "{online_help}", "javascript:s_PopUpFull('http://nas-appliance.org/index.php?cID=177','1024','900');");
$POWER_DNS_MYSQL = 1;
//if(!$user->POWER_DNS_MYSQL){$POWER_DNS_MYSQL=0;$PowerDNSMySQLEngine=0;}
$t = time();
$time = time();
$ttr[] = $dns_filter;
$ttr[] = $add;
$ttr[] = $repair_database;
$ttr[] = $help;
$ttr[] = $tests;
$buttons = CompileTr2($ttr, "form");
if ($EnablePDNS == 1) {
$q = new mysql();
if (!$q->TABLE_EXISTS("records", "powerdns")) {
$errordb = $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{error_missing_tables_click_to_repair}", true) . "\n\t\t\t\t\t<hr>\n\t\t\t\t\t<center id='{$t}'>" . button("{repair}", "RepairPDNSTables()", "22px") . "</center>\n\t\t\t\t\t<p> </p>\n\t\t\t\t\t<script>\n\t\t\t\t\t\tvar x_RepairPDNSTables=function (obj) {\n\t\t\t\t\t\t\tvar results=obj.responseText;\n\t\t\t\t\t\t\tif(results.length>0){alert(results);}\n\t\t\t\t\t\t\tRefreshTab('main_config_pdns');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfunction RepairPDNSTables(){\n\t\t\t\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\t\t\t\tXHR.appendData('RepairPDNSTables','yes');\n\t\t\t\t\t\t\tAnimateDiv('{$t}');\n\t\t\t\t\t\t\tXHR.sendAndLoad('pdns.mysql.php', 'POST',x_RepairPDNSTables);\n\t\t\t\t\t\t}\n\t\t\t\t\t</script>\n\t\t\n\t\t\t\t\t");
}
}
$html = "\n\t<div id='t-{$time}'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=99%>\n\t\t\t<div id='pdns_status'></div>\n\t\t\t<div style='text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshPDNSStatus()") . "</div>\n\t\t\t\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2>\n\t\t\t\t\t{$errordb}\n\t\t\t\t\t" . Paragraphe_switch_img("{EnablePDNS}", "{pdns_explain}", "EnablePDNS{$t}", $EnablePDNS, null, 630) . "\n\t\t\t\t\t<hr>\n\t\t\t\t\t<div style='width:100%;text-align:right;margin-bottom:15px'>\n\t\t\t\t\t\t\t" . button("{apply}", "SaveEnablePowerDNS()", 30) . "</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n{$buttons}\n\t\t\t\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\t\tfunction RefreshPDNSStatus(){\n\t\t\tLoadAjax('pdns_status','{$page}?PowerDNS-status=yes');\n\t\t\t\n\t\t\n\t\t}\n\t\t\n\tvar x_RestartPDNS=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif (results.length>0){alert(results);}\n\t\t\tRefreshPDNSStatus();\n\t\t\t\n\t\t}\n\t\t\n\tvar x_SaveEnablePowerDNS=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif (results.length>0){alert(results);}\n\t\t\tRefreshTab('main_config_pdns');\n\t\t\t\n\t\t}\n\t\n\tfunction RestartPDNS(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('RestartPDNS','yes');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_RestartPDNS);\n\t}\n\t\n\tfunction SaveEnablePowerDNS(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('SaveEnablePowerDNS',document.getElementById('EnablePDNS{$t}').value);\n\t\tAnimateDiv('t-{$time}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveEnablePowerDNS);\t\n\t\n\t}\n\t\n\tfunction RebuildPDNSDB(){\n\t\tif(confirm('{$rebuild_database_warn}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('RebuildPDNSDB','yes');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_RestartPDNS);\n\t\t\n\t\t}\n\t\n\t}\n\t\n\t\t\n\t\tRefreshPDNSStatus();\n\t</script>\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例4: home_b
function home_b(){
$t=$_GET["t"];
$page=CurrentPageName();
$tpl=new templates();
$tr[]=icon_memory();
$tr[]=Paragraphe("perfs-64.png","{artica_performances}","{artica_performances_text}","javascript:Loadjs('artica.performances.php');");
$tr[]=Paragraphe("ChemicalsMoveDown-64.png","{clean_memory}","{clean_memory_text}","javascript:Loadjs('$page?clean-mem-js=yes&t=$t');");
$table=CompileTr2($tr,"form");
echo $tpl->_ENGINE_parse_body($table);
}
示例5: index_page
function index_page()
{
$bind9 = Paragraphe('folder-64-bind9-grey.png', '{APP_BIND9}', '{APP_BIND9_TEXT}', "", null, 210, null, 0, false);
$openvpn = Paragraphe('64-openvpn-grey.png', '{APP_OPENVPN}', '{APP_OPENVPN_TEXT}', "", null, 210, null, 0, false);
$users = new usersMenus();
if ($users->dhcp_installed) {
$dhcp = Buildicon64('DEF_ICO_DHCP');
}
if ($users->BIND9_INSTALLED == true) {
$bind9 = ICON_BIND9();
}
$gateway = Buildicon64('DEF_ICO_GATEWAY');
$tr[] = $gateway;
$tr[] = $dhcp;
$tr[] = $bind9;
$tr[] = $comp;
$tr[] = $openvpn;
$html = CompileTr2($tr, "form");
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html, "system.index.php");
}
示例6: tweaks
function tweaks()
{
if (GET_CACHED(__FILE__, __FUNCTION__, null)) {
return;
}
$sock = new sockets();
$EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
$users = new usersMenus();
$page = CurrentPageName();
$tpl = new templates();
if ($users->ALTERMIME_INSTALLED) {
$altermime = Paragraphe('icon_settings-64.png', '{disclaimer}', '{disclaimer_text}', "javascript:Loadjs('amavis.index.php?altermime-js=yes')", 90);
} else {
//$altermime=ParagrapheTEXT_disabled('icon_settings-48.png','{disclaimer}','{disclaimer_text}',null,90);
}
if ($users->POMMO_INSTALLED) {
$pommo = Paragraphe('64-pommo.png', '{APP_POMMO}', '{APP_POMMO_TEXT}', "javascript:Loadjs('pommo.index.php?pommo-js=yes')", 90);
} else {
//$pommo=ParagrapheTEXT_disabled('48-pommo.png','{APP_POMMO}','{APP_POMMO_TEXT}',null,90);
}
if ($users->zip_installed) {
if ($users->AMAVIS_INSTALLED) {
if ($users->EnableAmavisDaemon == 1) {
$winzip = Paragraphe('64-winzip.png', '{auto-compress}', '{auto-compress_text}', "javascript:Loadjs('auto-compress.php?script=winzip')", 90);
}
}
}
if ($users->POSTMULTI) {
$multi = Paragraphe('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', "javascript:Loadjs('postfix.network.php?POSTFIX_MULTI_INSTANCE_JS=yes')", 90);
} else {
//$multi=ParagrapheTEXT_disabled('postfix-multi-48.png','{POSTFIX_MULTI_INSTANCE}','{POSTFIX_MULTI_INSTANCE_TINY_TEXT}',null,90);
}
if ($users->MEM_TOTAL_INSTALLEE < 700000) {
$multi = ParagrapheTEXT_disabled('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', null, 90);
$multi = null;
}
$postfixStop = Paragraphe('pause-64.png', '{stop_messaging}', '{stop_messaging_text}', "javascript:Loadjs('postfix.stop.php',true)", 90);
//$postfix_restrictions_classes=Paragraphe('folder-64-restrictions-classes.png','{postfix_restrictions_classes}','{restriction_classes_minitext}',"javascript:Loadjs('postfix.restrictions.classes.php?js=yes')",90);
$events = Paragraphe('64-mailevents.png', '{postfix_events}', '{logs_viewer_text}', "javascript:s_PopUp('postfix.events.php?pop=true',450,400)", 90);
//$storage=Paragraphe('folder-storage2-64.png','{storage_rules}','{storage_rules_text}',"javascript:Loadjs('postfix.storage.rules.php')",90);
//$main_src=Paragraphe('folder-script-database-64.png','{main_ldap}','{main_ldap_explain}',"javascript:s_PopUp(\"postfix.report.php\",500,500,true)",90);
$watchdog_queue = Paragraphe('folder-watch-64.png', '{watchdog_queue}', '{watchdog_queue_text}', "javascript:Loadjs('postfix.postqueuep.php',true)", 90);
$postmaster = Paragraphe('postmaster-64.png', '{postmaster}', '{postmaster_text}', "javascript:Loadjs('postfix.postmaster.php')", 90);
$postmaster_identity = Paragraphe('postmaster-identity.png', '{postmaster_identity}', '{postmaster_identity_text}', "javascript:Loadjs('postfix.postmaster-ident.php',true)", 90);
$UnknownUsers = Paragraphe('unknown-user-64.png', '{unknown_users}', '{postfix_unknown_users_tinytext}', "javascript:Loadjs('postfix.luser_relay.php',true)", 90);
$RemoveMessaging = Paragraphe('delete-64.png', '{disable_messaging}', '{disable_messaging_text}', "javascript:Loadjs('postfix.disable.php',true)", 90);
$ActiveDirectory = Paragraphe('wink-64.png', '{active_directory_link}', '{active_directory_linkmail_text}', "javascript:Loadjs('{$page}?active_directory_link=yes')", 90);
//$massmailing=ParagrapheTEXT_disabled('mass-mailing-postfix-48.png','{emailings}','{ENABLE_MASSMAILING_TEXT}',null,90);
if ($users->EMAILRELAY_INSTALLED) {
$massmailing = Paragraphe('mass-mailing-postfix-64.png', '{emailings}', '{ENABLE_MASSMAILING_TEXT}', "javascript:Loadjs('postfix.massmailing.php',true)", 90);
}
//$multi_infos=ParagrapheTEXT_disabled('postfix-multi-48-info.png','{POSTFIX_MULTI_INSTANCE_INFOS}',
///'{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}',null,90);
if ($EnablePostfixMultiInstance == 1) {
$main_src = null;
$performances = ParagrapheTEXT_disabled('folder-performances-64.png', '{performances_settings}', '{performances_settings_text}', null, 90);
$performances = null;
$mastercf = null;
$maincfedit = null;
$maincf = null;
$postfix_restrictions_classes = null;
$storage = null;
$other = null;
$multi_infos = Paragraphe('postfix-multi-64-info.png', '{POSTFIX_MULTI_INSTANCE_INFOS}', '{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}', "javascript:Loadjs('postfix.multiple.instances.infos.php')");
$postfixStop = Paragraphe('pause-64-grey.png', '{stop_messaging}', '{stop_messaging_text}', "", 90);
}
$q = new mysql();
$table_storage = $q->TABLE_STATUS("storage", "artica_backup");
if ($table_storage["Rows"] > 0) {
$backup_query = Paragraphe('64-backup.png', "{$table_storage["Rows"]} {backuped_mails}", '{all_mailbackup_text}', "javascript:Loadjs('domains.backup.php?js=yes&Master=yes')");
}
if ($users->MAILMAN_INSTALLED) {
$mailman = Paragraphe('mailman-64.png', '{APP_MAILMAN}', '{manage_distribution_lists}', "javascript:Loadjs('mailman.php?script=yes')");
}
$tr[] = $multi;
$tr[] = $multi_infos;
$tr[] = $postfixStop;
$tr[] = $RemoveMessaging;
$tr[] = $watchdog_queue;
$tr[] = $massmailing;
$tr[] = $pommo;
$tr[] = $postmaster;
$tr[] = $postmaster_identity;
$tr[] = $UnknownUsers;
$tr[] = $backup_query;
$tr[] = $mailman;
$tr[] = $events;
$tr[] = $altermime;
$tr[] = $maincf;
$tr[] = $main_src;
$tr[] = $maincfedit;
$tr[] = $mastercf;
$tr[] = $storage;
$tr[] = $postfix_restrictions_classes;
$tr[] = $other;
$icons = CompileTr2($tr, 'form');
$refresh = "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshIndexPostfixAjax()") . "</div>";
$main = "<input type='hidden' id='monitor_page' value='1' name='monitor_page'>\n{$refresh}\n<table style='width:100%'>\n<tbody>\n<tr>\n\t<td style='width:99%'>{$icons}</td>\n\t<td style='vertical-align:top'><div id='Postfixservinfos' style='width:450px'></div>\n</tr>\n</tbody>\n</table>\n";
$html = "{$main}\n\n<script>\n\t\t\n</script>\n";
$datas = $tpl->_ENGINE_parse_body($html);
//.........这里部分代码省略.........
示例7: filter2_section
function filter2_section()
{
$sock = new sockets();
$users = new usersMenus();
$SpamAssMilterEnabled = intval($sock->GET_INFO("SpamAssMilterEnabled"));
$SpamassassinDelegation = intval($sock->GET_INFO("SpamassassinDelegation"));
$MimeDefangEnabled = intval($sock->GET_INFO('MimeDefangEnabled'));
$MimeDefangAutoWhiteList = intval($sock->GET_INFO("MimeDefangAutoWhiteList"));
$MimeDefangFilterExtensions = intval($sock->GET_INFO("MimeDefangFilterExtensions"));
if ($MimeDefangEnabled == 1) {
$SpamAssMilterEnabled = 1;
}
$TTDOMS = array();
$OK_SPAMASS = false;
if ($SpamAssMilterEnabled == 1) {
if ($SpamassassinDelegation == 1) {
$OK_SPAMASS = true;
}
}
if (!$users->MIMEDEFANG_INSTALLED) {
$MimeDefangEnabled = 0;
}
if ($MimeDefangEnabled == 0) {
$MimeDefangClamav = 0;
$MimeDefangSpamAssassin = 0;
$MimeDefangAutoWhiteList = 0;
$MimeDefangFilterExtensions = 0;
}
$AutoWhite_icon = "arrow-right-24.png";
$AutoWhite_color = "#000000";
$AutoWhite_js = "GotoAutoWhite()";
$AutoWhite_text = null;
$ExtCheck_icon = "arrow-right-24.png";
$ExtCheck_color = "#000000";
$ExtCheck_js = "GotoMimeDefangExtensions()";
$ExtCheck_text = null;
if ($MimeDefangAutoWhiteList == 0) {
$AutoWhite_icon = "arrow-right-24-grey.png";
$AutoWhite_color = "#898989";
$AutoWhite_js = "blur()";
$AutoWhite_text = " <span style='font-size:14px'>({disabled})</span>";
}
if ($MimeDefangFilterExtensions == 0) {
$ExtCheck_icon = "arrow-right-24-grey.png";
$ExtCheck_color = "#898989";
$ExtCheck_js = "blur()";
$ExtCheck_text = " <span style='font-size:14px'>({disabled})</span>";
}
if (!$users->MIMEDEFANG_INSTALLED) {
$mimedefang_icon = "arrow-right-24-grey.png";
$mimedefang_color = "#898989";
$mimedefang_js = "GotoMessagingSecurityUpdate()";
$mimedefang_text = " <span style='font-size:14px'>({not_installed})</span>";
$AutoWhite_text = " <span style='font-size:14px'>({not_installed})</span>";
$ExtCheck_text = " <span style='font-size:14px'>({not_installed})</span>";
}
$ldap = new clladp();
$domains = $ldap->hash_get_domains_ou($_SESSION["ou"]);
$ouencoded = urlencode($_SESSION["ou"]);
$TTDOMS[] = "<table style='width:100%'>\n\t<tr>\n\t<td valign='middle' style='width:25px'><img src='img/arrow-right-24.png'></td>\n\t<td valign='middle' style='font-size:18px;width:99%;color:black'>" . texttooltip("{safety_standards}", "position:right:{safety_standards}", "GoToRFCDomain('{$ouencoded}')") . "</td>\n\t</tr></table>";
$TTDOMS[] = "\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='middle' style='width:25px'><img src='img/{$AutoWhite_icon}'></td>\n\t\t\t<td valign='middle' style='font-size:18px;width:99%;color:{$AutoWhite_color}'>" . texttooltip("{smtp_AutoWhiteList}{$AutoWhite_text}", "position:right:{smtp_AutoWhiteList}", $AutoWhite_js) . "</td>\n\t\t</tr>\n\t</table>";
$TTDOMS[] = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='middle' style='width:25px'><img src='img/{$ExtCheck_icon}'></td>\n\t<td valign='middle' style='font-size:18px;width:99%;color:{$ExtCheck_color}'>" . texttooltip("{title_mime}{$ExtCheck_text}", "position:right:{mimedefang_attachments_text}", $ExtCheck_js) . "</td>\n\t\t</tr>\n\t</table>";
while (list($num, $ligne) = each($domains)) {
$icon = "arrow-right-24.png";
$Color = "#000000";
$js = "GoToAntiSpamsDomain('{$num}')";
$text = null;
if (!$OK_SPAMASS) {
$icon = "arrow-right-24-grey.png";
$js = "blur()";
$text = " <span style='font-size:14px'>({disabled})</span>";
$Color = "#898989";
}
$TTDOMS[] = "<table style='width:100%'>\n\t\t<tr>\n\t<td valign='middle' style='width:25px'>\n\t\t<img src='img/{$icon}'>\n\t</td>\n\t\t<td valign='middle' style='font-size:18px;width:99%;color:{$Color}'>" . texttooltip("Anti-Spam: {$num}{$text}", "{$num}", "{$js}") . "</td>\n\t</tr>\n\t</table>";
}
if (count($TTDOMS) > 0) {
$final = CompileTr2($TTDOMS);
}
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($final);
}
示例8: services_toolbox
function services_toolbox()
{
$sock = new sockets();
$tpl = new templates();
$ini = new Bs_IniHandler();
$page = CurrentPageName();
$EnableKlms = $sock->GET_INFO("EnableKlms");
if (!is_numeric($EnableKlms)) {
$EnableKlms = 1;
}
$TOTAL_MEMORY_MB = $sock->getFrameWork("system.php?TOTAL_MEMORY_MB=yes");
if ($TOTAL_MEMORY_MB < 1500) {
$EnableKlms = 0;
$p = FATAL_ERROR_SHOW_128("{NO_ENOUGH_MEMORY_FOR_THIS_SECTION}<br><strong style='font-size:18px'>{require}:1500MB</strong>", false, true);
} else {
$p = Paragraphe_switch_img("{activate_klms}", "{activate_klms_explain}", "EnableKlms", $EnableKlms, null, 550);
}
$tr[] = Paragraphe32("watchdog", "watchdog_klms8_text", "Loadjs('klms8.watchdog.php')", "watchdog-32.png");
$tr[] = Paragraphe32("tasks", "tasks_klms8_text", "Loadjs('klms.tasks.php')", "folder-tasks-32.png");
$tr[] = Paragraphe32("license_info", "license_info_text", "Loadjs('klms.license.php')", "kl-license-32.png");
$tr[] = Paragraphe32("mta_link", "mta_link_text", "Loadjs('klms.mta.php')", "comut-32.png");
$tr[] = Paragraphe32("apply_config", "apply_klms_config_text", "ApplyConfigKLMS()", "32-settings-refresh.png");
$tr[] = Paragraphe32("reset_admin_password", "reset_admin_password_text", "Loadjs('klms.password.php')", "32-key.png");
$table = CompileTr2($tr, "form");
$html = "\n\t{$p}<hr>\n\t{$table}\n\t<script>\n\t\tvar X_applycf= function (obj) {\n \t\t\tvar tempvalue=obj.responseText;\n\t \tif(tempvalue.length>3){alert(tempvalue);}\n\t\t}\n\t\t\t\n\t\tfunction ApplyConfigKLMS(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('apply-config','yes');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',X_applycf);\t\n\t\t}\t\t\n\t\n\t</script>\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例9: section_computers_infos_OS
function section_computers_infos_OS(){
$page=CurrentPageName();
if(CACHE_SESSION_GET( __FUNCTION__,__FILE__,120)){return;}
$syslog=Paragraphe("syslog-64.png","{system_log}","{system_log_text}","javascript:Loadjs('syslog.engine.php?windows=yes');");
$dmesg=Paragraphe("syslog-64.png","{kernel_infos}","{kernel_infos_text}","javascript:Loadjs('syslog.dmesg.php?windows=yes');");
$articacron=Paragraphe("folder-tasks-64.png","{internal_scheduler}","{internal_scheduler_text}","javascript:Loadjs('artica.internal.cron.php');");
$tr[]=sysinfos();
$tr[]=icon_system();
$tr[]=icon_memory();
$tr[]=icon_harddrive();
$tr[]=icon_terminal();
$tr[]=$syslog;
$tr[]=$dmesg;
$tr[]=$articacron;
$tr[]=scancomputers();
$links=CompileTr2($tr);
$t=time();
$html="
<table style='width:100%'>
<tr>
<td valign='top'><span id='$t'></span></td>
<td valign='top'>$links</td>
</tr>
</table>
<script>
QuickLinkShow('quicklinks-system_information');
LoadAjax('$t','$page?function=section_computer_header');
</script>
";
$tpl=new templates();
CACHE_SESSION_SET(__FUNCTION__,__FILE__, $tpl->_ENGINE_parse_body($html));
}
示例10: PageDeGarde
function PageDeGarde()
{
$page = CurrentPageName();
$time = time();
$tpl = new templates();
$f1[] = $tpl->_ENGINE_parse_body("<div style='font-size:26px;margin-bottom:20px'>{top_web} {today}</div>");
$file = "/usr/share/artica-postfix/ressources/logs/web/TOP_MIME.db";
if (is_file($file)) {
$tr[] = "<div style='width:500px;height:500px' id='{$time}-000'></div>";
$f2[] = "function X000{$time}(){\n\t\tAnimateDiv('{$time}-000');\n\t\tLoadjs('{$page}?graphMime=yes&container={$time}-000&time={$time}',true);\n\t}\n\tsetTimeout(\"X000{$time}()\",500);";
}
$file1 = "/usr/share/artica-postfix/ressources/logs/web/TOP_CACHED.db";
$file2 = "/usr/share/artica-postfix/ressources/logs/web/TOP_NOT_CACHED.db";
if (is_file($file1)) {
$tr[] = "<div style='width:500px;height:500px' id='{$time}-001'></div>";
$f2[] = "function X001{$time}(){\n\t\tAnimateDiv('{$time}-001');\n\t\tLoadjs('{$page}?graph001=yes&container={$time}-001&time={$time}',true);\n\t\t}\n\t\tsetTimeout(\"X001{$time}()\",500);";
}
if (is_file($file2)) {
$tr[] = "<div style='width:500px;height:500px' id='{$time}-002'></div>";
$f2[] = "function X002{$time}(){\n\t\tAnimateDiv('{$time}-002');\n\t\tLoadjs('{$page}?graph002=yes&container={$time}-002&time={$time}',true);\n\t\t}\n\t\tsetTimeout(\"X002{$time}()\",500);";
}
$file = "/usr/share/artica-postfix/ressources/logs/web/TOP_PROTO_SIZE.db";
if (is_file($file)) {
$tr[] = "<div style='width:500px;height:500px' id='{$time}-100'></div>";
$f2[] = "function X100{$time}(){\n\t\tAnimateDiv('{$time}-100');\n\t\tLoadjs('{$page}?graphProtoSize=yes&container={$time}-100&time={$time}',true);\n\t}\n\tsetTimeout(\"X100{$time}()\",500);";
}
$file = "/usr/share/artica-postfix/ressources/logs/web/TOP_PROTO_HITS.db";
if (is_file($file)) {
$tr[] = "<div style='width:500px;height:500px' id='{$time}-200'></div>";
$f2[] = "function X200{$time}(){\n\t\tAnimateDiv('{$time}-200');\n\t\tLoadjs('{$page}?graphProtoHits=yes&container={$time}-200&time={$time}',true);\n\t}\n\tsetTimeout(\"X200{$time}()\",500);";
}
$tr[] = "<div style='width:500px;height:500px' id='{$time}-01'></div>";
$tr[] = "<div style='width:500px;height:500px' id='{$time}-02'></div>";
$tr[] = "<div style='width:500px;height:500px' id='{$time}-03'></div>";
$f1[] = CompileTr2($tr);
if (is_file("/usr/share/artica-postfix/ressources/logs/bandwith_stats_today-fam.db")) {
$f2[] = "function XDeux{$time}(){\n\t\tAnimateDiv('{$time}-01');\n\t\tLoadjs('{$page}?graph1=yes&container={$time}-01&time={$time}',true);\n\t}\n\tsetTimeout(\"XDeux{$time}()\",500);";
}
$html = @implode("\n", $f1) . "<script>" . @implode("\n", $f2) . "</script>";
echo $html;
}
示例11: dansguardian_service_status
function dansguardian_service_status()
{
$page = CurrentPageName();
$sock = new sockets();
$ini = new Bs_IniHandler();
$users = new usersMenus();
$ini->loadString(base64_decode($sock->getFrameWork('cmd.php?squid-ini-status=yes')));
$squid = new squidbee();
$CicapEnabled = $sock->GET_INFO('CicapEnabled');
$EnableClamavInCiCap = $sock->GET_INFO("EnableClamavInCiCap");
if (!is_numeric($CicapEnabled)) {
$CicapEnabled = 0;
}
if (!is_numeric($EnableClamavInCiCap)) {
$EnableClamavInCiCap = 1;
}
$squid_status = DAEMON_STATUS_ROUND("SQUID", $ini, null, 1);
$dansguardian_status = DAEMON_STATUS_ROUND("DANSGUARDIAN", $ini, null, 1);
$APP_SQUIDGUARD_HTTP = DAEMON_STATUS_ROUND("APP_SQUIDGUARD_HTTP", $ini, null, 1);
$APP_UFDBGUARD = DAEMON_STATUS_ROUND("APP_UFDBGUARD", $ini, null, 1);
$KAV4PROXY = DAEMON_STATUS_ROUND("KAV4PROXY", $ini, null, 1);
$CICAP = DAEMON_STATUS_ROUND("C-ICAP", $ini, null, 1);
$FRESHCLAM = DAEMON_STATUS_ROUND("FRESHCLAM", $ini, null, 1);
if ($users->KASPERSKY_WEB_APPLIANCE) {
$FRESHCLAM = null;
}
if ($users->KAV4PROXY_INSTALLED) {
$FRESHCLAM = null;
}
if (!$users->FRESHCLAM_INSTALLED) {
$FRESHCLAM = null;
}
if ($CicapEnabled == 0) {
$FRESHCLAM = null;
}
if ($EnableClamavInCiCap == 0) {
$FRESHCLAM = null;
}
$tr[] = $squid_status;
$tr[] = $dansguardian_status;
$tr[] = $APP_SQUIDGUARD_HTTP;
$tr[] = $CICAP;
$tr[] = $APP_UFDBGUARD;
$tr[] = $KAV4PROXY;
$tr[] = $FRESHCLAM;
$html = "{$okFilterText}\n\t\t<center style='padding-left:5px;margin-right:-5px'>\n\t\t\t<div id='nofilters'></div>\n\t\t\t<div style='width:550px'>" . CompileTr2($tr) . "</div>\n\t\t</center>\n\t\t<div style='text-align:right;width:100%'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshDansguardianMainService()") . "</div>\n\t<script>\n\t\tLoadAjax('nofilters','{$page}?dansguardian-service_status-nofilters=yes');\n\t\t\n\t\tUnlockPage();\n\t</script>\n\t\n\t";
$off = "<script>UnlockPage();</script>";
$tpl = new templates();
$html = $tpl->_ENGINE_parse_body($html, 'squid.index.php');
echo $html;
}
示例12: page
//.........这里部分代码省略.........
$error = null;
$defined_size = $tpl->_ENGINE_parse_body("{Defined_size}");
$DisableAnyCache = intval($sock->GET_INFO("DisableAnyCache"));
$COUNT_DE_CACHES = intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/COUNT_DE_CACHES"));
$COUNT_DE_MEMBERS = intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/MEMBERS_COUNT"));
$users = new usersMenus();
if ($DisableAnyCache == 1) {
echo FATAL_ERROR_SHOW_128("{DisableAnyCache_enabled_warning}");
return;
}
$cachefile = "/usr/share/artica-postfix/ressources/logs/web/squid_get_cache_infos.db";
$MAIN_CACHES = unserialize(@file_get_contents($cachefile));
$curs = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\" \n\tOnClick=\"javascript:Loadjs('squid.caches.center.wizard.php',true);\"";
$curs2 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"javascript:Loadjs('squid.caches.progress.php',true);\"";
$curs3 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"javascript:Loadjs('squid.refresh-status.php',true);\"";
$curs4 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"javascript:Loadjs('squid.rebuild.caches.progress.php');\"";
$curs5 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"LoadAjaxRound('proxy-store-caches','admin.dashboard.proxy.caches.php');\"";
$curs6 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"GoToCachesCenter();\"";
$curs7 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"Loadjs('squidclient.mgr-storedir.php');\"";
$curs8 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"Loadjs('squid.caches.center.php?change-cache-types-js=yes');\"";
$main_icon = "add-180.png";
$color = "black";
if (!$users->CORP_LICENSE) {
$main_icon = "add-180-grey.png";
$curs = null;
$color = "#898989";
$curs6 = null;
$error = "<p class=text-error style='font-size:18px'>{welcome_new_cache_wizard_license}</p>";
}
if ($COUNT_DE_CACHES > 0) {
if ($COUNT_DE_MEMBERS > 15) {
if ($COUNT_DE_CACHES < 20000) {
$undersized_proxy_caches_explain = $tpl->_ENGINE_parse_body("{undersized_proxy_caches_explain}");
$COUNT_DE_CACHES_KB = $COUNT_DE_CACHES * 1024;
$COUNT_DE_CACHES_TEXT = FormatBytes($COUNT_DE_CACHES_KB);
$undersized_proxy_caches_explain = str_replace("%S", $COUNT_DE_CACHES_TEXT, $undersized_proxy_caches_explain);
$undersized_proxy_caches_explain = str_replace("%U", $COUNT_DE_MEMBERS, $undersized_proxy_caches_explain);
$error = $error . "<p class=text-error><strong>{undersized_proxy_caches}</strong><br>{$undersized_proxy_caches_explain}</p>";
}
}
}
$tr[] = "\n\t\t\t\n\t<table style='width:100%;border:1px solid #CCCCCC;margin:8px'>\n\t<tr>\n\t\t\t<td valign='top' style='width:410px'>\n\t\t\t<center style='width:410px;height:230px;padding-top:20px' {$curs}>\n\t\t\t\t<img src='img/{$main_icon}'>\n\t\t\t</center>\n\t\t\t\n\t\t\t</td>\n\t\t\t<td valign='top' style='width:99%;vertical-align:middle' nowrap>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/plus-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs}><span style='font-size:22px;text-decoration:underline;color:{$color}'>{new_cache}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/24-refresh.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs8}><span style='font-size:22px;text-decoration:underline'>{change_caches_type}</span></td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t<tr style='height:50px'><td colspan=2> </td></tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/arrow-right-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs7}><span style='font-size:22px;text-decoration:underline'>{display_details}</span></td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/arrow-right-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs6}><span style='font-size:22px;text-decoration:underline;color:{$color}'>{caches_center}</span></td>\n\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/arrow-right-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs4}><span style='font-size:22px;text-decoration:underline'>{reconstruct_caches}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/24-refresh.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs3}><span style='font-size:22px;text-decoration:underline'>{refresh}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t</table>\n\t\t\t\t\n\t\t\t</td>\n\t\t\t{$error}\n\t\t</tr>\n\t\t</table>\t\n\t";
$q = new mysql();
$sql = "SELECT * FROM squid_caches_center WHERE remove=0";
$results = $q->QUERY_SQL($sql, "artica_backup");
$SquidBoosterEnable = intval($sock->GET_INFO("SquidBoosterEnable"));
if ($SquidBoosterEnable == 1) {
$MAIN = $MAIN_CACHES["/var/squid/cache_booster"];
$MAX = $MAIN["MAX"];
$CURRENT = $MAIN["CURRENT"];
$FULL_SIZE = $MAIN["FULL_SIZE"];
$FULL_SIZE = FormatBytes($FULL_SIZE / 1024);
$cache_size = FormatBytes($cache_size * 1024);
$CURRENT_TEXT = FormatBytes($CURRENT);
$SquidBoosterMem = intval($sock->GET_INFO("SquidBoosterMem"));
$js[] = "Loadjs('{$page}?gengraph=yes&container=cache-booster¤t={$CURRENT}&max={$MAX}&name=CacheBooster');";
$tr[] = "<table style='width:100%;border:1px solid #CCCCCC;margin:8px'>\n\t\t<tr>\n\t\t<td valign='top' style='width:430px'>\n\t\t<div id='cache-booster' style='width:410px;height:250px'></div>\n\t\t</td>\n\t\t<td valign='top' style='width:99%'>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td valign='top' style='font-size:18px' class=legend>{size_on_disk}:</td>\n\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$FULL_SIZE}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td valign='top' style='font-size:18px' class=legend>{used}:</td>\n\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$CURRENT_TEXT}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top' style='font-size:18px' class=legend>{$defined_size}:</td>\n\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$SquidBoosterMem}MB</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top' style='font-size:18px' class=legend>{parameters}:</td>\n\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>" . texttooltip("{squid_booster}", "{squid_booster_text}", "GotoProxyBooster()") . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td colspan=2 align='right'>\n\t\t<table style='width:180px'>\n\t\t\n\t\t</table>\n\t\t</td>\n\t\t</table>\n\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t";
}
while ($ligne = mysql_fetch_assoc($results)) {
$cache_type = $ligne["cache_type"];
$cache_size = $ligne["cache_size"];
$cachename = $ligne["cachename"];
$ID = $ligne["ID"];
if ($cache_type == "Cachenull") {
continue;
}
if ($cache_type == "tmpfs") {
$ligne["cache_dir"] = "/home/squid/cache/MemBooster{$ID}";
}
$cachedir = $ligne["cache_dir"];
$MAIN = $MAIN_CACHES[$cachedir];
$MAX = $MAIN["MAX"];
$CURRENT = $MAIN["CURRENT"];
$FULL_SIZE = $MAIN["FULL_SIZE"];
$FULL_SIZE = FormatBytes($FULL_SIZE / 1024);
$cache_size = FormatBytes($cache_size * 1024);
$CURRENT_TEXT = FormatBytes($CURRENT);
$cachenameen = urlencode($cachename);
if (!is_numeric($CURRENT)) {
$CURRENT = 0;
}
if (!is_numeric($MAX)) {
$MAX = 0;
}
$enabled_text = null;
$remove = $ligne["remove"];
$delete_text = null;
if ($remove == 0) {
$js[] = "Loadjs('{$page}?gengraph=yes&container=cache-{$ID}¤t={$CURRENT}&max={$MAX}&name={$cachenameen}');";
$curs3 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\t\t\tOnMouseOut=\"this.style.cursor='auto'\"\n\t\t\tOnClick=\"javascript:Loadjs('squid.caches.center.php?delete-item-js=yes&ID={$ligne["ID"]}')\"";
$curs4 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\t\t\tOnMouseOut=\"this.style.cursor='auto'\"\n\t\t\tOnClick=\"javascript:Loadjs('squid.caches.center.php?delete-empty-js=yes&ID={$ligne["ID"]}')\"";
$delete_text = "\n\t\t\t<tr>\n\t\t\t\n\t\t\t\t<tr {$curs3}>\n\t\t\t\t\t<td width=32px'><img src='img/delete-32.png'></td>\n\t\t\t\t\t<td style='font-size:18px;text-decoration:underline'>{delete}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr {$curs4}>\n\t\t\t\t\t<td width=32px'><img src='img/dustbin-32.png'></td>\n\t\t\t\t\t<td style='font-size:18px;text-decoration:underline'>" . texttooltip("{purge}", "{purge_cache_explain}") . "</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t";
}
if ($ligne["enabled"] == 0) {
$enabled_text = "<tr>\n\t\t\t<td valign='top' style='font-size:18px' class=legend> </td>\n\t\t\t<td valign='top' style='font-size:18px' >{disabled}</td>\n\t\t\t</tr>";
}
$tr[] = "<table style='width:100%;border:1px solid #CCCCCC;margin:8px'>\n\t\t<tr>\n\t\t\t<td valign='top' style='width:430px'>\n\t\t\t<div id='cache-{$ID}' style='width:410px;height:250px'></div>\n\t\t\t</td>\n\t\t\t<td valign='top' style='width:99%'>\n\t\t\t\t<table style='width:100%'>{$enabled_text}\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{size_on_disk}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$FULL_SIZE}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{used}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$CURRENT_TEXT}</td>\n\t\t\t\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{$defined_size}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$cache_size}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=2 align='right'>\n\t\t\t\t\t\t\t<table style='width:180px'>\t\t\t\t\t\n\t\t\t\t\t\t\t{$delete_text}\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\t\n\t\t\t\t\n\t\t";
}
echo "\n\t<div style='font-size:45px;margin-bottom:20px;margin-top:10px'>" . $tpl->_ENGINE_parse_body('{your_proxy_caches}') . "</div>\t\t\n\t<div style='width:98%'>\n\t\t" . $tpl->_ENGINE_parse_body(CompileTr2($tr, true)) . "</div>\n\t<script>" . @implode("\n", $js) . "</script>";
}
示例13: rule
function rule(){
$ID=$_GET["ruleid"];
$q=new mysql_squid_builder();
$page=CurrentPageName();
$tpl=new templates();
if(!is_numeric($ID)){$ID=0;}
$t=time();
if($ID==0){
$title="{new_rule}";
$btname="{add}";
$ligne["enabled"]=1;
}else{
$sql="SELECT * FROM UsersAgentsDB WHERE ID='$ID'";
$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
if(!$q->ok){
$error="<p class='text-error'>$q->mysql_error.</p>";
}
$title="{rule}::$ID";
$btname="{apply}";
}
if($_GET["pattern"]<>null){
$ligne["pattern"]=$_GET["pattern"];
if($ID==0){
if(preg_match("#^(.+?)\/#", $ligne["pattern"],$re)){
$ligne["editor"]=$re[1];
$ligne["explain"]="Match {$re[1]} UserAgent";
$ligne["category"]="Personal";
}
if(preg_match("#(MacBook|Apple|iPad|iPhone)#", $ligne["pattern"])){$ligne["editor"]="Apple"; }
if(preg_match("#(Android)#i", $ligne["pattern"])){$ligne["editor"]="Android"; }
if(preg_match("#(CFNetwork)#i", $ligne["pattern"])){ $ligne["category"]="Smartphones"; }
if(preg_match("#(Microsoft)#i", $ligne["pattern"])){$ligne["editor"]="Microsoft"; }
}
$ligne["pattern"]="regex:".PatternToRegex($ligne["pattern"]);
}
$tr[]=Paragraphe_switch_img("{allow}", "{browser_allow_explain}","bypass-$t",$ligne["bypass"],null);
$tr[]=Paragraphe_switch_img("{no_webfilter}", "{no_webfilter_explain}","bypassWebF-$t",$ligne["bypassWebF"],null);
$tr[]=Paragraphe_switch_img("{no_cache}", "{no_cache_explain}","bypassWebC-$t",$ligne["bypassWebC"],null);
$tr[]=Paragraphe_switch_img("{deny}", "{deny_browser_explain}","deny-$t",$ligne["deny"],null);
$html="
<div style='font-size:22px;margin-bottom:20px'>$title</div>
<div style='width:98%' class=form>
<table style='width:100%'>
<tr>
<td class=legend style='font-size:18px'>{enabled}:</td>
<td>".Field_checkbox("enabled-$t",1,$ligne["enabled"],"EnabledCheck$t()")."</td>
</tr>
<tr>
<td class=legend style='font-size:18px'>{pattern}:</td>
<td>
<div class=text-info style='font-size:16px'>{browser_pattern_explain}</div>
<textarea style='margin-top:5px;font-family:Courier New; font-weight:bold;
width:99%;height:90px;border:5px solid #8E8E8E; overflow:auto;font-size:16px !important' id='pattern-$t'>{$ligne["pattern"]}</textarea></td>
</tr>
<tr>
<td class=legend style='font-size:18px'>{vendor}:</td>
<td>".Field_text("editor-$t",$ligne["editor"],"font-size:18px;width:500px")."</td>
</tr>
<tr>
<td class=legend style='font-size:18px'>{explain}:</td>
<td>".Field_text("explain-$t",$ligne["explain"],"font-size:18px;width:500px")."</td>
</tr>
<tr>
<td class=legend style='font-size:18px'>{category}:</td>
<td>".Field_text("category-$t",$ligne["category"],"font-size:18px;width:500px")."</td>
</tr>
<tr><td colspan=2 style='padding-top:20px;padding-left:20px'>". CompileTr2($tr)."</td></tr>
<tr><td colspan=2 style='text-align:right'><hr>". button("$btname","Save$t();","26px")."</td></tr>
</table>
</div>
<script>
var xSave$t= function (obj) {
var tempvalue=obj.responseText;
if(tempvalue.length>3){alert(tempvalue);return;};
var ID=$ID;
if(ID==0){YahooWinHide();}
$('#table-{$_GET["t"]}').flexReload();
}
function EnabledCheck$t(){
var enabled=0;
if(document.getElementById('enabled-$t').checked){ enabled=1;}
document.getElementById('pattern-$t').disabled=true;
document.getElementById('editor-$t').disabled=true;
document.getElementById('explain-$t').disabled=true;
document.getElementById('category-$t').disabled=true;
//.........这里部分代码省略.........
示例14: filters_for_node
function filters_for_node()
{
$tpl = new templates();
$page = CurrentPageName();
$hostid = $_GET["hostid"];
$sock = new sockets();
$uuid = $hostid;
$blackbox = new blackboxes($hostid);
$t = time();
$DnsFilterCentral = $blackbox->GET_SQUID_INFO('DnsFilterCentral');
$UfdbEnabledCentral = $blackbox->GET_SQUID_INFO('UfdbEnabledCentral');
$AntivirusEnabledCentral = $blackbox->GET_SQUID_INFO('AntivirusEnabledCentral');
$EnableMacAddressFilterCentral = $blackbox->GET_SQUID_INFO('EnableMacAddressFilterCentral');
$EnableKerbAuth = $blackbox->GET_SQUID_INFO('EnableKerbAuth');
$EnableKerbAuthCentral = $sock->GET_INFO($EnableKerbAuth);
if (!is_numeric($UfdbEnabledCentral)) {
$UfdbEnabledCentral = 1;
}
if (!is_numeric($AntivirusEnabledCentral)) {
$AntivirusEnabledCentral = 1;
}
if (!is_numeric($DnsFilterCentral)) {
$DnsFilterCentral = 0;
}
if ($UfdbEnabledCentral == 0) {
$DnsFilterCentral = 0;
}
if (!is_numeric($EnableKerbAuth)) {
$EnableKerbAuth = $EnableKerbAuthCentral;
}
if (!is_numeric($EnableMacAddressFilterCentral)) {
$EnableMacAddressFilterCentral = 1;
}
$tr[] = Paragraphe_switch_img("{enable_webfilter_engine}", "{enable_webfilter_engine_stats}", "UfdbEnabledCentral", $UfdbEnabledCentral, null, 400);
$tr[] = Paragraphe_switch_img("{activate_pdnsinufdb}", "{activate_pdnsinufdb_explain}", "DnsFilterCentral", $DnsFilterCentral, null, 400);
$tr[] = Paragraphe_switch_img("{enable_antivirus_checking}", "{enable_antivirus_checking_stats}", "AntivirusEnabledCentral", $AntivirusEnabledCentral, null, 400);
$tr[] = Paragraphe_switch_img("{enable_activedirectory}", "{enable_activedirectory_stats}", "EnableKerbAuth", $EnableKerbAuth, null, 400);
$tr[] = Paragraphe_switch_img("{enable_mac_squid_filters}", "{enable_mac_squid_filters_explain}", "EnableMacAddressFilterCentral", $EnableMacAddressFilterCentral, null, 400);
$table = CompileTr2($tr);
$html = "{$table}\n\t<div style='margin:5px;text-align:right'><hr>" . button("{apply}", "Save{$t}()", "18") . "</div>\n\t\n\t<script>\n\tvar X_Save{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\tRefreshTab('main_squid_quicklinks_tabs{$_GET["nodeid"]}');\n\t}\t\n\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\n\t\tif(document.getElementById('UfdbEnabledCentral')){\n\t\t\tXHR.appendData('UfdbEnabledCentral',document.getElementById('UfdbEnabledCentral').value);\n\t\t\tdocument.getElementById('img_UfdbEnabledCentral').src='img/wait_verybig.gif';\n\t\t\t\n\t\t}\n\t\t\n\t\tif(document.getElementById('DnsFilterCentral')){\n\t\t\tXHR.appendData('DnsFilterCentral',document.getElementById('DnsFilterCentral').value);\n\t\t\tdocument.getElementById('img_DnsFilterCentral').src='img/wait_verybig.gif';\n\t\t}\t\n\t\t\n\t\tif(document.getElementById('AntivirusEnabledCentral')){\n\t\t\tXHR.appendData('AntivirusEnabledCentral',document.getElementById('AntivirusEnabledCentral').value);\n\t\t\tdocument.getElementById('img_AntivirusEnabledCentral').src='img/wait_verybig.gif';\n\t\t}\n\t\t\n\t\tif(document.getElementById('EnableKerbAuth')){\n\t\t\tXHR.appendData('EnableKerbAuth',document.getElementById('EnableKerbAuth').value);\n\t\t\tdocument.getElementById('img_EnableKerbAuth').src='img/wait_verybig.gif';\n\t\t}\n\n\t\tif(document.getElementById('EnableMacAddressFilterCentral')){\n\t\t\tXHR.appendData('EnableMacAddressFilterCentral',document.getElementById('EnableMacAddressFilterCentral').value);\n\t\t\tdocument.getElementById('img_EnableMacAddressFilterCentral').src='img/wait_verybig.gif';\n\t\t}\t\t\t\n\t\t\n\t\tXHR.appendData('filters','{$uuid}');\t\n\t\tXHR.appendData('uuid','{$uuid}');\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',X_Save{$t});\t\n\t\t\n\t\n\t}\t\t\n\t\n\t</script>\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例15: main_switch_status
function main_switch_status()
{
$switch = $_GET["eth"];
$tpl = new templates();
$sock = new sockets();
$datas = $sock->getFrameWork("vde.php?switch-main-status={$switch}");
$ini = new Bs_IniHandler();
$ini->loadString($datas);
$f[] = DAEMON_STATUS_ROUND("VDE_{$switch}", $ini, null, 0);
$f[] = DAEMON_STATUS_ROUND("VDHOOK_{$switch}", $ini, null, 0);
$install = button("{install_virtual_switch}", "Loadjs('virtualswitch.install.php?switch={$switch}')", 30);
$html = "\n\t<div style='font-size:22px' class=explain>{vde_switch_explain}</div>\t\t\n\t<center style='margin:50px'>{$install}</center>\n\t" . CompileTr2($f);
echo $tpl->_ENGINE_parse_body($html);
}