本文整理汇总了PHP中Form_Group::setHelp方法的典型用法代码示例。如果您正苦于以下问题:PHP Form_Group::setHelp方法的具体用法?PHP Form_Group::setHelp怎么用?PHP Form_Group::setHelp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form_Group
的用法示例。
在下文中一共展示了Form_Group::setHelp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: external
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.');
$section->addInput(new Form_IpAddress('external', 'External subnet IP', $pconfig['external']))->setHelp('Enter the external (usually on a WAN) subnet\'s starting address for the 1:1 mapping. ' . 'The subnet mask from the internal address below will be applied to this IP address.');
$group = new Form_Group('Internal IP');
$group->add(new Form_Checkbox('srcnot', null, 'Not', $pconfig['srcnot']))->setHelp('Invert the sense of the match.');
$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']))->addMask('srcmask', $pconfig['srcmask'], 31)->setHelp('Address/mask')->setPattern('[0-9, a-z, A-Z and .');
$group->setHelp('Enter the internal (LAN) subnet for the 1:1 mapping. ' . 'The subnet size specified for the internal subnet will be applied to the external subnet.');
$section->add($group);
$group = new Form_Group('Destination');
$group->add(new Form_Checkbox('dstnot', null, 'Not', $pconfig['dstnot']))->setHelp('Invert the sense of the match.');
$group->add(new Form_Select('dsttype', null, dsttype_selected(), build_dsttype_list()))->setHelp('Type');
$group->add(new Form_IpAddress('dst', null, is_specialnet($pconfig['dst']) ? '' : $pconfig['dst']))->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask')->setPattern('[0-9, a-z, A-Z and .');
$group->setHelp('The 1:1 mapping will only be used for connections to or from the specified destination. Hint: this is usually "Any".');
$section->add($group);
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
$section->addInput(new Form_Select('natreflection', 'NAT reflection', $pconfig['natreflection'], array('default' => 'Use system default', 'enable' => 'Enable', 'disable' => 'Disable')));
$form->add($section);
print $form;
?>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
// Disables the specified input element
function disableInput(id, disable) {
$('#' + id).prop("disabled", disable);
}
示例2: pathinfo
$csslist[$file] = pathinfo($file, PATHINFO_FILENAME);
}
}
if (!isset($pconfig['webguicss']) || !isset($csslist[$pconfig['webguicss']])) {
$pconfig['webguicss'] = "pfSense.css";
}
$section = new Form_Section('webConfigurator');
$section->addInput(new Form_Select('webguicss', 'Theme', $pconfig['webguicss'], $csslist))->setHelp(sprintf(gettext('Choose an alternative css file (if installed) to change the appearance of the webConfigurator. css files are located in /usr/local/www/css/%s'), '<span id="csstxt"></span>'));
$section->addInput(new Form_Select('webguifixedmenu', 'Top Navigation', $pconfig['webguifixedmenu'], ["" => gettext("Scrolls with page"), "fixed" => gettext("Fixed (Remains visible at top of page)")]))->setHelp("The fixed option is intended for large screens only.");
$section->addInput(new Form_Input('dashboardcolumns', 'Dashboard Columns', 'number', $pconfig['dashboardcolumns'], [min => 1, max => 4]));
$group = new Form_Group('Associated Panels Show/Hide');
$group->add(new Form_Checkbox('dashboardavailablewidgetspanel', null, 'Available Widgets', $pconfig['dashboardavailablewidgetspanel']))->setHelp('Show the Available Widgets panel on the Dashboard.');
$group->add(new Form_Checkbox('systemlogsfilterpanel', null, 'Log Filter', $pconfig['systemlogsfilterpanel']))->setHelp('Show the Log Filter panel in System Logs.');
$group->add(new Form_Checkbox('systemlogsmanagelogpanel', null, 'Manage Log', $pconfig['systemlogsmanagelogpanel']))->setHelp('Show the Manage Log panel in System Logs.');
$group->add(new Form_Checkbox('statusmonitoringsettingspanel', null, 'Monitoring Settings', $pconfig['statusmonitoringsettingspanel']))->setHelp('Show the Settings panel in Status Monitoring.');
$group->setHelp('These options allow certain panels to be automatically hidden on page load. A control is provided in the title bar to un-hide the panel.');
$section->add($group);
$section->addInput(new Form_Checkbox('webguileftcolumnhyper', 'Left Column Labels', 'Active', $pconfig['webguileftcolumnhyper']))->setHelp('If selected, clicking a label in the left column will select/toggle the first item of the group.');
$form->add($section);
print $form;
$csswarning = sprintf(gettext("%sUser-created themes are unsupported, use at your own risk."), "<br />");
?>
</div>
<script>
//<![CDATA[
events.push(function() {
function setThemeWarning() {
if ($('#webguicss').val().startsWith("pfSense")) {
$('#csstxt').html("").addClass("text-default");
示例3: isset
}
}
$section->addInput(new Form_Select('channel', 'Channel', $pconfig['channel'], $mode_list))->setHelp('Legend: wireless standards - channel # (frequency @ max TX power / TX power allowed in reg. domain)' . '<br />' . 'Not all channels may be supported by your card. Auto may override the wireless standard selected above.');
if (ANTENNAS) {
if (isset($wl_sysctl["{$wl_sysctl_prefix}.diversity"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.rxantenna"])) {
$group = new Form_Group('Antenna Settings');
if (isset($wl_sysctl["{$wl_sysctl_prefix}.diversity"])) {
$group->add(new Form_Select('diversity', null, isset($pconfig['diversity']) ? $pconfig['diversity'] : '', ['' => 'Default', '0' => 'Off', '1' => 'On']))->setHelp('Diversity');
}
if (isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"])) {
$group->add(new Form_Select('txantenna', null, isset($pconfig['txantenna']) ? $pconfig['txantenna'] : '', ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']))->setHelp('Transmit antenna');
}
if (isset($wl_sysctl["{$wl_sysctl_prefix}.rxantenna"])) {
$group->add(new Form_Select('rxantenna', null, isset($pconfig['rxantenna']) ? $pconfig['rxantenna'] : '', ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']))->setHelp('Receive antenna');
}
$group->setHelp('Note: The antenna numbers do not always match up with the labels on the card.');
$section->add($group);
}
}
if (isset($wl_sysctl["{$wl_sysctl_prefix}.slottime"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.acktimeout"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.ctstimeout"])) {
$section->addInput(new Form_Input('distance', 'Distance setting (meters)', 'test', $pconfig['distance']))->setHelp('This field can be used to tune ACK/CTS timers to fit the distance between AP and Client');
}
$form->add($section);
// Regulatory settings
$section = new Form_Section('Regulatory settings');
$domain_list = array("" => 'Default');
if (is_array($wl_regdomains)) {
foreach ($wl_regdomains as $wl_regdomain_key => $wl_regdomain) {
$domain_list[$wl_regdomains_attr[$wl_regdomain_key]['ID']] = $wl_regdomain['name'];
}
}
示例4: foreach
foreach ($config['system']['user'] as $user) {
if (is_array($pconfig['members']) && in_array($user['uid'], $pconfig['members'])) {
$usersGroups[$user['uid']] = $user['name'];
// Add it to the user's list
} else {
$systemGroups[$user['uid']] = $user['name'];
// Add it to the 'not a member of' list
}
}
$group->add(new Form_Select('notmembers', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $systemGroups, true))->setHelp('Not members');
$group->add(new Form_Select('members', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $usersGroups, true))->setHelp('Members');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Button('movetoenabled', 'Move to "Members" >'))->removeClass('btn-primary')->addClass('btn-default btn-sm');
$group->add(new Form_Button('movetodisabled', '< Move to "Not members'))->removeClass('btn-primary')->addClass('btn-default btn-sm');
$group->setHelp('Hold down CTRL (pc)/COMMAND (mac) key to select multiple items');
$section->add($group);
}
if ($_GET['act'] != "new") {
$section = new Form_Section('Assigned Privileges');
$section->addInput(new Form_StaticText(null, build_priv_table()));
$form->add($section);
}
print $form;
?>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
// Select every option in the specified multiselect
function AllServers(id, selectAll) {
示例5: array
$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
display_top_tabs($tab_array);
?>
<div id="container"><?php
$form = new Form();
$section = new Form_Section('Firewall Advanced');
$section->addInput(new Form_Checkbox('scrubnodf', 'IP Do-Not-Fragment compatibility', 'Clear invalid DF bits instead of dropping the packets', isset($config['system']['scrubnodf'])))->setHelp('This allows for communications with hosts that generate fragmented ' . 'packets with the don\'t fragment (DF) bit set. Linux NFS is known to do this. ' . 'This will cause the filter to not drop such packets but instead clear the don\'t ' . 'fragment bit.');
$section->addInput(new Form_Checkbox('scrubrnid', 'IP Random id generation', 'Insert a stronger ID into IP header of packets passing through the filter.', isset($config['system']['scrubrnid'])))->setHelp('Replaces the IP identification field of packets with random values to ' . 'compensate for operating systems that use predictable values. This option only ' . 'applies to packets that are not fragmented after the optional packet ' . 'reassembly.');
$section->addInput($input = new Form_Select('optimization', 'Firewall Optimization Options', $config['system']['optimization'], array('normal' => 'Normal', 'high-latency' => gettext('High-latency'), 'aggressive' => gettext('Aggressive'), 'conservative' => gettext('Conservative'))))->setHelp('Select the type of state table optimization to use');
$section->addInput(new Form_Checkbox('disablefilter', 'Disable Firewall', 'Disable all packet filtering.', isset($config['system']['disablefilter'])))->setHelp('Note: This converts %s into a routing only platform!<br/>' . 'Note: This will also turn off NAT! To only disable NAT, ' . 'and not firewall rules, visit the <a href="firewall_nat_out.php">Outbound ' . 'NAT</a> page.', [$g["product_name"]]);
$section->addInput(new Form_Checkbox('disablescrub', 'Disable Firewall Scrub', 'Disables the PF scrubbing option which can sometimes interfere with NFS traffic.', isset($config['system']['disablescrub'])));
$group = new Form_Group('Firewall Adaptive Timeouts');
$group->add(new Form_Input('adaptivestart', 'Adaptive start', 'number', $pconfig['adaptivestart'], ['min' => 1]))->setHelp('When the number of state entries exceeds this value, adaptive ' . 'scaling begins. All timeout values are scaled linearly with factor ' . '(adaptive.end - number of states) / (adaptive.end - adaptive.start).');
$group->add(new Form_Input('adaptiveend', 'Adaptive end', 'number', $pconfig['adaptiveend'], ['min' => 1]))->setHelp('When reaching this number of state entries, all timeout values ' . 'become zero, effectively purging all state entries immediately. This ' . 'value is used to define the scale factor, it should not actually be ' . 'reached (set a lower state limit, see below).');
$group->setHelp('Timeouts for states can be scaled adaptively as the number of ' . 'state table entries grows. Leave blank for the default (0)');
$section->add($group);
$section->addInput(new Form_Input('maximumstates', 'Firewall Maximum States', 'number', $pconfig['maximumstates'], ['min' => 1, 'placeholder' => pfsense_default_state_size()]))->setHelp('Maximum number of connections to hold in the firewall state table. ' . '<br/>Note: Leave this blank for the default. On this system the default ' . 'size is: %d', [pfsense_default_state_size()]);
$section->addInput(new Form_Input('maximumtableentries', 'Firewall Maximum Table Entries', 'text', $pconfig['maximumtableentries'], ['placeholder' => pfsense_default_table_entries_size()]))->setHelp('Maximum number of table entries for systems such as aliases, ' . 'sshlockout, snort, etc, combined.<br/>Note: Leave this blank for the ' . 'default. On this system the default size is: %d', [pfsense_default_table_entries_size()]);
$section->addInput(new Form_Input('maximumfrags', 'Firewall Maximum Fragment Entries', 'text', $pconfig['maximumfrags']))->setHelp('Maximum number of packet fragments to hold for reassembly by scrub rules. Leave this blank for the default (5000)');
$section->addInput(new Form_Checkbox('bypassstaticroutes', 'Static route filtering', 'Bypass firewall rules for traffic on the same interface', $pconfig['bypassstaticroutes']))->setHelp('This option only applies if one or more static routes have been defined. ' . 'If it is enabled, traffic that enters and leaves through the same ' . 'interface will not be checked by the firewall. This may be desirable in some ' . 'situations where multiple subnets are connected to the same interface.');
$section->addInput(new Form_Checkbox('disablevpnrules', 'Disable Auto-added VPN rules', 'Disable all auto-added VPN rules.', isset($config['system']['disablevpnrules'])))->setHelp('Note: This disables automatically added rules for IPsec.');
$section->addInput(new Form_Checkbox('disablereplyto', 'Disable reply-to', 'Disable reply-to on WAN rules', $pconfig['disablereplyto']))->setHelp('With Multi-WAN it is generally desired to ensure traffic leaves the same ' . 'interface it arrives on, hence reply-to is added automatically by default. When ' . 'using bridging, this behavior must be disabled if the WAN gateway IP is ' . 'different from the gateway IP of the hosts behind the bridged interface.');
$section->addInput(new Form_Checkbox('disablenegate', 'Disable Negate rules', 'Disable Negate rule on policy routing rules', $pconfig['disablenegate']))->setHelp('With Multi-WAN it is generally desired to ensure traffic reaches directly ' . 'connected networks and VPN networks when using policy routing. This can be disabled ' . 'for special purposes but it requires manually creating rules for these networks.');
$section->addInput(new Form_Input('aliasesresolveinterval', 'Aliases Hostnames Resolve Interval', 'text', $pconfig['aliasesresolveinterval'], ['placeholder' => '300']))->setHelp('Interval, in seconds, that will be used to resolve hostnames ' . 'configured on aliases. <br/>Note: Leave this blank for the default ' . '(300s).');
$section->addInput(new Form_Checkbox('checkaliasesurlcert', 'Check certificate of aliases URLs', 'Verify HTTPS certificates when downloading alias URLs', $pconfig['checkaliasesurlcert']))->setHelp('Make sure the certificate is valid for all HTTPS addresses on ' . 'aliases. If it\'s not valid or is revoked, do not download it.');
$form->add($section);
$section = new Form_Section('Bogon Networks');
$section->addInput(new Form_Select('bogonsinterval', 'Update Frequency', empty($pconfig['bogonsinterval']) ? 'monthly' : $pconfig['bogonsinterval'], array('monthly' => gettext('Monthly'), 'weekly' => gettext('Weekly'), 'daily' => gettext('Daily'))))->setHelp('The frequency of updating the lists of IP addresses that are ' . 'reserved (but not RFC 1918) or not yet assigned by IANA.');
$form->add($section);
if (count($config['interfaces']) > 1) {
示例6: gettext
$group->add(new Form_Select('period', 'Period', $curperiod, $periods))->setHelp('Period');
if ($curcat == 'custom') {
$group->setHelp('Any changes to these option may not take affect until the next auto-refresh.');
}
$section->add($group);
if ($curcat == 'custom') {
$section->addInput(new Form_Input('cat', null, 'hidden', 'custom'));
$tz = date_default_timezone_get();
$tz_msg = gettext("Enter date and/or time. Current timezone:") . " {$tz}";
$start_fmt = strftime("%m/%d/%Y %H:%M:%S", $start);
$end_fmt = strftime("%m/%d/%Y %H:%M:%S", $end);
$group = new Form_Group('');
$group->add(new Form_Input('start', 'Start', 'datetime', $start_fmt))->setHelp('Start');
$group->add(new Form_Input('end', 'End', 'datetime', $end_fmt))->setHelp('End');
if ($curcat != 'custom') {
$group->setHelp('Any changes to these option may not take affect until the next auto-refresh');
}
$section->add($group);
$form->add($section);
print $form;
$curdatabase = $curoption;
$graph = "custom-{$curdatabase}";
if (in_array($curdatabase, $custom_databases)) {
$id = "{$graph}-{$curoption}-{$curdatabase}";
$id = preg_replace('/\\./', '_', $id);
?>
<div class="panel panel-default">
<img align="center" name="<?php
echo $id;
?>
" id="<?php
示例7: array
if ($multiwan) {
$options = array('none' => 'none');
foreach ($arr_gateways as $gwname => $gwitem) {
if (is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv6($gwitem['gateway'])) {
continue;
}
if (is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv4($gwitem['gateway'])) {
continue;
}
$options[$gwname] = $gwname . ' - ' . $gwitem['friendlyiface'] . ' - ' . $gwitem['gateway'];
}
$group->add(new Form_Select('dns' . $i . 'gw', null, $pconfig['dns' . $i . 'gw'], $options))->setHelp($i == 4 ? 'Gateway' : null);
$help .= '<br/>' . "In addition, optionally select the gateway for each DNS server. " . "When using multiple WAN connections there should be at least one unique DNS server per gateway.";
}
if ($i == 4) {
$group->setHelp($help);
}
$section->add($group);
}
$section->addInput(new Form_Checkbox('dnsallowoverride', 'DNS server override', 'Allow DNS server list to be overridden by DHCP/PPP on WAN', $pconfig['dnsallowoverride']))->setHelp(sprintf(gettext('If this option is set, %s will use DNS servers' . 'assigned by a DHCP/PPP server on WAN for its own purposes (including ' . 'the DNS forwarder). However, they will not be assigned to DHCP and PPTP ' . 'VPN clients.'), $g['product_name']));
$section->addInput(new Form_Checkbox('dnslocalhost', 'Disable DNS forwarder', 'Do not use the DNS Forwarder as a DNS server for the firewall', $pconfig['dnslocalhost']))->setHelp('By default localhost (127.0.0.1) will be used as the first DNS' . 'server where the DNS Forwarder or DNS Resolver is enabled and set to ' . 'listen on Localhost, so system can use the local DNS service to perform' . 'lookups. Checking this box omits localhost from the list of DNS servers.');
$form->add($section);
$section = new Form_Section('Localization');
$section->addInput(new Form_Select('timezone', 'Timezone', $pconfig['timezone'], array_combine($timezonelist, $timezonelist)))->setHelp('Select the location closest to you');
$section->addInput(new Form_Input('timeservers', 'Timeservers', 'text', $pconfig['timeservers']))->setHelp('Use a space to separate multiple hosts (only one required). ' . 'Remember to set up at least one DNS server if you enter a host name here!');
$section->addInput(new Form_Select('language', 'Language', $pconfig['language'], get_locale_list()))->setHelp('Choose a language for the webConfigurator');
$form->add($section);
$csslist = array();
$css = glob("/usr/local/www/bootstrap/css/*.css");
foreach ($css as $file) {
$file = basename($file);
示例8: array
$group->add($f2);
$section->add($group);
$f1 = new Form_Input('prefix_from', null, 'text', $pconfig['prefix_from']);
$f1->setHelp('To');
$f2 = new Form_Input('prefix_to', null, 'text', $pconfig['prefix_to']);
$f2->setHelp('From');
$group = new Form_Group('Prefix Delegation Range');
$group->add($f1);
$group->add($f2);
$section->add($group);
$section->addInput(new Form_Select('prefixrange_length', 'Prefix Delegation Size', $pconfig['prefixrange_length'], array('48' => '48', '52' => '52', '56' => '56', '60' => '60', '62' => '62', '63' => '63', '64' => '64')))->setHelp('You can define a Prefix range here for DHCP Prefix Delegation. This allows for assigning networks to subrouters. The start and end of the range must end on boundaries of the prefix delegation size.');
$group = new Form_Group('DNS Servers');
for ($i = 1; $i <= 4; $i++) {
$group->add(new Form_input('dns' . $i, null, 'text', $pconfig['dns' . $i]))->setHelp('DNS ' . $i);
}
$group->setHelp('Leave blank to use the system default DNS servers,this interface\'s IP if DNS forwarder is enabled, or the servers configured on the "General" page.');
$section->add($group);
$section->addInput(new Form_Input('domain', 'Domain Name', 'text', $pconfig['domain']))->setHelp('The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here. ');
$section->addInput(new Form_Input('domainsearchlist', 'Domain search list', 'text', $pconfig['domainsearchlist']))->setHelp('The DHCP server can optionally provide a domain search list. Use the semicolon character as separator');
$section->addInput(new Form_Input('deftime', 'Default lease time', 'text', $pconfig['deftime']))->setHelp('Seconds . Used for clients that do not ask for a specific expiration time. ' . ' <br />' . 'The default is 7200 seconds.');
$section->addInput(new Form_Input('maxtime', 'Max lease time', 'text', $pconfig['maxtime']))->setHelp('Maximum lease time for clients that ask for a specific expiration time.' . ' <br />' . 'The default is 86400 seconds.');
$section->addInput(new Form_Checkbox('dhcpv6leaseinlocaltime', 'Time Format Change', 'Change DHCPv6 display lease time from UTC to local time', $pconfig['dhcpv6leaseinlocaltime']))->setHelp('By default DHCPv6 leases are displayed in UTC time. ' . 'By checking this box DHCPv6 lease time will be displayed in local time and set to time zone selected. ' . 'This will be used for all DHCPv6 interfaces lease time.');
$btndyndns = new Form_Button('btndyndns', 'Advanced');
$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');
示例9: Form
$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;
// Tests
$form = new Form(false);
$btntest = new Form_Button('submit', 'Test');
$section = new Form_Section('Perform self-tests');
$section->addInput(new Form_Input('action', null, 'hidden', 'test'));
$group = new Form_Group('Test type');
$group->add(new Form_Checkbox('testType', null, 'Offline', false, 'offline'))->displayAsRadio();
$group->add(new Form_Checkbox('testType', null, 'Short', true, 'short'))->displayAsRadio();
$group->add(new Form_Checkbox('testType', null, 'Long', false, 'long'))->displayAsRadio();
$group->add(new Form_Checkbox('testType', null, 'Conveyance', false, 'conveyance'))->displayAsRadio();
$group->setHelp('Select "Conveyance" for ATA disks only');
$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)));
示例10: delay
$group->setHelp('Low and high thresholds for latency in milliseconds.
Default is %d/%d.', [$apinger_default['latencylow'], $apinger_default['latencyhigh']]);
$section->add($group);
$group = new Form_Group('Packet Loss thresholds');
$group->add(new Form_Input('losslow', 'From', 'number', $pconfig['losslow'], ['placeholder' => $apinger_default['losslow']]));
$group->add(new Form_Input('losshigh', 'To', 'number', $pconfig['losshigh'], ['placeholder' => $apinger_default['losshigh']]));
$group->setHelp('Low and high thresholds for packet loss in milliseconds.
Default is %d/%d.', [$apinger_default['losslow'], $apinger_default['losshigh']]);
$section->add($group);
$section->addInput(new Form_Input('interval', 'Probe Interval', 'number', $pconfig['interval'], ['placeholder' => $apinger_default['interval'], 'max' => 86400]))->setHelp('How often an ICMP probe will be sent in seconds. Default is %d.' . 'NOTE: The quality graph is averaged over seconds, not intervals, so as ' . 'the probe interval is increased the accuracy of the quality graph is ' . 'decreased.', [$apinger_default['interval']]);
$section->addInput(new Form_Input('down', 'Down', 'number', $pconfig['down'], ['placeholder' => $apinger_default['down']]))->setHelp('The number of seconds of failed probes before the alarm ' . 'will fire. Default is %d.', [$apinger_default['down']]);
$group = new Form_Group('Avg. Delay Replies Qty');
$group->add(new Form_Input('avg_delay_samples', null, 'number', $pconfig['avg_delay_samples'], ['placeholder' => $apinger_default['avg_delay_samples'], 'max' => 100]));
$group->add(new Form_Checkbox('avg_delay_samples_calculated', null, 'Use calculated value.', $pconfig['avg_delay_samples_calculated']));
$group->setHelp('How many replies should be used to compute average delay for ' . 'controlling "delay" alarms? Default is %d.', [$apinger_default['avg_delay_samples']]);
$section->add($group);
$group = new Form_Group('Avg. Packet Loss Probes');
$group->add(new Form_Input('avg_loss_samples', null, 'number', $pconfig['avg_loss_samples'], ['placeholder' => $apinger_default['avg_loss_samples'], 'max' => 1000]));
$group->add(new Form_Checkbox('avg_loss_samples_calculated', null, 'Use calculated value.', $pconfig['avg_loss_samples_calculated']));
$group->setHelp('How many probes should be useds to compute average packet loss? ' . 'Default is %d.', [$apinger_default['avg_loss_samples']]);
$section->add($group);
$group = new Form_Group('Lost Probe Delay');
$group->add(new Form_Input('avg_loss_delay_samples', null, 'number', $pconfig['avg_loss_delay_samples'], ['placeholder' => $apinger_default['avg_loss_delay_samples'], 'max' => 200]));
$group->add(new Form_Checkbox('avg_loss_delay_samples_calculated', null, 'Use calculated value.', $pconfig['avg_loss_samples_calculated']));
$group->setHelp('The delay (in qty of probe samples) after which loss is ' . 'computed. Without this, delays longer than the probe interval would be ' . 'treated as packet loss. Default is %d.', [$apinger_default['avg_loss_delay_samples']]);
$section->add($group);
$section->addInput(new Form_StaticText('Additional information', '<span class="help-block">' . gettext('The probe interval must be less than the down time, otherwise the ' . 'gateway will seem to go down then come up again at the next probe.') . '<br/><br/>' . gettext('The down time defines the length of time before the gateway is marked ' . 'as down, but the accuracy is controlled by the probe interval. For example, ' . 'if your down time is 40 seconds but on a 30 second probe interval, only one ' . 'probe would have to fail before the gateway is marked down at the 40 second ' . 'mark. By default, the gateway is considered down after 10 seconds, and the ' . 'probe interval is 1 second, so 10 probes would have to fail before the gateway ' . 'is marked down.') . '</span>'));
$section->addInput(new Form_Checkbox('nonlocalgateway', 'Use non-local gateway', 'Use non-local gateway through interface specific route.', $pconfig['nonlocalgateway']))->setHelp('This will allow use of a gateway outside of this interface\'s subnet. This is usually indicative of a configuration error, but is required for some scenarios.');
$form->add($section);
print $form;
include "foot.inc";
示例11: setting
$section->add($group);
$group = new Form_Group('GUI Log Entries');
# Use the general logging options setting (global) as placeholder.
$group->add(new Form_Input('nentries', 'GUI Log Entries', 'number', $pconfig['nentries'], ['placeholder' => $config['syslog']['nentries']]))->setWidth(2);
$group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.');
$section->add($group);
$group = new Form_Group('Log file size (Bytes)');
# Use the general logging options setting (global) as placeholder.
$group->add(new Form_Input('logfilesize', 'Log file size (Bytes)', 'number', $pconfig['logfilesize'], ['placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"]))->setWidth(2);
$group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." . '<br /><br />' . "NOTE: The log size is changed the next time it is cleared. To immediately change the log size, first save the options to set the size, then clear the log using the \"Clear Log\" action below. ");
$section->add($group);
$group = new Form_Group('Formatted/Raw Display');
$group->add(new Form_Checkbox('format', null, 'Formatted', $pconfig['format'] == 'formatted' ? true : false, 'formatted'))->displayAsRadio();
$group->add(new Form_Checkbox('format', null, 'Raw', $pconfig['format'] == 'raw' ? true : false, 'raw'))->displayAsRadio();
$group->add(new Form_Checkbox('format', null, 'General Logging Options Setting', $pconfig['format'] == '' ? true : false, ''))->displayAsRadio();
$group->setHelp('Show the log entries as formatted or raw output as generated by the service. The raw output will reveal more detailed information, but it is more difficult to read.');
$section->add($group);
# System General (main) Specific
if ($logfile == 'system') {
$section->addInput(new Form_Checkbox('loglighttpd', 'Web Server Log', 'Log errors from the web server process', $pconfig['loglighttpd']))->setHelp('If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the system log.');
}
# Firewall Specific
if ($logfile == 'filter') {
$section->addInput(new Form_Checkbox('logdefaultblock', 'Log firewall default blocks', 'Log packets matched from the default block rules in the ruleset', $pconfig['logdefaultblock']))->setHelp('Packets that are blocked by the implicit default block rule will not be logged if this option is unchecked. Per-rule logging options are still respected.');
$section->addInput(new Form_Checkbox('logdefaultpass', null, 'Log packets matched from the default pass rules put in the ruleset', $pconfig['logdefaultpass']))->setHelp('Packets that are allowed by the implicit default pass rule will be logged if this option is checked. Per-rule logging options are still respected. ');
$section->addInput(new Form_Checkbox('logbogons', null, 'Log packets blocked by \'Block Bogon Networks\' rules', $pconfig['logbogons']));
$section->addInput(new Form_Checkbox('logprivatenets', null, 'Log packets blocked by \'Block Private Networks\' rules', $pconfig['logprivatenets']));
$section->addInput(new Form_Select('filterdescriptions', 'Where to show rule descriptions', !isset($pconfig['filterdescriptions']) ? '0' : $pconfig['filterdescriptions'], array('0' => 'Dont load descriptions', '1' => 'Display as column', '2' => 'Display as second row')))->setHelp('Show the applied rule description below or in the firewall log rows' . '<br />' . 'Displaying rule descriptions for all lines in the log might affect performance with large rule sets');
}
$group = new Form_Group('Action');
$btnsavesettings = new Form_Button('save_settings', gettext('Save'), null);
示例12: array
foreach ($p2_ealgos as $algo => $algodata) {
$group = new Form_Group($i == 0 ? 'Encryption Algorithms' : '');
$group->addClass('encalg');
$group->add(new Form_Checkbox('ealgos[]', null, $algodata['name'], is_array($pconfig['ealgos']) && in_array($algo, $pconfig['ealgos']), $algo))->addClass('multi');
if (is_array($algodata['keysel'])) {
$list = array();
$key_hi = $algodata['keysel']['hi'];
$key_lo = $algodata['keysel']['lo'];
$key_step = $algodata['keysel']['step'];
for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step) {
$list[$keylen] = $keylen . ' bits';
}
$group->add(new Form_Select('keylen_' . $algo, null, $keylen == $pconfig["keylen_" . $algo], array_merge(array('auto' => 'Auto'), $list)));
}
if ($i == $rows) {
$group->setHelp('Use 3DES for best compatibility or if you have a hardware crypto accelerator card. Blowfish is usually the fastest in software encryption.');
}
$i++;
$section->add($group);
}
$group = new Form_Group('Hash Algorithms');
foreach ($p2_halgos as $algo => $algoname) {
$group->add(new Form_Checkbox('halgos[]', null, $algoname, in_array($algo, $pconfig['halgos']), $algo))->addClass('multi');
}
$section->add($group);
$sm = !isset($pconfig['mobile']) || !isset($a_client['pfs_group']);
$section->addInput(new Form_Select('pfsgroup', 'PFS key group', $pconfig['psgroup'], $sm ? $p2_pfskeygroups : array()))->setHelp($sm ? '' : 'Set globally in mobile client options');
$section->addInput(new Form_Input('lifetime', 'Lifetime', 'number', $pconfig['lifetime']))->setHelp('Seconds');
$form->add($section);
$section = new Form_Section('Advanced Configuration');
$section->addInput(new Form_IpAddress('pinghost', 'Automatically ping host', $pconfig['pinghost']))->setHelp('IP Address');
示例13: array
$group->add(new Form_Select('dsttype', null, dsttype_selected(), build_dsttype_list()))->setHelp('Type');
$group->add(new Form_IpAddress('dst', null, is_specialnet($pconfig['dst']) ? '' : $pconfig['dst']))->setPattern('[.a-zA-Z0-9_]+')->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask');
$section->add($group);
$group = new Form_Group('Destination port range');
$group->addClass('dstportrange');
$group->add(new Form_Select('dstbeginport', null, $pconfig['dstbeginport'], $portlist))->setHelp('From port');
$group->add(new Form_Input('dstbeginport_cust', null, 'text', $pconfig['dstbeginport'], ['min' => '1', 'max' => '65536']))->setHelp('Custom');
$group->add(new Form_Select('dstendport', null, $pconfig['dstendport'], $portlist))->setHelp('To port');
$group->add(new Form_Input('dstendport_cust', null, 'text', $pconfig['dstendport'], ['min' => '1', 'max' => '65536']))->setHelp('Custom');
$group->setHelp('Specify the port or port range for the destination of the packet for this mapping. ' . 'You can leave the \'to\' field empty if you only want to map a single port ');
$section->add($group);
$section->addInput(new Form_IpAddress('localip', 'Redirect target IP', $pconfig['localip']))->setPattern('[.a-zA-Z0-9_]+')->setHelp('Enter the internal IP address of the server on which you want to map the ports.' . '<br />' . 'e.g.: 192.168.1.12');
$group = new Form_Group('Redirect target port');
$group->addClass('lclportrange');
$group->add(new Form_Select('localbeginport', null, $pconfig['localbeginport'], array('' => 'Other') + $wkports))->setHelp('Port');
$group->setHelp('Specify the port on the machine with the IP address entered above. In case of a port range, specify the ' . 'beginning port of the range (the end port will be calculated automatically).' . '<br />' . 'this is usually identical to "From port" above');
$group->add(new Form_Input('localbeginport_cust', null, 'text', $pconfig['localbeginport'], ['min' => '1', 'max' => '65536']))->setHelp('Custom');
$section->add($group);
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
$section->addInput(new Form_Checkbox('nosync', 'No XMLRPC Sync', 'Do not automatically sync to other CARP members', $pconfig['nosync']))->setHelp('This prevents the rule on Master from automatically syncing to other CARP members. ' . 'This does NOT prevent the rule from being overwritten on Slave.');
$section->addInput(new Form_Select('natreflection', 'NAT reflection', $pconfig['natreflection'], array('default' => 'Use system default', 'enable' => 'Enable (NAT + Proxy)', 'purenat' => 'Enable (Pure NAT)', 'disable' => 'Disable')));
if (isset($id) && $a_nat[$id] && (!isset($_GET['dup']) || !is_numericint($_GET['dup']))) {
$hlpstr = '';
$rulelist = array('' => 'None', 'pass' => 'Pass');
if (is_array($config['filter']['rule'])) {
filter_rules_sort();
foreach ($config['filter']['rule'] as $filter_id => $filter_rule) {
if (isset($filter_rule['associated-rule-id'])) {
$rulelist[$filter_rule['associated-rule-id']] = 'Rule ' . $filter_rule['descr'];
if ($filter_rule['associated-rule-id'] == $pconfig['associated-rule-id']) {
$hlpstr = '<a href="firewall_rules_edit.php?id=' . $filter_id . '">' . gettext("View the filter rule") . '</a><br />';
示例14: CTRL
if ($act == 'edit' && $Ggroup['member'] && in_array($pconfig['uid'], $Ggroup['member'])) {
$usersGroups[$Ggroup['name']] = $Ggroup['name'];
// Add it to the user's list
} else {
$systemGroups[$Ggroup['name']] = $Ggroup['name'];
// Add it to the 'not a member of' list
}
}
}
$group->add(new Form_Select('sysgroups', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $systemGroups, true))->setHelp('Not member of');
$group->add(new Form_Select('groups', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $usersGroups, true))->setHelp('Member of');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Button('movetoenabled', 'Move to "Member of" list', null, 'fa-angle-double-right'))->setAttribute('type', 'button')->removeClass('btn-primary')->addClass('btn-info btn-sm');
$group->add(new Form_Button('movetodisabled', 'Move to "Not member of" list', null, 'fa-angle-double-left'))->setAttribute('type', 'button')->removeClass('btn-primary')->addClass('btn-info btn-sm');
$group->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.');
$section->add($group);
// ==== Button for adding user certificate ================================
if ($act == 'new') {
$section->addInput(new Form_Checkbox('showcert', 'Certificate', 'Click to create a user certificate', false));
}
$form->add($section);
// ==== Effective privileges section ======================================
if (isset($pconfig['uid'])) {
// We are going to build an HTML table and add it to an Input_StaticText. It may be ugly, but it
// is the best way to make the display we need.
$section = new Form_Section('Effective Privileges');
$section->addInput(new Form_StaticText(null, build_priv_table()));
$form->add($section);
// ==== Certificate table section =====================================
$section = new Form_Section('User Certificates');
示例15: Form
$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']));
}
$form->add($section);
print $form;
?>