本文整理汇总了PHP中CButton::useJQueryStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP CButton::useJQueryStyle方法的具体用法?PHP CButton::useJQueryStyle怎么用?PHP CButton::useJQueryStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::useJQueryStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItemFilterForm
//.........这里部分代码省略.........
$snmpOidField->setEnabled('no');
// port
$portLabel = new CSpan(array(bold(_('Port')), SPACE . _('like') . NAME_DELIMITER));
$portLabel->setAttribute('id', 'filter_port_label');
$portField = new CNumericBox('filter_port', $filter_port, 5, null, true);
$portField->setEnabled('no');
// row 1
$groupFilter = null;
if (!empty($filter_groupId)) {
$getHostInfo = API::HostGroup()->get(array('groupids' => $filter_groupId, 'output' => array('name')));
$getHostInfo = reset($getHostInfo);
if (!empty($getHostInfo)) {
$groupFilter[] = array('id' => $getHostInfo['groupid'], 'name' => $getHostInfo['name'], 'prefix' => $displayNodes ? get_node_name_by_elid($getHostInfo['groupid'], true, NAME_DELIMITER) : '');
}
}
$table->addRow(array(new CCol(bold(_('Host group') . NAME_DELIMITER), 'label col1'), new CCol(array(new CMultiSelect(array('name' => 'filter_groupid', 'selectedLimit' => 1, 'objectName' => 'hostGroup', 'objectOptions' => array('editable' => true), 'data' => $groupFilter, 'popup' => array('parameters' => 'srctbl=host_groups&dstfrm=' . $form->getName() . '&dstfld1=filter_groupid' . '&srcfld1=groupid&writeonly=1', 'width' => 450, 'height' => 450, 'buttonClass' => 'input filter-multiselect-select-button')))), 'col1'), new CCol(bold(_('Type') . NAME_DELIMITER), 'label col2'), new CCol($cmbType, 'col2'), new CCol(bold(_('Type of information') . NAME_DELIMITER), 'label col3'), new CCol($cmbValType, 'col3'), new CCol(bold(_('State') . NAME_DELIMITER), 'label'), new CCol($cmbState, 'col4')), 'item-list-row');
// row 2
$hostFilterData = null;
if (!empty($filter_hostId)) {
$getHostInfo = API::Host()->get(array('hostids' => $filter_hostId, 'templated_hosts' => true, 'output' => array('name')));
$getHostInfo = reset($getHostInfo);
if (!empty($getHostInfo)) {
$hostFilterData[] = array('id' => $getHostInfo['hostid'], 'name' => $getHostInfo['name'], 'prefix' => $displayNodes ? get_node_name_by_elid($filter_hostId, true, NAME_DELIMITER) : '');
}
}
$table->addRow(array(new CCol(bold(_('Host') . NAME_DELIMITER), 'label'), new CCol(array(new CMultiSelect(array('name' => 'filter_hostid', 'selectedLimit' => 1, 'objectName' => 'hosts', 'objectOptions' => array('editable' => true, 'templated_hosts' => true), 'data' => $hostFilterData, 'popup' => array('parameters' => 'srctbl=host_templates&dstfrm=' . $form->getName() . '&dstfld1=filter_hostid' . '&srcfld1=hostid&writeonly=1', 'width' => 450, 'height' => 450, 'buttonClass' => 'input filter-multiselect-select-button')))), 'col1'), new CCol($updateIntervalLabel, 'label'), new CCol($updateIntervalInput), new CCol($dataTypeLabel, 'label'), new CCol($dataTypeInput), new CCol(bold(_('Status') . NAME_DELIMITER), 'label col4'), new CCol($cmbStatus, 'col4')), 'item-list-row');
// row 3
$table->addRow(array(new CCol(bold(_('Application') . NAME_DELIMITER), 'label'), new CCol(array(new CTextBox('filter_application', $filter_application, ZBX_TEXTBOX_FILTER_SIZE), new CButton('btn_app', _('Select'), 'return PopUp("popup.php?srctbl=applications&srcfld1=applicationid' . '&dstfrm=' . $form->getName() . '&dstfld1=filter_application' . '&with_applications=1' . '" + (jQuery("input[name=\'filter_hostid\']").length > 0 ? "&hostid="+jQuery("input[name=\'filter_hostid\']").val() : "")' . ', 550, 450, "application");', 'filter-select-button')), 'col1'), new CCol(array($snmpCommunityLabel, $snmpSecurityLabel), 'label'), new CCol(array($snmpCommunityField, $snmpSecurityField)), new CCol(array(bold(_('History')), SPACE . _('(in days)') . NAME_DELIMITER), 'label'), new CCol(new CNumericBox('filter_history', $filter_history, 8, null, true)), new CCol(bold(_('Triggers') . NAME_DELIMITER), 'label'), new CCol(new CComboBox('filter_with_triggers', $filter_with_triggers, null, array(-1 => _('all'), 1 => _('With triggers'), 0 => _('Without triggers'))))), 'item-list-row');
// row 4
$table->addRow(array(new CCol(array(bold(_('Name')), SPACE . _('like') . NAME_DELIMITER), 'label'), new CCol(new CTextBox('filter_name', $filter_name, ZBX_TEXTBOX_FILTER_SIZE), 'col1'), new CCol($snmpOidLabel, 'label'), new CCol($snmpOidField), new CCol(array(bold(_('Trends')), SPACE . _('(in days)') . NAME_DELIMITER), 'label'), new CCol(new CNumericBox('filter_trends', $filter_trends, 8, null, true)), new CCol(bold(_('Template') . NAME_DELIMITER), 'label'), new CCol(new CComboBox('filter_templated_items', $filter_templated_items, null, array(-1 => _('all'), 1 => _('Templated items'), 0 => _('Not Templated items'))))), 'item-list-row');
// row 5
$table->addRow(array(new CCol(array(bold(_('Key')), SPACE . _('like') . NAME_DELIMITER), 'label'), new CCol(new CTextBox('filter_key', $filter_key, ZBX_TEXTBOX_FILTER_SIZE), 'col1'), new CCol($portLabel, 'label'), new CCol($portField), new CCol(null, 'label'), new CCol(), new CCol(null, 'label'), new CCol()), 'item-list-row');
$filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true); chkbxRange.clearSelectedOnFilterChange();");
$filter->useJQueryStyle('main');
$reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');");
$reset->useJQueryStyle();
$div_buttons = new CDiv(array($filter, SPACE, $reset));
$div_buttons->setAttribute('style', 'padding: 4px 0px;');
$footer = new CCol($div_buttons, 'controls', 8);
$table->addRow($footer);
$form->addItem($table);
// subfilters
$table_subfilter = new CTable(null, 'filter sub-filter');
// array contains subfilters and number of items in each
$item_params = array('hosts' => array(), 'applications' => array(), 'types' => array(), 'value_types' => array(), 'status' => array(), 'state' => array(), 'templated_items' => array(), 'with_triggers' => array(), 'history' => array(), 'trends' => array(), 'interval' => array());
// generate array with values for subfilters of selected items
foreach ($items as $item) {
// hosts
if (zbx_empty($filter_hostId)) {
$host = reset($item['hosts']);
if (!isset($item_params['hosts'][$host['hostid']])) {
$item_params['hosts'][$host['hostid']] = array('name' => $host['name'], 'count' => 0);
}
$show_item = true;
foreach ($item['subfilters'] as $name => $value) {
if ($name == 'subfilter_hosts') {
continue;
}
$show_item &= $value;
}
if ($show_item) {
$host = reset($item['hosts']);
$item_params['hosts'][$host['hostid']]['count']++;
}
}
// applications
示例2: CTable
$filter_table = new CTable('', 'filter');
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('filter_field', $_REQUEST['filter_field']);
foreach ($inventoryFields as $inventoryField) {
$inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title']);
}
$exactComboBox = new CComboBox('filter_exact', $_REQUEST['filter_exact']);
$exactComboBox->addItem('0', _('like'));
$exactComboBox->addItem('1', _('exactly'));
$filter_table->addRow(array(array(array(bold(_('Field:')), $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $_REQUEST['filter_field_value'], 20)))));
$filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true);");
$filter->useJQueryStyle('main');
$reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');");
$reset->useJQueryStyle();
$div_buttons = new CDiv(array($filter, SPACE, $reset));
$div_buttons->setAttribute('style', 'padding: 4px 0px;');
$footer_col = new CCol($div_buttons, 'controls');
$filter_table->addRow($footer_col);
$filter_form = new CForm('get');
$filter_form->setAttribute('name', 'zbx_filter');
$filter_form->setAttribute('id', 'zbx_filter');
$filter_form->addItem($filter_table);
$hostinvent_wdgt->addFlicker($filter_form, CProfile::get('web.hostinventories.filter.state', 0));
$hostinvent_wdgt->addHeaderRowNumber();
$table = new CTableInfo(_('No hosts defined.'));
$table->setHeader(array(is_show_all_nodes() ? make_sorting_header(_('Node'), 'hostid') : null, make_sorting_header(_('Host'), 'name'), _('Group'), make_sorting_header(_('Name'), 'pr_name'), make_sorting_header(_('Type'), 'pr_type'), make_sorting_header(_('OS'), 'pr_os'), make_sorting_header(_('Serial number A'), 'pr_serialno_a'), make_sorting_header(_('Tag'), 'pr_tag'), make_sorting_header(_('MAC address A'), 'pr_macaddress_a')));
$hosts = array();
$paging = getPagingLine($hosts);
if ($pageFilter->groupsSelected) {
示例3: CForm
$configComboBox->addItem('auditlogs.php', _('Logs'));
$configComboBox->addItem('auditacts.php', _('Actions'));
$configForm->addItem($configComboBox);
$auditWidget->addPageHeader(_('AUDIT ACTIONS'), $configForm);
$auditWidget->addHeader(_('Actions'));
$auditWidget->addHeaderRowNumber();
// create filter
$filterForm = new CForm('get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterTable = new CTable('', 'filter');
$filterTable->addRow(array(array(bold(_('Recipient')), SPACE, new CTextBox('alias', $this->data['alias'], 20), new CButton('btn1', _('Select'), 'return PopUp(\'popup.php?dstfrm=' . $filterForm->getName() . '&dstfld1=alias&srctbl=users&srcfld1=alias&real_hosts=1\');', 'T'))));
$filterButton = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true);");
$filterButton->useJQueryStyle('main');
$resetButton = new CButton('filter_rst', _('Reset'), 'javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst", 1); location.href = uri.getUrl();');
$resetButton->useJQueryStyle();
$buttonsDiv = new CDiv(array($filterButton, SPACE, $resetButton));
$buttonsDiv->setAttribute('style', 'padding: 4px 0px;');
$filterTable->addRow(new CCol($buttonsDiv, 'controls'));
$filterForm->addItem($filterTable);
$auditWidget->addFlicker($filterForm, CProfile::get('web.auditacts.filter.state', 1));
$auditWidget->addFlicker(new CDiv(null, null, 'scrollbar_cntr'), CProfile::get('web.auditacts.filter.state', 1));
// create form
$auditForm = new CForm('get');
$auditForm->setName('auditForm');
// create table
$auditTable = new CTableInfo(_('No actions defined.'));
$auditTable->setHeader(array(is_show_all_nodes() ? _('Nodes') : null, _('Time'), _('Type'), _('Status'), _('Retries left'), _('Recipient(s)'), _('Message'), _('Error')));
foreach ($this->data['alerts'] as $alert) {
$mediatype = array_pop($alert['mediatypes']);
if ($mediatype['mediatypeid'] == 0) {