本文整理汇总了PHP中Form_Button类的典型用法代码示例。如果您正苦于以下问题:PHP Form_Button类的具体用法?PHP Form_Button怎么用?PHP Form_Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Form_Button类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($submit = null)
{
if (!isset($submit)) {
$submit = gettext('Save');
}
if (gettype($submit) == 'string') {
$submit = new Form_Button('save', $submit, null, 'fa-save');
$submit->addClass('btn-primary');
}
if (false !== $submit) {
$this->addGlobal($submit);
}
if (!isset($this->_attributes['action'])) {
$this->_attributes['action'] = $_SERVER['REQUEST_URI'];
}
}
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:16,代码来源:Form.class.php
示例2: Form_Section
$section = new Form_Section('Domain override options');
$section->addInput(new Form_Input('host', 'Host', 'text', $pconfig['host']))->setHelp('Name of the host, without the domain part' . '<br />' . 'e.g.: "myhost"');
$section->addInput(new Form_Input('domain', 'Domain', 'text', $pconfig['domain']))->setHelp('Domain of the host' . '<br />' . 'e.g.: "example.com"');
$section->addInput(new Form_IpAddress('ip', 'IP Address', $pconfig['ip']))->setHelp('IP address of the host' . '<br />' . 'e.g.: 192.168.100.100 or fd00:abcd::1');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
if (isset($id) && $a_hosts[$id]) {
$section->addInput(new Form_Input('id', null, 'hidden', $pconfig['id']));
}
$form->add($section);
$section = new Form_Section('Additional names for this host');
if ($pconfig['aliases']['item']) {
$counter = 0;
$last = count($pconfig['aliases']['item']) - 1;
foreach ($pconfig['aliases']['item'] as $item) {
$group = new Form_Group(null);
$group->add(new Form_Input('aliashost' . $counter, null, 'text', $item['host']))->setHelp($counter == $last ? 'Host name' : null);
$group->add(new Form_Input('aliasdomain' . $counter, null, 'text', $item['domain']))->setHelp($counter == $last ? 'Value' : null);
$group->add(new Form_Input('aliasdescription' . $counter, null, 'text', $item['description']))->setHelp($counter == $last ? 'Description' : null);
$btn = new Form_Button('btn' . $counter, 'Delete', 'services_dnsmasq_edit.php?act=delopt' . '&id=' . $counter);
$btn->removeClass('btn-primary')->addClass('btn-danger btn-sm');
$group->add($btn);
$section->add($group);
$counter++;
}
}
$btnaddopt = new Form_Button('btnaddopt', 'Add Option', 'services_dnsmasq_edit.php?act=addopt');
$btnaddopt->removeClass('btn-primary')->addClass('btn-success btn-sm');
$section->addInput($btnaddopt);
$form->add($section);
print $form;
include "foot.inc";
开发者ID:dariomas,项目名称:pfsense,代码行数:31,代码来源:services_dnsmasq_edit.php
示例3: Form_StaticText
$btndyndns->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('Dynamic DNS', $btndyndns . ' ' . 'Show dynamic DNS settings'));
$section->addInput(new Form_Checkbox('ddnsupdate', 'DHCP Registration', 'Enable registration of DHCP client names in DNS.', $pconfig['ddnsupdate']));
$section->addInput(new Form_Input('ddnsdomain', 'DDNS Domain', 'text', $pconfig['ddnsdomain']))->setHelp('Leave blank to disable dynamic DNS registration. Enter the dynamic DNS domain which will be used to register client names in the DNS server.');
$section->addInput(new Form_IpAddress('ddnsdomainprimary', 'DDNS Server IP', $pconfig['ddnsdomainprimary']))->setHelp('Enter the primary domain name server IP address for the dynamic domain name.');
$section->addInput(new Form_Input('ddnsdomainkeyname', 'DDNS Domain Key name', 'text', $pconfig['ddnsdomainkeyname']))->setHelp('Enter the dynamic DNS domain key name which will be used to register client names in the DNS server.');
$section->addInput(new Form_Input('ddnsdomainkey', 'DDNS Domain Key secret', 'text', $pconfig['ddnsdomainkey']))->setHelp('Enter the dynamic DNS domain key secret which will be used to register client names in the DNS server.');
$btnntp = new Form_Button('btnntp', 'Advanced');
$btnntp->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('NTP servers', $btnntp . ' ' . 'Show NTP Configuration'));
$group = new Form_Group('NTP Servers');
$group->add(new Form_Input('ntp1', 'NTP Server 1', 'text', $pconfig['ntp1'], ['placeholder' => 'NTP 1']));
$group->add(new Form_Input('ntp2', 'NTP Server 2', 'text', $pconfig['ntp2'], ['placeholder' => 'NTP 2']));
$group->addClass('ntpclass');
$section->add($group);
$btntftp = new Form_Button('btntftp', 'Advanced');
$btntftp->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('TFTP servers', $btntftp . ' ' . 'Show TFTP Configuration'));
$section->addInput(new Form_Input('tftp', 'TFTP Server', 'text', $pconfig['tftp']))->setHelp('Leave blank to disable. Enter a full hostname or IP for the TFTP server.');
$form->add($section);
print $form;
?>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
function hideDDNS(hide) {
hideCheckbox('ddnsupdate', hide);
hideInput('ddnsdomain', hide);
hideInput('ddnsdomainprimary', hide);
开发者ID:sjourdois,项目名称:pfsense,代码行数:31,代码来源:services_dhcp_edit.php
示例4: array
if (isset($config['system']['lb_use_sticky'])) {
$tab_array[] = array(gettext("Source Tracking"), false, "diag_dump_states_sources.php");
}
$tab_array[] = array(gettext("Reset States"), false, "diag_resetstate.php");
display_top_tabs($tab_array);
// Start of tab content
$current_statecount = `pfctl -si | grep "current entries" | awk '{ print \$3 }'`;
require_once 'classes/Form.class.php';
$form = new Form(false);
$section = new Form_Section('State filter');
$section->addInput(new Form_Input('filter', 'Filter expression', 'text', $_POST['filter'], ['placeholder' => 'Simple filter such as 192.168, v6, icmp or ESTABLISHED']));
$filterbtn = new Form_Button('filterbtn', 'Filter', null);
$filterbtn->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('', $filterbtn));
if (isset($_POST['filter']) && (is_ipaddr($_POST['filter']) || is_subnet($_POST['filter']))) {
$killbtn = new Form_Button('killfilter', 'Kill States');
$killbtn->removeClass('btn-primary')->addClass('btn-danger btn-sm');
$section->addInput(new Form_StaticText('Kill filtered states', $killbtn))->setHelp('Remove all states to and from the filtered address');
}
$form->add($section);
print $form;
?>
<table class="table table-striped">
<thead>
<tr>
<th><?php
echo gettext("Int");
?>
</th>
<th><?php
echo gettext("Proto");
开发者ID:rstevens011,项目名称:pfsense,代码行数:31,代码来源:diag_dump_states.php
示例5: array
}
return $portlist;
}
$pgtitle = array(gettext("Interfaces"), gettext("Bridges"), gettext("Edit"));
$shortcut_section = "interfaces";
include "head.inc";
if ($input_errors) {
print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Bridge Configuration');
$memberslist = build_port_list($pconfig['members']);
$section->addInput(new Form_Select('members', 'Member Interfaces', $memberslist['selected'], $memberslist['list'], true))->setHelp('Interfaces participating in the bridge.');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']));
// Advanced Additional options
$btnadv = new Form_Button('btnadvopts', 'Display Advanced', null, 'fa-cog');
$btnadv->setAttribute('type', 'button')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText('Advanced Options', $btnadv));
$form->add($section);
$section = new Form_Section('Advanced Configuration');
$section->addClass('adnlopts');
$section->addInput(new Form_Input('maxaddr', 'Cache Size', 'text', $pconfig['maxaddr']))->setHelp('Set the size of the bridge address cache. The default is 2000 entries.');
$section->addInput(new Form_Input('timeout', 'Cache expire time', 'text', $pconfig['timeout']))->setHelp('Set the timeout of address cache entries to this number of seconds. If seconds is zero, then address cache entries will not be expired. The default is 1200 seconds.');
$spanlist = build_port_list($pconfig['span']);
$section->addInput(new Form_Select('span', 'Span Port', $spanlist['selected'], $spanlist['list'], true))->setHelp('Add the interface named by interface as a span port on the bridge. Span ports transmit a copy of every frame received by the bridge. ' . 'This is most useful for snooping a bridged network passively on another host connected to one of the span ports of the bridge. <br />' . '%sThe span interface cannot be part of the bridge member interfaces.%s', ['<strong>', '</strong>']);
$edgelist = build_port_list($pconfig['edge']);
$section->addInput(new Form_Select('edge', 'Edge Ports', $edgelist['selected'], $edgelist['list'], true))->setHelp('Set interface as an edge port. An edge port connects directly to end stations and cannot create bridging loops in the network; this allows it to transition straight to forwarding.');
$edgelist = build_port_list($pconfig['autoedge']);
$section->addInput(new Form_Select('autoedge', 'Auto Edge Ports', $edgelist['selected'], $edgelist['list'], true))->setHelp('Allow interface to automatically detect edge status. This is the default for all interfaces added to a bridge.' . '%sThis will disable the autoedge status of interfaces. %s', ['<strong>', '</strong>']);
$edgelist = build_port_list($pconfig['ptp']);
$section->addInput(new Form_Select('ptp', 'PTP Ports', $edgelist['selected'], $edgelist['list'], true))->setHelp('Set the interface as a point-to-point link. This is required for straight transitions to forwarding and should be enabled on a direct link to another RSTP-capable switch.');
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:interfaces_bridge_edit.php
示例6: print_info_box
}
if ($savemsg) {
print_info_box($savemsg, 'success');
}
$cols = 0;
$savevalue = gettext("Save");
if ($pkg['savetext'] != "") {
$savevalue = $pkg['savetext'];
}
$savehelp = "";
if ($pkg['savehelp'] != "") {
$savehelp = $pkg['savehelp'];
}
$grouping = false;
// Indicates the elements we are composing are part of a combined group
$savebutton = new Form_Button('submit', $savevalue);
if ($savehelp) {
$savebutton->setHelp($savehelp);
}
$form = new Form($savebutton);
$form->addGlobal(new Form_Input('xml', null, 'hidden', $xml));
/* If a package's XML has <advanced_options/> configured, then setup
* the section for the fields that have <advancedfield/> set.
* These fields will be placed below other fields in a separate area titled 'Advanced Features'.
* These advanced fields are not normally configured and generally left to default to 'default settings'.
*/
if ($pkg['advanced_options'] == "enabled") {
$advfield_count = 0;
$advanced = new Form_Section("Advanced Features");
$advanced->addClass('advancedoptions');
}
开发者ID:nwholloway,项目名称:pfsense,代码行数:31,代码来源:pkg_edit.php
示例7: str_replace
exit;
}
}
// Get the MAC address
$ip = $_SERVER['REMOTE_ADDR'];
$mymac = `/usr/sbin/arp -an | grep '('{$ip}')' | head -n 1 | cut -d" " -f4`;
$mymac = str_replace("\n", "", $mymac);
include "head.inc";
if ($input_errors) {
print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Edit MAC Address Rules');
$section->addInput(new Form_Select('action', 'Action', strtolower($pconfig['action']), array('pass' => gettext('Pass'), 'block' => gettext('Block'))))->setHelp('Choose what to do with packets coming from this MAC address.');
$macaddress = new Form_Input('mac', 'MAC Address', 'text', $pconfig['mac'], ['placeholder' => 'xx:xx:xx:xx:xx:xx']);
$btnmymac = new Form_Button('btnmymac', 'Copy My MAC', null, 'fa-clone');
$btnmymac->setAttribute('type', 'button')->removeClass('btn-primary')->addClass('btn-success btn-sm');
$group = new Form_Group('MAC Address');
$group->add($macaddress);
$group->add($btnmymac);
$group->setHelp('6 hex octets separated by colons');
$section->add($group);
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('A description may be entered here for administrative reference (not parsed)');
$section->addInput(new Form_Input('bw_up', 'Bandwidth up', 'text', $pconfig['bw_up']))->setHelp('Enter an upload limit to be enforced on this MAC in Kbit/s');
$section->addInput(new Form_Input('bw_down', 'Bandwidth down', 'text', $pconfig['bw_down']))->setHelp('Enter a download limit to be enforced on this MAC in Kbit/s');
$section->addInput(new Form_Input('zone', null, 'hidden', $cpzone));
if (isset($id) && $a_passthrumacs[$id]) {
$section->addInput(new Form_Input('id', null, 'hidden', $id));
}
if (isset($pconfig['username']) && $pconfig['username']) {
$section->addInput(new Form_Input('username', null, 'hidden', $pconfig['username']));
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:31,代码来源:services_captiveportal_mac_edit.php
示例8: foreach
foreach ($item as $ww) {
$wws = explode(":", $ww);
$user = $wws[0];
$passwd = base64_decode($wws[1]);
$ip = $wws[2];
$group = new Form_Group($counter == 0 ? 'User table' : null);
$group->addClass('repeatable');
$group->add(new Form_Input('username' . $counter, null, 'text', $user))->setHelp($numrows == $counter ? 'Username' : null);
$group->add(new Form_Input('password' . $counter, null, 'password', $passwd))->setHelp($numrows == $counter ? 'Password' : null);
$group->add(new Form_IpAddress('ip' . $counter, null, $ip))->setHelp($numrows == $counter ? 'IP Address' : null);
$group->add(new Form_Button('deleterow' . $counter, 'Delete', null, 'fa-trash'))->addClass('btn-warning');
$section->add($group);
$counter++;
}
}
$btnaddrow = new Form_Button('addrow', 'Add user', null, 'fa-plus');
$btnaddrow->addClass('btn-success');
$section->addInput(new Form_StaticText(null, ' ' . $btnaddrow));
// Hidden fields
if (isset($id)) {
$section->addInput(new Form_Input('id', null, 'hidden', htmlspecialchars($id, ENT_QUOTES | ENT_HTML401)));
}
if (isset($pconfig['pppoeid'])) {
$section->addInput(new Form_Input('pppoeid', null, 'hidden', $pconfig['pppoeid']));
}
$form->add($section);
print $form;
print_info_box(gettext('Don\'t forget to add a firewall rule to permit traffic from PPPoE clients.'));
?>
<script type="text/javascript">
//<![CDATA[
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:services_pppoe_edit.php
示例9: Form_Section
$section = new Form_Section('State Filter', 'secfilter', COLLAPSIBLE | SEC_OPEN);
$iflist = get_configured_interface_with_descr();
$iflist['lo0'] = "lo0";
$iflist['all'] = "all";
if (isset($_POST['interface'])) {
$ifselect = $_POST['interface'];
} else {
$ifselect = "all";
}
$section->addInput(new Form_Select('interface', 'Interface', $ifselect, $iflist));
$section->addInput(new Form_Input('filter', 'Filter expression', 'text', $_POST['filter'], ['placeholder' => 'Simple filter such as 192.168, v6, icmp or ESTABLISHED']));
$filterbtn = new Form_Button('filterbtn', 'Filter', null, 'fa-filter');
$filterbtn->addClass('btn-primary btn-sm');
$section->addInput(new Form_StaticText('', $filterbtn));
if (isset($_POST['filter']) && (is_ipaddr($_POST['filter']) || is_subnet($_POST['filter']))) {
$killbtn = new Form_Button('killfilter', 'Kill States', null, 'fa-trash');
$killbtn->addClass('btn-danger btn-sm');
$section->addInput(new Form_StaticText('Kill filtered states', $killbtn))->setHelp('Remove all states to and from the filtered address');
}
$form->add($section);
print $form;
?>
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?php
echo gettext("States");
?>
</h2></div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
<thead>
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:31,代码来源:diag_dump_states.php
示例10: Form_Select
$section->add($group);
$section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)));
$section->addInput(new Form_StaticText('', $btntest));
$form->add($section);
print $form;
// Logs
$form = new Form(false);
$btnview = new Form_Button('submit', 'View');
$section = new Form_Section('View Logs');
$section->addInput(new Form_Input('action', null, 'hidden', 'logs'));
$group = new Form_Group('Log type');
$group->add(new Form_Checkbox('type', null, 'Error', true, 'error'))->displayAsRadio();
$group->add(new Form_Checkbox('type', null, 'Self-test', false, 'selftest'))->displayAsRadio();
$section->add($group);
$section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)));
$section->addInput(new Form_StaticText('', $btnview));
$form->add($section);
print $form;
// Abort
$btnabort = new Form_Button('submit', 'Abort');
$btnabort->removeClass('btn-primary')->addClass('btn-danger');
$form = new Form(false);
$section = new Form_Section('Abort');
$section->addInput(new Form_Input('action', null, 'hidden', 'abort'));
$section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)));
$section->addInput(new Form_StaticText('', $btnabort));
$form->add($section);
print $form;
break;
}
include "foot.inc";
开发者ID:nwholloway,项目名称:pfsense,代码行数:31,代码来源:diag_smart.php
示例11: display_top_tabs
display_top_tabs($tab_array);
$form = new Form();
if (isset($groupid)) {
$form->addGlobal(new Form_Input('groupid', null, 'hidden', $groupid));
}
$section = new Form_Section('Add privileges for ' . $a_group['name']);
$priv_list = array_map(function ($p) {
return $p['name'];
}, $priv_list);
asort($priv_list, SORT_STRING | SORT_FLAG_CASE);
$section->addInput(new Form_Select('sysprivs', 'Assigned privileges', $a_group['priv'], build_priv_list(), true))->addClass('multiselect')->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.')->setAttribute('style', 'height:400px;');
$section->addInput(new Form_Input('filtertxt', 'Filter', 'text', null))->setHelp('Show only the choices containing this term');
$btnfilter = new Form_Button('btnfilter', 'Filter', null, 'fa-filter');
$btnfilter->addClass('btn btn-info');
$form->addGlobal($btnfilter);
$btnclear = new Form_Button('btnclear', 'Clear', null, 'fa-times');
$btnclear->addClass('btn btn-warning');
$form->addGlobal($btnclear);
$form->add($section);
print $form;
?>
<div class="panel panel-body alert-info col-sm-10 col-sm-offset-2" id="pdesc">Select a privilege from the list above for a description</div>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
<?php
// Build a list of privilege descriptions
if (is_array($priv_list)) {
$id = 0;
开发者ID:BillTheBest,项目名称:pfsense,代码行数:31,代码来源:system_groupmanager_addprivs.php
示例12: Form_Select
}
if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
$interfaces['pppoe'] = "PPPoE Server";
}
/* add ipsec interfaces */
if (ipsec_enabled() && have_ruleint_access("enc0")) {
$interfaces["enc0"] = "IPsec";
}
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
$interfaces["openvpn"] = "OpenVPN";
}
$section->addInput(new Form_Select('interface', 'Interface', $pconfig['interface'], $interfaces))->setHelp('Choose which interface this rule applies to. In most cases "WAN" is specified.');
$protocols = "TCP UDP TCP/UDP ICMP ESP AH GRE IPV6 IGMP PIM OSPF";
$section->addInput(new Form_Select('proto', 'Protocol', $pconfig['proto'], array_combine(explode(" ", strtolower($protocols)), explode(" ", $protocols))))->setHelp('Choose which protocol this rule should match. In most cases "TCP" is specified.');
$btnsrcadv = new Form_Button('srcadv', 'Advanced');
$btnsrcadv->removeClass('btn-primary')->addClass('btn-default');
$section->addInput(new Form_StaticText('Source', $btnsrcadv));
$group = new Form_Group('Source');
$group->addClass('srcadv');
$group->add(new Form_Checkbox('srcnot', 'Source not', 'Invert match.', $pconfig['srcnot']))->setWidth(2);
$group->add(new Form_Select('srctype', null, srctype_selected(), build_srctype_list()))->setHelp('Type');
$group->add(new Form_IpAddress('src', null, is_specialnet($pconfig['src']) ? '' : $pconfig['src']))->setPattern('[.a-zA-Z0-9_]+')->addMask('srcmask', $pconfig['srcmask'])->setHelp('Address/mask');
$section->add($group);
$portlist = array("" => 'Other', 'any' => 'Any');
foreach ($wkports as $wkport => $wkportdesc) {
$portlist[$wkport] = $wkportdesc;
}
$group = new Form_Group('Source port range');
$group->addClass('srcportrange');
$group->add(new Form_Select('srcbeginport', null, $pconfig['srcbeginport'], $portlist))->setHelp('From port');
开发者ID:ffdesousa,项目名称:pfsense,代码行数:31,代码来源:firewall_nat_edit.php
示例13: Form_StaticText
$section->addInput(new Form_StaticText('', $btntest));
$form->add($section);
print $form;
// Logs
$form = new Form(false);
$btnview = new Form_Button('submit', 'View', null, 'fa-file-text-o');
$btnview->addClass('btn-primary');
$btnview->setAttribute('id');
$section = new Form_Section('View Logs');
$section->addInput(new Form_Input('action', null, 'hidden', 'logs'))->setAttribute('id');
$group = new Form_Group('Log type');
$group->add(new Form_Checkbox('type', null, 'Error', true, 'error'))->displayAsRadio();
$group->add(new Form_Checkbox('type', null, 'Self-test', false, 'selftest'))->displayAsRadio();
$section->add($group);
$section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)))->setAttribute('id');
$section->addInput(new Form_StaticText('', $btnview));
$form->add($section);
print $form;
// Abort
$btnabort = new Form_Button('submit', 'Abort', null, 'fa-times');
$btnabort->addClass('btn-danger')->setAttribute('id');
$form = new Form(false);
$section = new Form_Section('Abort');
$section->addInput(new Form_Input('action', null, 'hidden', 'abort'))->setAttribute('id');
$section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)))->setAttribute('id');
$section->addInput(new Form_StaticText('', $btnabort));
$form->add($section);
print $form;
break;
}
include "foot.inc";
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:31,代码来源:diag_smart.php
示例14: array
$tab_array[] = array(gettext("Groups"), true, "system_groupmanager.php");
$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
$tab_array[] = array(gettext("Authentication Servers"), false, "system_authservers.php");
display_top_tabs($tab_array);
$form = new Form();
if (isset($groupid)) {
$form->addGlobal(new Form_Input('groupid', null, 'hidden', $groupid));
}
$section = new Form_Section('Add Privileges for ' . $a_group['name']);
$section->addInput(new Form_Select('sysprivs', 'Assigned privileges', $a_group['priv'], build_priv_list(), true))->addClass('multiselect')->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.');
$section->addInput(new Form_Select('shadow', 'Shadow', null, build_priv_list(), true))->addClass('shadowselect')->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.');
$section->addInput(new Form_Input('filtertxt', 'Filter', 'text', null))->setHelp('Show only the choices containing this term');
$btnfilter = new Form_Button('btnfilter', 'Filter', null, 'fa-filter');
$btnfilter->setAttribute('type', 'button')->addClass('btn btn-info');
$form->addGlobal($btnfilter);
$btnclear = new Form_Button('btnclear', 'Clear', null, 'fa-times');
$btnclear->setAttribute('type', 'button')->addClass('btn btn-warning');
$form->addGlobal($btnclear);
$form->add($section);
print $form;
?>
<div class="panel panel-body alert-info col-sm-10 col-sm-offset-2" id="pdesc"><?php
echo gettext("Select a privilege from the list above for a description");
?>
</div>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
<?php
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:31,代码来源:system_groupmanager_addprivs.php
示例15: gettext
?>
" />
<input name="sig_no" type="submit" class="btn btn-default" id="sig_no" value=" <?php
echo gettext("No");
?>
" />
</form>
<?php
} else {
// This is where the work gets done so Forms.classes will be used from this point
if (!is_subsystem_dirty('firmwarelock')) {
require_once 'classes/Form.class.php';
if (!is_subsystem_dirty('rebootreq')) {
// Provide a button to enable firmware upgrades. Upgrades should be disabled on initial page load
if (!is_subsystem_dirty('firmware') || !$_POST || $_POST['save']) {
$enablebtn = new Form_Button('Submit', 'Enable firmware upload');
$enablebtn->addClass('btn-warning');
$form = new Form($enablebtn);
$section = new Form_Section('Invoke ' . $g['product_name'] . ' Manual Upgrade');
$section->addInput(new Form_StaticText('Enable', 'Click the "Enable firmware upload" button below to begin.'));
} else {
// Upgrades are now enabled
$form = new Form('Disable firmware upload');
$form->setMultipartEncoding();
$section = new Form_Section('Perform ' . $g['product_name'] . ' Manual Upgrade');
if (!session_id()) {
$upload_id = uniqid();
} else {
$upload_id = session_id();
}
$section->addInput(new Form_Input('UPLOAD_IDENTIFIER', '', 'hidden', $upload_id));
开发者ID:dariomas,项目名称:pfsense,代码行数:31,代码来源:system_firmware.php
示例16: filter_form_vpn
function filter_form_vpn()
{
global $filter_active, $rawfilter, $filterfieldsarray, $filtertext, $filterlogentries_qty, $nentries, $Include_Act, $interfacefilter;
global $logfile;
global $system_logs_filter_form_hidden;
if ($filter_active) {
$panel_state = 'in';
$panel_body_state = SEC_OPEN;
} else {
if ($system_logs_filter_form_hidden) {
$panel_state = 'out';
$panel_body_state = SEC_OPEN;
} else {
$panel_state = 'in';
$panel_body_state = SEC_CLOSED;
}
}
if (!$rawfilter) {
// Advanced log filter form
$form = new Form(false);
$form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
$section = new Form_Section('Advanced Log Filter', 'filter-panel', COLLAPSIBLE | $panel_body_state);
if ($logfile == "vpn") {
$group = new Form_Group('');
$group->add(new Form_Input('filterlogentries_time', null, 'text', $filterfieldsarray['time']))->setWidth(3)->setHelp('Time');
$group->add(new Form_Input('filterlogentries_action', null, 'text', $filterfieldsarray['action']))->setWidth(3)->setHelp('Action');
$group->add(new Form_Input('filterlogentries_qty', null, 'number', $filterlogentries_qty, ['placeholder' => $nentries]))->setWidth(2)->setHelp('Quantity');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Input('filterlogentries_user', null, 'text', $filterfieldsarray['user']))->setWidth(3)->setHelp('User');
$group->add(new Form_Input('filterlogentries_ip_address', null, 'text', $filterfieldsarray['ip_address']))->setWidth(4)->setHelp('IP Address');
} else {
$group = new Form_Group('');
$group->add(new Form_Input('filterlogentries_time', null, 'text', $filterfieldsarray['time']))->setWidth(3)->setHelp('Time');
$group->add(new Form_Input('filterlogentries_type', null, 'text', $filterfieldsarray['type']))->setWidth(2)->setHelp('Type');
$group->add(new Form_Input('filterlogentries_pid', null, 'text', $filterfieldsarray['pid']))->setWidth(2)->setHelp('PID');
$group->add(new Form_Input('filterlogentries_qty', null, 'number', $filterlogentries_qty, ['placeholder' => $nentries]))->setWidth(2)->setHelp('Quantity');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Input('filterlogentries_message', null, 'text', $filterfieldsarray['message']))->setWidth(7)->setHelp('Log Message');
}
$btnsubmit = new Form_Button('filterlogentries_submit', ' ' . gettext('Apply Filter'), null, 'fa-filter');
} else {
// Simple log filter form
$form = new Form(false);
$form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
$section = new Form_Section('Log Filter', 'filter-panel', COLLAPSIBLE | $panel_body_state);
$group = new Form_Group('');
$group->add(new Form_Input('filtertext', null, 'text', $filtertext))->setWidth(6)->setHelp('Filter Expression');
$group->add(new Form_Input('filterlogentries_qty', null, 'number', $filterlogentries_qty, ['placeholder' => $nentries]))->setWidth(2)->setHelp('Quantity');
$btnsubmit = new Form_Button('filtersubmit', ' ' . gettext('Apply Filter'), null, 'fa-filter');
}
$btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
$group->add(new Form_StaticText('', $btnsubmit));
$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
$section->add($group);
$form->add($section);
print $form;
}
开发者ID:NextMagic,项目名称:pfsense,代码行数:59,代码来源:status_logs_vpn.php
示例17: Form_Select
$group->add(new Form_Select($type . 'endport', $name . ' port end', $pconfig[$type . 'endport'], $portValues))->setHelp('To');
$group->add(new Form_Input($type . 'endport_cust', null, 'text', isset($portValues[$pconfig[$type . 'endport']]) ? null : $pconfig[$type . 'endport']))->setHelp('Custom');
if ($type == 'src') {
$group->setHelp('Specify the source port or port range for this rule. This is ' . 'usually random and almost never equal to the destination port range (and ' . 'should usually be <b>any</b>). You can leave the "To" field ' . 'empty if you only want to filter a single port.');
} else {
$group->setHelp('Specify the destination port or port range for this rule. ' . 'You can leave the "To" field empty if you only want to filter a ' . 'single port.');
}
$group->addClass($type == 'src' ? 'srcprtr' : 'dstprtr');
$section->add($group);
$form->add($section);
}
$section = new Form_Section('Extra options');
$section->addInput(new Form_Checkbox('log', 'Log', 'Log packets that are handled by this rule', $pconfig['log']))->setHelp('Hint: the firewall has limited local log space. Don\'t turn on logging ' . 'for everything. If you want to do a lot of logging, consider using a remote ' . 'syslog server (see the <a href="status_logs_settings.php">Status: System logs: ' . 'Settings</a> page).');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference.');
$adv_open = is_aoadv_used($pconfig);
$btnadvanced = new Form_Button('toggle-advanced', 'Advanced options');
$btnadvanced->removeClass('btn-primary')->addClass('btn-default');
if (!$adv_open) {
$section->addInput(new Form_StaticText(null, $btnadvanced));
}
$form->add($section);
$section = new Form_Section('Advanced options');
$section->addClass('advanced-options');
$section->addInput(new Form_Select('os', 'Source OS', empty($pconfig['os']) ? '' : $pconfig['os'], ['' => gettext('Any')] + array_combine($ostypes, $ostypes)))->setHelp('Note: this only works for TCP rules. General OS choice matches all subtypes.');
$section->addInput(new Form_Select('dscp', 'Diffserv Code Point', $pconfig['dscp'], ["" => ''] + array_combine($firewall_rules_dscp_types, $firewall_rules_dscp_types)));
$section->addInput(new Form_Checkbox('allowopts', 'Allow IP options', 'Allow packets with IP options to pass. Otherwise they are blocked by ' . 'default. This is usually only seen with multicast traffic.', $pconfig['allowopts']));
$section->addInput(new Form_Checkbox('disablereplyto', 'Disable reply-to', 'Disable auto generated reply-to for this rule.', $pconfig['disablereplyto']));
$section->addInput(new Form_Input('tag', 'Tag', 'text', $pconfig['tag']))->setHelp('You can mark a packet matching this rule and use this mark to match ' . 'on other NAT/filter rules. It is called <b>Policy filtering</b>.');
$section->addInput(new Form_Input('tagged', 'Tagged', 'text', $pconfig['tagged']))->setHelp('You can match packet on a mark placed before on another rule.');
$section->addInput(new Form_Input('max', 'Max. states', 'number', $pconfig['max']))->setHelp('Maximum state entries this rule can create.');
$section->addInput(new Form_Input('max-src-nodes', 'Max. src nodes', 'number', $pconfig['max-src-nodes']))->setHelp('Maximum number of unique source hosts.');
开发者ID:gregecslo,项目名称:pfsense-1,代码行数:31,代码来源:firewall_rules_edit.php
示例18: Form_Checkbox
$section->addInput($egw);
$section->addInput(new Form_Checkbox('defaultgw', 'Default Gateway', 'This will select the above gateway as the default gateway', $pconfig['defaultgw']));
$section->addInput(new Form_Checkbox('monitor_disable', 'Gateway Monitoring', 'Disable Gateway Monitoring', $pconfig['monitor_disable']))->toggles('.toggle-monitor-ip')->setHelp('This will consider this gateway as always being up');
$group = new Form_Group('Monitor IP');
$group->addClass('toggle-monitor-ip', 'collapse');
if (!$pconfig['monitor_disable']) {
$group->addClass('in');
}
$group->add(new Form_Input('monitor', null, 'text', $pconfig['gateway'] == $pconfig['monitor'] ? '' : $pconfig['monitor']))->setHelp('Enter an alternative address here to be ' . 'used to monitor the link. This is used for the quality RRD graphs as well as the ' . 'load balancer entries. Use this if the gateway does not respond to ICMP echo ' . 'requests (pings).');
$section->add($group);
$section->addInput(new Form_Checkbox('force_down', 'Force state', 'Mark Gateway as Down', $pconfig['force_down']))->setHelp('This will force this gateway to be considered Down');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
// If any of the advanced options are non-default, we will not show the "Advanced" button
// and will display the advanced section
if (!(!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || !empty($pconfig['data_payload']) || isset($pconfig['weight']) && $pconfig['weight'] > 1 || isset($pconfig['interval']) && !($pconfig['interval'] == $dpinger_default['interval']) || isset($pconfig['loss_interval']) && !($pconfig['loss_interval'] == $dpinger_default['loss_interval']) || isset($pconfig['time_period']) && !($pconfig['time_period'] == $dpinger_default['time_period']) || isset($pconfig['alert_interval']) && !($pconfig['alert_interval'] == $dpinger_default['alert_interval']) || isset($pconfig['nonlocalgateway']) && $pconfig['nonlocalgateway'])) {
$btnadvanced = new Form_Button('toggle-advanced', 'Advanced options');
$advdflt = true;
$btnadvanced->toggles('.advanced-options')->setAttribute('type', 'button');
$btnadvanced->removeClass('btn-primary')->addClass('btn-default');
$section->addInput(new Form_StaticText(null, $btnadvanced));
}
$form->add($section);
$section = new Form_Section('Advanced');
if (isset($advdflt)) {
$section->addClass('collapse');
}
$section->addClass('advanced-options');
$section->addInput(new Form_Select('weight', 'Weight', $pconfig['weight'], array_combine(range(1, 30), range(1, 30))))->setHelp('Weight for this gateway when used in a Gateway Group.');
$section->addInput(new Form_Input('data_payload', 'Data Payload', 'number', $pconfig['data_payload'], ['placeholder' => $dpinger_default['data_payload']]))->setHelp('Define data payload to send on ICMP packets to gateway monitor IP.');
$group = new Form_Group('Latency thresholds');
$group->add(new Form_Input('latencylow', 'From', 'number', $pconfig['latencylow'], ['placeholder' => $dpinger_default['latencylow']]));
开发者ID:nwholloway,项目名称:pfsense,代码行数:31,代码来源:system_gateways_edit.php
示例19: foreach
foreach ($item as $ww) {
$wws = explode(":", $ww);
$user = $wws[0];
$passwd = base64_decode($wws[1]);
$ip = $wws[2];
$group = new Form_Group($counter == 0 ? 'User table' : null);
$group->addClass('repeatable');
$group->add(new Form_Input('username' . $counter, null, 'text', $user))->setHelp($numrows == $counter ? 'User name' : null);
$group->add(new Form_Input('password' . $counter, null, 'password', $passwd))->setHelp($numrows == $counter ? 'Password' : null);
$group->add(new Form_IpAddress('ip' . $counter, null, $ip))->setHelp($numrows == $counter ? 'IP Addr
|
请发表评论