本文整理汇总了PHP中Form_Button::toggles方法的典型用法代码示例。如果您正苦于以下问题:PHP Form_Button::toggles方法的具体用法?PHP Form_Button::toggles怎么用?PHP Form_Button::toggles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form_Button
的用法示例。
在下文中一共展示了Form_Button::toggles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reference
$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']]));
$group->add(new Form_Input('latencyhigh', 'To', 'number', $pconfig['latencyhigh'], ['placeholder' => $dpinger_default['latencyhigh']]));
$group->setHelp('Low and high thresholds for latency in milliseconds.