本文整理汇总了PHP中CButton::SetAction方法的典型用法代码示例。如果您正苦于以下问题:PHP CButton::SetAction方法的具体用法?PHP CButton::SetAction怎么用?PHP CButton::SetAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::SetAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CScript
$script = new CScript("javascript: if(CLNDR['events_since'].clndr.setSDateFromOuterObj()){" . "\$('filter_timesince').value = parseInt(CLNDR['events_since'].clndr.sdt.getTime()/1000);}" . "if(CLNDR['events_till'].clndr.setSDateFromOuterObj()){" . "\$('filter_timetill').value = parseInt(CLNDR['events_till'].clndr.sdt.getTime()/1000);}");
$filterForm->AddAction('onsubmit', $script);
$filterForm->AddVar('triggerid', $_REQUEST['triggerid']);
if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) {
$trigger = expand_trigger_description($_REQUEST['triggerid']);
} else {
$trigger = "";
}
$row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox("trigger", $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r')));
$filterForm->AddRow($row);
$filterForm->AddVar('show_unknown', $show_unknown);
$unkcbx = new CCheckBox('show_unk', $show_unknown, null, '1');
$unkcbx->SetAction('javascript: create_var("' . $filterForm->GetName() . '", "show_unknown", (this.checked?1:0), 0); ');
$filterForm->AddRow(S_SHOW_UNKNOWN, $unkcbx);
$reset = new CButton("filter_rst", S_RESET);
$reset->SetType('button');
$reset->SetAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
$filterForm->AddItemToBottomRow(new CButton("filter_set", S_FILTER));
$filterForm->AddItemToBottomRow($reset);
$p_elements[] = create_filter(S_FILTER, $navigation, $filterForm, 'tr_filter', get_profile('web.events.filter.state', 0));
} else {
$p_elements[] = get_thin_table_header(SPACE, $navigation);
}
//-------
$p_elements[] = $table;
$p_elements[] = get_thin_table_header(SPACE, $navigation);
$events_hat = create_hat($text, $p_elements, $fs_icon, 'hat_events', get_profile('web.events.hats.hat_events.state', 1));
$events_hat->Show();
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once "include/page_footer.php";
示例2: get_item_filter_form
//.........这里部分代码省略.........
$form = new CFormTable(S_ITEM . ' ' . S_FILTER);
$form->addOption('name', 'zbx_filter');
$form->addOption('id', 'zbx_filter');
$form->SetMethod('get');
$form->addAction('onsubmit', "javascript: if(empty_form(this)) return Confirm('Filter is empty! All items will be selected. Proceed?');");
$form->addVar('filter_hostid', get_request('filter_hostid', get_request('hostid')));
$form->addVar('selection_mode', $selection_mode);
$modeLink = new CSpan($selection_mode == 0 ? S_ADVANCED : S_SIMPLE, 'link');
$modeLink->addAction('onclick', "javascript: create_var('" . $form->GetName() . "','selection_mode'," . ($selection_mode == 0 ? 1 : 0) . ',true);');
$form->addRow(S_SELECTION_MODE, $modeLink);
if (ZBX_DISTRIBUTED && $selection_mode) {
$form->addRow(array('from ', bold(S_NODE), ' like'), array(new CTextBox('filter_node', $filter_node, 32), new CButton('btn_node', S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=filter_node&srctbl=nodes&srcfld1=name',450,450);", "G")));
}
if ($selection_mode) {
$form->addRow(array('from ', bold(S_HOST_GROUP), ' like'), array(new CTextBox('filter_group', $filter_group, 32), new CButton("btn_group", S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=filter_group&srctbl=host_group&srcfld1=name',450,450);", "G")));
}
$form->addRow(array('from ', bold(S_HOST), ' like'), array(new CTextBox('filter_host', $filter_host, 32), new CButton("btn_host", S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=filter_host&dstfld2=filter_hostid&srctbl=hosts&srcfld1=host&srcfld2=hostid',450,450);", 'H')));
if ($selection_mode) {
$form->addRow(array('from ', bold(S_APPLICATION), ' like'), array(new CTextBox('filter_application', $filter_application, 32), new CButton('btn_app', S_SELECT, 'return PopUp("popup.php?dstfrm=' . $form->GetName() . '&dstfld1=filter_application&srctbl=applications' . '&srcfld1=name",400,300,"application");', 'A')));
}
$form->addRow(array('with ', bold(S_DESCRIPTION), ' like'), new CTextBox("filter_description", $filter_description, 40));
if ($selection_mode) {
$cmbType = new CComboBox("filter_type", $filter_type, "submit()");
$cmbType->addItem(-1, S_ALL_SMALL);
foreach (array(ITEM_TYPE_ZABBIX, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_SIMPLE, ITEM_TYPE_SNMPV1, ITEM_TYPE_SNMPV2C, ITEM_TYPE_SNMPV3, ITEM_TYPE_TRAPPER, ITEM_TYPE_INTERNAL, ITEM_TYPE_AGGREGATE, ITEM_TYPE_HTTPTEST, ITEM_TYPE_DB_MONITOR, ITEM_TYPE_IPMI) as $it) {
$cmbType->addItem($it, item_type2str($it));
}
$form->addRow(array('with ', bold(S_TYPE)), $cmbType);
}
$form->addRow(array('with ', bold(S_KEY), ' like'), array(new CTextBox("filter_key", $filter_key, 40)));
if ($selection_mode) {
if ($filter_type == ITEM_TYPE_SNMPV1 || $filter_type == ITEM_TYPE_SNMPV2C || $filter_type == ITEM_TYPE_SNMPV3) {
$form->addRow(array('with ', bold(S_SNMP_COMMUNITY), ' like'), new CTextBox("filter_snmp_community", $filter_snmp_community, 16));
$form->addRow(array('with ', bold(S_SNMP_OID), ' like'), new CTextBox("filter_snmp_oid", $filter_snmp_oid, 40));
$form->addRow(array('with ', bold(S_SNMP_PORT), ' like'), new CNumericBox("filter_snmp_port", $filter_snmp_port, 5, null, true));
}
if ($filter_type == ITEM_TYPE_SNMPV3) {
$form->addRow(array('with ', bold(S_SNMPV3_SECURITY_NAME), ' like'), new CTextBox("filter_snmpv3_securityname", $filter_snmpv3_securityname, 64));
$cmbSecLevel = new CComboBox("filter_snmpv3_securitylevel", $filter_snmpv3_securitylevel);
$cmbSecLevel->addItem(-1, S_ALL_SMALL);
$cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV, "NoAuthPriv");
$cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, "AuthNoPriv");
$cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, "AuthPriv");
$form->addRow(array('with ', bold(S_SNMPV3_SECURITY_LEVEL)), $cmbSecLevel);
$form->addRow(array('with ', bold(S_SNMPV3_AUTH_PASSPHRASE), ' like'), new CTextBox("filter_snmpv3_authpassphrase", $filter_snmpv3_authpassphrase, 64));
$form->addRow(array('with ', bold(S_SNMPV3_PRIV_PASSPHRASE), ' like'), new CTextBox("filter_snmpv3_privpassphrase", $filter_snmpv3_privpassphrase, 64));
}
$cmbValType = new CComboBox("filter_value_type", $filter_value_type, "submit()");
$cmbValType->AddItem(-1, S_ALL_SMALL);
$cmbValType->AddItem(ITEM_VALUE_TYPE_UINT64, S_NUMERIC_UNSIGNED);
$cmbValType->AddItem(ITEM_VALUE_TYPE_FLOAT, S_NUMERIC_FLOAT);
$cmbValType->AddItem(ITEM_VALUE_TYPE_STR, S_CHARACTER);
$cmbValType->AddItem(ITEM_VALUE_TYPE_LOG, S_LOG);
$cmbValType->AddItem(ITEM_VALUE_TYPE_TEXT, S_TEXT);
$form->AddRow(array('with ', bold(S_TYPE_OF_INFORMATION)), $cmbValType);
if ($filter_value_type == ITEM_VALUE_TYPE_UINT64) {
$cmbDataType = new CComboBox("filter_data_type", $filter_data_type, "submit()");
$cmbDataType->addItem(-1, S_ALL_SMALL);
$cmbDataType->addItem(ITEM_DATA_TYPE_DECIMAL, item_data_type2str(ITEM_DATA_TYPE_DECIMAL));
$cmbDataType->addItem(ITEM_DATA_TYPE_OCTAL, item_data_type2str(ITEM_DATA_TYPE_OCTAL));
$cmbDataType->addItem(ITEM_DATA_TYPE_HEXADECIMAL, item_data_type2str(ITEM_DATA_TYPE_HEXADECIMAL));
$form->addRow(array('with ', bold(S_DATA_TYPE)), $cmbDataType);
}
if ($filter_value_type == ITEM_VALUE_TYPE_FLOAT || $filter_value_type == ITEM_VALUE_TYPE_UINT64) {
$form->addRow(array('with ', bold(S_UNITS)), new CTextBox("filter_units", $filter_units, 40));
$form->addRow(array('with ', bold(S_CUSTOM_MULTIPLIER), ' like'), new CTextBox("filter_formula", $filter_formula, 40));
}
if ($filter_type != ITEM_TYPE_TRAPPER && $filter_type != ITEM_TYPE_HTTPTEST) {
$form->addRow(array('with ', bold(S_UPDATE_INTERVAL_IN_SEC)), new CNumericBox("filter_delay", $filter_delay, 5, null, true));
}
$form->addRow(array('with ', bold(S_KEEP_HISTORY_IN_DAYS)), new CNumericBox("filter_history", $filter_history, 8, null, true));
$form->addRow(array('with ', bold(S_KEEP_TRENDS_IN_DAYS)), new CNumericBox("filter_trends", $filter_trends, 8, null, true));
$cmbStatus = new CComboBox("filter_status", $filter_status);
$cmbStatus->addItem(-1, S_ALL_SMALL);
foreach (array(ITEM_STATUS_ACTIVE, ITEM_STATUS_DISABLED, ITEM_STATUS_NOTSUPPORTED) as $st) {
$cmbStatus->addItem($st, item_status2str($st));
}
$form->addRow(array('with ', bold(S_STATUS)), $cmbStatus);
if ($filter_value_type == ITEM_VALUE_TYPE_LOG) {
$form->addRow(array('with ', bold(S_LOG_TIME_FORMAT)), new CTextBox("filter_logtimefmt", $filter_logtimefmt, 16));
}
if ($filter_value_type == ITEM_VALUE_TYPE_FLOAT || $filter_value_type == ITEM_VALUE_TYPE_UINT64) {
$cmbDelta = new CComboBox("filter_delta", $filter_delta);
$cmbDelta->addItem(-1, S_ALL_SMALL);
$cmbDelta->addItem(0, S_AS_IS);
$cmbDelta->addItem(1, S_DELTA_SPEED_PER_SECOND);
$cmbDelta->addItem(2, S_DELTA_SIMPLE_CHANGE);
$form->addRow(array('with ', bold(S_STORE_VALUE)), $cmbDelta);
}
if ($filter_type == ITEM_TYPE_TRAPPER) {
$form->addRow(array('with ', bold(S_ALLOWED_HOSTS), ' like'), new CTextBox("filter_trapper_hosts", $filter_trapper_hosts, 40));
}
}
$reset = new CButton("filter_rst", S_RESET);
$reset->SetType('button');
$reset->SetAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
$form->addItemToBottomRow(new CButton("filter_set", S_FILTER));
$form->addItemToBottomRow($reset);
return $form;
}
示例3: foreach
$table->setAttribute('id', 'service_childs');
foreach ($childs as $id => $child) {
$prefix = null;
$trigger = '-';
$description = new CLink($child['name'], 'services_form.php?sform=1&serviceid=' . $child['serviceid'], 'action');
if (isset($child['triggerid']) && !empty($child['triggerid'])) {
$trigger = expand_trigger_description($child['triggerid']);
}
$table->AddRow(array(array(new CCheckBox('childs_to_del[' . $child['serviceid'] . '][serviceid]', null, null, $child['serviceid']), new CVar('childs[' . $child['serviceid'] . '][serviceid]', $child['serviceid'])), array($description, new CVar('childs[' . $child['serviceid'] . '][name]', $child['name'])), new CCheckBox('childs[' . $child['serviceid'] . '][soft]', isset($child['soft']) && !empty($child['soft']) ? 'checked' : 'no', null, isset($child['soft']) && !empty($child['soft']) ? 1 : 0), array($trigger, new CVar('childs[' . $child['serviceid'] . '][triggerid]', isset($child['triggerid']) ? $child['triggerid'] : ''))));
}
$cb = new CButton('add_child_service', S_ADD);
$cb->SetType('button');
$cb->SetAction("javascript: openWinCentered('services_form.php?cservices=1" . url_param('serviceid') . "','ZBX_Services_List',640,520,'scrollbars=1, toolbar=0, menubar=0, resizable=0');");
$cb2 = new CButton('del_child_service', S_REMOVE);
$cb2->SetType('button');
$cb2->SetAction("javascript: remove_childs('" . $frmService->GetName() . "','childs_to_del','tr');");
$frmService->AddRow(S_DEPENDS_ON, array($table, BR(), $cb, $cb2));
//----------
//--------------------------------------------- </LINK> -------------------------------------------
//algorithm
$cmbAlg = new CComboBox('algorithm', $algorithm);
foreach (array(SERVICE_ALGORITHM_MAX, SERVICE_ALGORITHM_MIN, SERVICE_ALGORITHM_NONE) as $val) {
$cmbAlg->AddItem($val, algorithm2str($val));
}
$frmService->AddRow(S_STATUS_CALCULATION_ALGORITHM, $cmbAlg);
//-------
//SLA
$frmService->AddRow(S_CALCULATE_SLA, new CCheckBox('showsla', $showsla, "javascript: display_element('sla_row');", 1));
$row = new CRow(array(new CCol(S_ACCEPTABLE_SLA_IN_PERCENT, 'form_row_l'), new CCol(new CTextBox("goodsla", $goodsla, 6), 'form_row_r')));
$row->setAttribute('style', $linktrigger == 1 ? '' : 'display: none;');
$row->setAttribute('id', 'sla_row');