本文整理汇总了PHP中boostrap_form::set_PROTO方法的典型用法代码示例。如果您正苦于以下问题:PHP boostrap_form::set_PROTO方法的具体用法?PHP boostrap_form::set_PROTO怎么用?PHP boostrap_form::set_PROTO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boostrap_form
的用法示例。
在下文中一共展示了boostrap_form::set_PROTO方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settings
function settings()
{
$tpl = new templates();
$page = CurrentPageName();
$sock = new sockets();
$t = time();
$EnablePDNS = $sock->GET_INFO("EnablePDNS");
$PDNSRestartIfUpToMB = $sock->GET_INFO("PDNSRestartIfUpToMB");
$DisablePowerDnsManagement = $sock->GET_INFO("DisablePowerDnsManagement");
$EnablePDNS = $sock->GET_INFO("EnablePDNS");
$PowerUseGreenSQL = $sock->GET_INFO("PowerUseGreenSQL");
$PowerDisableDisplayVersion = $sock->GET_INFO("PowerDisableDisplayVersion");
$PowerActHasMaster = $sock->GET_INFO("PowerActHasMaster");
$PowerDNSDNSSEC = $sock->GET_INFO("PowerDNSDNSSEC");
$PowerDNSDisableLDAP = $sock->GET_INFO("PowerDNSDisableLDAP");
$PowerChroot = $sock->GET_INFO("PowerChroot");
$PowerActAsSlave = $sock->GET_INFO("PowerActAsSlave");
$PowerDNSLogLevel = $sock->GET_INFO("PowerDNSLogLevel");
$PowerSkipCname = $sock->GET_INFO("PowerSkipCname");
if (!is_numeric($EnablePDNS)) {
$EnablePDNS = 0;
}
$PowerDNSMySQLEngine = 1;
if (!is_numeric($PowerActHasMaster)) {
$PowerActHasMaster = 0;
}
if (!is_numeric($PDNSRestartIfUpToMB)) {
$PDNSRestartIfUpToMB = 700;
}
if (!is_numeric($DisablePowerDnsManagement)) {
$DisablePowerDnsManagement = 0;
}
if (!is_numeric($PowerUseGreenSQL)) {
$PowerUseGreenSQL = 0;
}
if (!is_numeric($PowerDisableDisplayVersion)) {
$PowerDisableDisplayVersion = 0;
}
if (!is_numeric($PowerDNSDNSSEC)) {
$PowerDNSDNSSEC = 0;
}
if (!is_numeric($PowerDNSDisableLDAP)) {
$PowerDNSDisableLDAP = 1;
}
if (!is_numeric($PowerChroot)) {
$PowerChroot = 0;
}
if (!is_numeric($PowerActAsSlave)) {
$PowerActAsSlave = 0;
}
if (!is_numeric($PowerDNSLogLevel)) {
$PowerDNSLogLevel = 1;
}
if (!is_numeric($PowerSkipCname)) {
$PowerSkipCname = 0;
}
$PowerDNSMySQLType = $sock->GET_INFO("PowerDNSMySQLType");
$PowerDNSMySQLRemoteServer = $sock->GET_INFO("PowerDNSMySQLRemoteServer");
$PowerDNSMySQLRemotePort = $sock->GET_INFO("PowerDNSMySQLRemotePort");
$PowerDNSMySQLRemoteAdmin = $sock->GET_INFO("PowerDNSMySQLRemoteAdmin");
$PowerDNSMySQLRemotePassw = $sock->GET_INFO("PowerDNSMySQLRemotePassw");
if (!is_numeric($PowerDNSMySQLType)) {
$PowerDNSMySQLType = 1;
}
if (!is_numeric($PowerDNSMySQLRemotePort)) {
$PowerDNSMySQLRemotePort = 3306;
}
$PowerDNSMySQLTypeA[1] = "{main_mysql_server_2}";
$PowerDNSMySQLTypeA[2] = "{main_mysql_server_4}";
$PowerDNSMySQLTypeA[3] = "{main_mysql_server_5}";
for ($i = 0; $i < 10; $i++) {
$loglevels[$i] = $i;
}
$boot = new boostrap_form();
$boot->set_checkbox("EnablePDNS", "{EnablePDNS}", $EnablePDNS, array("ONDISABLE" => "{EnablePDNS_disable_text}"));
$boot->set_checkbox("DisablePowerDnsManagement", "{DisablePowerDnsManagement}", $DisablePowerDnsManagement);
$boot->set_checkbox("PowerActHasMaster", "{ActHasMaster}", $PowerActHasMaster);
$boot->set_checkbox("PowerActAsSlave", "{ActHasSlave}", $PowerActAsSlave);
$boot->set_checkbox("PowerDNSDNSSEC", "DNSSEC", $PowerDNSDNSSEC);
$boot->set_checkbox("PowerUseGreenSQL", "{useGreenSQL}", $PowerUseGreenSQL);
$boot->set_checkbox("PowerDisableDisplayVersion", "{DisableDisplayVersion}", $PowerDisableDisplayVersion);
$boot->set_checkbox("PowerChroot", "{chroot}", $PowerChroot);
$boot->set_list("PowerDNSLogLevel", "{log level}", $loglevels, $PowerDNSLogLevel);
$boot->set_field("PDNSRestartIfUpToMB", "{RestartServiceifReachMb}", $PDNSRestartIfUpToMB);
$boot->set_list("PowerDNSMySQLType", "{mysql_database}", $PowerDNSMySQLTypeA, $PowerDNSMySQLType);
$boot->set_field("PowerDNSMySQLRemoteServer", "{remote_mysql_server}", $PowerDNSMySQLRemoteServer);
$boot->set_field("PowerDNSMySQLRemotePort", "{mysql_server_port}", $PowerDNSMySQLRemotePort);
$boot->set_field("PowerDNSMySQLRemoteAdmin", "{mysql_admin}", $PowerDNSMySQLRemoteAdmin);
$boot->set_fieldpassword("PowerDNSMySQLRemotePassw", "{password}", $PowerDNSMySQLRemotePassw);
$boot->set_button("{apply}");
$boot->setAjaxPage("pdns.php");
$boot->set_PROTO("GET");
echo $tpl->_ENGINE_parse_body("<div class=text-info>{pdns_explain}</div>") . $boot->Compile();
}
示例2: nic_config
//.........这里部分代码省略.........
}
$eth = $_GET["nic"];
$BUTTON = true;
if (preg_match("#^tun#", $eth)) {
$BUTTON = false;
}
if (preg_match("#([a-z0-9]+)\\.[0-9]+#", $eth)) {
$BUTTON = false;
}
$nic = new system_nic($eth);
$users = new usersMenus();
if ($users->SNORT_INSTALLED) {
$EnableSnort = $sock->GET_INFO("EnableSnort");
if ($EnableSnort != 1) {
$jsSnort = "DisableSnortInterface();";
}
$snortInterfaces = unserialize(base64_decode($sock->GET_INFO("SnortNics")));
}
if (!$users->SNORT_INSTALLED) {
$jsSnort = "DisableSnortInterface();";
}
$button = "{apply}";
if ($_GET["button"] == "confirm") {
$button = "{button_i_confirm_nic}";
}
$q = new mysql();
if (!$q->FIELD_EXISTS("nics", "defaultroute", "artica_backup")) {
$q->QUERY_SQL("ALTER TABLE `nics` ADD `defaultroute` smallint(1) NOT NULL,ADD INDEX (`defaultroute`)", "artica_backup");
}
$results = $q->QUERY_SQL("SELECT ID,name FROM nics_bridge ORDER BY name", "artica_backup");
$bridges[null] = "{select}";
while ($ligne = mysql_fetch_assoc($results)) {
$bridges["br{$ligne["ID"]}"] = $ligne["name"];
}
$defaultroute_interface = null;
$defaultroute_field = false;
$sql = "SELECT Interface FROM `nics` WHERE defaultroute=1";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
if (!$q->ok) {
if (strpos("Unknown column", $q->mysql_error) > 1) {
$q->QUERY_SQL("ALTER TABLE `nics` ADD `defaultroute` smallint(1) NOT NULL,ADD INDEX (`defaultroute`)", "artica_backup");
if (!$q->ok) {
echo "<p class=text-error>Alter: {$q->mysql_error}</p>";
}
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
}
}
if (!$q->ok) {
echo "<p class=text-error>{$q->mysql_error}</p>";
}
if ($ligne["Interface"] == null) {
$defaultroute_field = true;
} else {
if (trim($ligne["Interface"]) == $eth) {
$defaultroute_field = true;
}
$defaultroute_interface = $ligne["Interface"];
}
$boot = new boostrap_form();
if ($defaultroute_interface != null) {
$defaultroute_interface_explain = $tpl->_ENGINE_parse_body("{defaultroute_interface_explain}");
$defaultroute_interface_explain = str_replace("%s", $defaultroute_interface, $defaultroute_interface_explain);
$boot->set_spacerexplain($defaultroute_interface_explain);
}
$boot->set_hidden("UseSnort", $snortInterfaces[$eth]);
$boot->set_hidden("noreboot", $_GET["noreboot"]);
$boot->set_hidden("save_nic", $eth);
$boot->set_checkbox("enabled", "{enabled}", $nic->enabled, array("DISABLEALL" => true));
$boot->set_checkbox("dhcp", "{use_dhcp}", $nic->dhcp);
$boot->set_field("IPADDR", "{tcp_address}", $nic->IPADDR, array("IPV4" => true));
$boot->set_field("NETMASK", "{netmask}", $nic->NETMASK, array("IPV4" => true));
$boot->set_field("GATEWAY", "{gateway}", $nic->GATEWAY, array("IPV4" => true));
$boot->set_field("DNS_1", "{primary_dns}", $nic->DNS1);
$boot->set_field("DNS_2", "{secondary_dns}", $nic->DNS2);
$boot->set_field("metric", "{metric}", $nic->metric);
if ($defaultroute_field) {
$boot->set_checkbox("defaultroute", "{default_route}", $nic->defaultroute);
} else {
$boot->set_hidden("defaultroute", 0);
}
$boot->set_checkbox("Bridged", "{attach_to_bridge}", $nic->Bridged, array("LINK" => "BridgedTo"));
$boot->set_list("BridgedTo", "{network_bridge}", $bridges, $nic->BridgedTo);
$boot->setAjaxPage("system.nic.edit.php");
$boot->set_RefreshSearchs();
if ($BUTTON) {
$boot->set_button("{apply}");
} else {
$boot->set_form_locked();
}
$boot->set_PROTO("GET");
if ($DisableNetworksManagement == 1) {
$boot->set_form_locked();
}
if (!$users->AsSystemAdministrator) {
$boot->set_form_locked();
}
$form = $boot->Compile();
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($form);
}