本文整理匯總了PHP中CTextBox::addClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP CTextBox::addClass方法的具體用法?PHP CTextBox::addClass怎麽用?PHP CTextBox::addClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CTextBox
的用法示例。
在下文中一共展示了CTextBox::addClass方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CTextBox
} else {
$fieldLength = $hostInventoryTable['fields'][$inventoryInfo['db_field']]['length'];
$input = new CTextBox('host_inventory[' . $inventoryInfo['db_field'] . ']', $host_inventory[$inventoryInfo['db_field']]);
$input->setAttribute('maxlength', $fieldLength);
$input->addStyle('width: ' . ($fieldLength > 64 ? 64 : $fieldLength) . 'em;');
}
if ($inventory_mode == HOST_INVENTORY_DISABLED) {
$input->setAttribute('disabled', 'disabled');
}
// link to populating item at the right side (if any)
if (isset($hostItemsToInventory[$inventoryNo])) {
$itemName = itemName($hostItemsToInventory[$inventoryNo]);
$populatingLink = new CLink($itemName, 'items.php?form=update&itemid=' . $hostItemsToInventory[$inventoryNo]['itemid']);
$populatingLink->setAttribute('title', _s('This field is automatically populated by item "%s".', $itemName));
$populatingItemCell = array(' ← ', $populatingLink);
$input->addClass('linked_to_item');
// this will be used for disabling fields via jquery
if ($inventory_mode == HOST_INVENTORY_AUTOMATIC) {
$input->setAttribute('disabled', 'disabled');
}
} else {
$populatingItemCell = '';
}
$input->addStyle('float: left;');
$populatingItem = new CSpan($populatingItemCell, 'populating_item');
if ($inventory_mode != HOST_INVENTORY_AUTOMATIC) {
// those links are visible only in automatic mode
$populatingItem->addStyle('display: none');
}
$inventoryFormList->addRow($inventoryInfo['title'], array($input, $populatingItem));
}
示例2: CFormList
$macros = array_values($this->data['macros']);
if ($readonly && !$macros) {
$macrosFormList = new CFormList('macrosFormList');
$macrosFormList->addRow(_('No macros found.'));
return $macrosFormList;
}
if (!$readonly) {
include dirname(__FILE__) . '/js/common.macros.js.php';
}
$macrosTable = new CTable(SPACE, 'formElementTable');
$macrosTable->setAttribute('id', 'tbl_macros');
$macrosTable->addRow(array(_('Macro'), SPACE, _('Value'), SPACE));
// fields
foreach ($macros as $i => $macro) {
$text1 = new CTextBox('macros[' . $i . '][macro]', $macro['macro'], 30, $readonly, 64);
$text1->addClass('macro');
$text1->setAttribute('placeholder', '{$MACRO}');
$text2 = new CTextBox('macros[' . $i . '][value]', $macro['value'], 40, $readonly, 255);
$text2->setAttribute('placeholder', _('value'));
$span = new CSpan('⇒');
$span->addStyle('vertical-align:top;');
$deleteButtonCell = null;
if (!$readonly) {
$deleteButtonCell = array(new CButton('macros_' . $i . '_remove', _('Remove'), null, 'link_menu element-table-remove'));
if (isset($macro['globalmacroid'])) {
$deleteButtonCell[] = new CVar('macros[' . $i . '][globalmacroid]', $macro['globalmacroid'], 'macros_' . $i . '_id');
}
if (isset($macro['hostmacroid'])) {
$deleteButtonCell[] = new CVar('macros[' . $i . '][hostmacroid]', $macro['hostmacroid'], 'macros_' . $i . '_id');
}
}
示例3: CForm
<?php
/*
** Zabbix
** Copyright (C) 2001-2013 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
$searchForm = new CForm('get', 'search.php');
$searchBox = new CTextBox('search', get_request('search'));
$searchBox->setAttribute('autocomplete', 'off');
$searchBox->addClass('search');
$searchForm->addItem($searchBox);
$searchBtn = new CSubmit('searchbttn', _('Search'), null, 'input button ui-button ui-widget ui-state-default ui-corner-all');
$searchForm->addItem($searchBtn);
return new CDiv($searchForm, 'zbx_search', 'zbx_search');
示例4: isset
}
if (!str_in_array($condition['conditiontype'], $this->data['allowedConditions'])) {
continue;
}
$label = isset($condition['formulaid']) ? $condition['formulaid'] : num2letter($i);
$labelSpan = new CSpan($label, 'label');
$labelSpan->setAttribute('data-conditiontype', $condition['conditiontype']);
$labelSpan->setAttribute('data-formulaid', $label);
$conditionTable->addRow(array($labelSpan, get_condition_desc($condition['conditiontype'], $condition['operator'], $condition['value']), array(new CButton('remove', _('Remove'), 'javascript: removeCondition(' . $i . ');', 'link_menu'), new CVar('conditions[' . $i . ']', $condition)), new CVar('conditions[' . $i . '][formulaid]', $label)), null, 'conditions_' . $i);
$i++;
}
$formula = new CTextBox('formula', $this->data['action']['filter']['formula'], ZBX_TEXTBOX_STANDARD_SIZE);
$formula->attr('id', 'formula');
$formula->attr('placeholder', 'A or (B and C) …');
if ($this->data['action']['filter']['evaltype'] != CONDITION_EVAL_TYPE_EXPRESSION) {
$formula->addClass('hidden');
}
$calculationTypeComboBox = new CComboBox('evaltype', $this->data['action']['filter']['evaltype'], 'processTypeOfCalculation()');
$calculationTypeComboBox->addItem(CONDITION_EVAL_TYPE_AND_OR, _('And/Or'));
$calculationTypeComboBox->addItem(CONDITION_EVAL_TYPE_AND, _('And'));
$calculationTypeComboBox->addItem(CONDITION_EVAL_TYPE_OR, _('Or'));
$calculationTypeComboBox->addItem(CONDITION_EVAL_TYPE_EXPRESSION, _('Custom expression'));
$calculationTypeComboBox->setAttribute('id', 'evaltype');
$conditionFormList->addRow(_('Type of calculation'), array($calculationTypeComboBox, new CSpan('', $this->data['action']['filter']['evaltype'] == CONDITION_EVAL_TYPE_EXPRESSION ? 'hidden' : '', 'conditionLabel'), $formula), false, 'conditionRow');
$conditionFormList->addRow(_('Conditions'), new CDiv($conditionTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
// append new condition to form list
$conditionTypeComboBox = new CComboBox('new_condition[conditiontype]', $this->data['new_condition']['conditiontype'], 'submit()');
foreach ($this->data['allowedConditions'] as $key => $condition) {
$this->data['allowedConditions'][$key] = array('name' => condition_type2str($condition), 'type' => $condition);
}
order_result($this->data['allowedConditions'], 'name');
示例5: CTable
$conditionTable = new CTable('', 'formElementTable');
$conditionTable->attr('id', 'conditions');
$conditionTable->addRow(array(_('Label'), _('Macro'), SPACE, _('Regular expression'), SPACE));
$conditions = $this->data['conditions'];
if (!$conditions) {
$conditions = array(array('macro' => '', 'value' => '', 'formulaid' => num2letter(0)));
} else {
$conditions = CConditionHelper::sortConditionsByFormulaId($conditions);
}
// fields
foreach ($conditions as $i => $condition) {
// formula id
$formulaId = array(new CSpan($condition['formulaid']), new CVar('conditions[' . $i . '][formulaid]', $condition['formulaid']));
// macro
$macro = new CTextBox('conditions[' . $i . '][macro]', $condition['macro'], 30, false, 64);
$macro->addClass('macro');
$macro->setAttribute('placeholder', '{#MACRO}');
$macro->setAttribute('data-formulaid', $condition['formulaid']);
// value
$value = new CTextBox('conditions[' . $i . '][value]', $condition['value'], 40, false, 255);
$value->setAttribute('placeholder', _('regular expression'));
// delete button
$deleteButtonCell = array(new CButton('conditions_' . $i . '_remove', _('Remove'), null, 'link_menu element-table-remove'));
$row = array($formulaId, $macro, new CSpan(_('matches')), $value, $deleteButtonCell);
$conditionTable->addRow($row, 'form_row');
}
$addButton = new CButton('macro_add', _('Add'), null, 'link_menu element-table-add');
$buttonColumn = new CCol($addButton);
$buttonColumn->setAttribute('colspan', 5);
$buttonRow = new CRow();
$buttonRow->setAttribute('id', 'row_new_macro');