當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CTextBox::setEnabled方法代碼示例

本文整理匯總了PHP中CTextBox::setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP CTextBox::setEnabled方法的具體用法?PHP CTextBox::setEnabled怎麽用?PHP CTextBox::setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CTextBox的用法示例。


在下文中一共展示了CTextBox::setEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getItemFilterForm


//.........這裏部分代碼省略.........
                break;
        }
    }
    zbx_add_post_js("var filterTypeSwitcher = new CViewSwitcher('filter_type', 'change', " . zbx_jsvalue($fTypeVisibility, true) . ');');
    // type of information select
    $fVTypeVisibility = array();
    $cmbValType = new CComboBox('filter_value_type', $filter_value_type);
    $cmbValType->addItem(-1, _('all'));
    $cmbValType->addItem(ITEM_VALUE_TYPE_UINT64, _('Numeric (unsigned)'));
    $cmbValType->addItem(ITEM_VALUE_TYPE_FLOAT, _('Numeric (float)'));
    $cmbValType->addItem(ITEM_VALUE_TYPE_STR, _('Character'));
    $cmbValType->addItem(ITEM_VALUE_TYPE_LOG, _('Log'));
    $cmbValType->addItem(ITEM_VALUE_TYPE_TEXT, _('Text'));
    foreach (array('filter_data_type_label', 'filter_data_type') as $vItem) {
        zbx_subarray_push($fVTypeVisibility, ITEM_VALUE_TYPE_UINT64, $vItem);
    }
    zbx_add_post_js("var filterValueTypeSwitcher = new CViewSwitcher('filter_value_type', 'change', " . zbx_jsvalue($fVTypeVisibility, true) . ');');
    // status select
    $cmbStatus = new CComboBox('filter_status', $filter_status);
    $cmbStatus->addItem(-1, _('all'));
    foreach (array(ITEM_STATUS_ACTIVE, ITEM_STATUS_DISABLED) as $status) {
        $cmbStatus->addItem($status, item_status2str($status));
    }
    // state select
    $cmbState = new CComboBox('filter_state', $filter_state);
    $cmbState->addItem(-1, _('all'));
    foreach (array(ITEM_STATE_NORMAL, ITEM_STATE_NOTSUPPORTED) as $state) {
        $cmbState->addItem($state, itemState($state));
    }
    // update interval
    $updateIntervalLabel = new CSpan(array(bold(_('Update interval')), SPACE . _('(in sec)') . NAME_DELIMITER));
    $updateIntervalLabel->setAttribute('id', 'filter_delay_label');
    $updateIntervalInput = new CNumericBox('filter_delay', $filter_delay, 5, false, true);
    $updateIntervalInput->setEnabled('no');
    // data type
    $dataTypeLabel = new CSpan(bold(_('Data type') . NAME_DELIMITER));
    $dataTypeLabel->setAttribute('id', 'filter_data_type_label');
    $dataTypeInput = new CComboBox('filter_data_type', $filter_data_type);
    $dataTypeInput->addItem(-1, _('all'));
    $dataTypeInput->addItems(item_data_type2str());
    $dataTypeInput->setEnabled('no');
    // filter table
    $table = new CTable('', 'filter');
    $table->setCellPadding(0);
    $table->setCellSpacing(0);
    // SNMP community
    $snmpCommunityLabel = new CSpan(array(bold(_('SNMP community')), SPACE . _('like') . NAME_DELIMITER));
    $snmpCommunityLabel->setAttribute('id', 'filter_snmp_community_label');
    $snmpCommunityField = new CTextBox('filter_snmp_community', $filter_snmp_community, ZBX_TEXTBOX_FILTER_SIZE);
    $snmpCommunityField->setEnabled('no');
    // SNMPv3 security name
    $snmpSecurityLabel = new CSpan(array(bold(_('Security name')), SPACE . _('like') . NAME_DELIMITER));
    $snmpSecurityLabel->setAttribute('id', 'filter_snmpv3_securityname_label');
    $snmpSecurityField = new CTextBox('filter_snmpv3_securityname', $filter_snmpv3_securityname, ZBX_TEXTBOX_FILTER_SIZE);
    $snmpSecurityField->setEnabled('no');
    // SNMP OID
    $snmpOidLabel = new CSpan(array(bold(_('SNMP OID')), SPACE . _('like') . NAME_DELIMITER));
    $snmpOidLabel->setAttribute('id', 'filter_snmp_oid_label');
    $snmpOidField = new CTextBox('filter_snmp_oid', $filter_snmp_oid, ZBX_TEXTBOX_FILTER_SIZE);
    $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, false, true);
    $portField->setEnabled('no');
    // row 1
開發者ID:omidmt,項目名稱:zabbix-greenplum,代碼行數:67,代碼來源:forms.inc.php

示例2: get_item_filter_form


//.........這裏部分代碼省略.........
    }
    $itemTypes = item_type2str();
    // httptest items are only for internal zabbix logic
    unset($itemTypes[ITEM_TYPE_HTTPTEST]);
    $cmbType->addItems($itemTypes);
    foreach ($itemTypes as $typeNum => $typeLabel) {
        if ($typeNum != ITEM_TYPE_TRAPPER) {
            zbx_subarray_push($fTypeVisibility, $typeNum, 'filter_delay_label');
            zbx_subarray_push($fTypeVisibility, $typeNum, 'filter_delay');
        }
        switch ($typeNum) {
            case ITEM_TYPE_SNMPV1:
            case ITEM_TYPE_SNMPV2C:
                $snmp_types = array('filter_snmp_community_label', 'filter_snmp_community', 'filter_snmp_oid_label', 'filter_snmp_oid', 'filter_snmp_port_label', 'filter_snmp_port');
                foreach ($snmp_types as $vItem) {
                    zbx_subarray_push($fTypeVisibility, $typeNum, $vItem);
                }
                break;
            case ITEM_TYPE_SNMPV3:
                foreach (array('filter_snmpv3_securityname_label', 'filter_snmpv3_securityname', 'filter_snmp_oid_label', 'filter_snmp_oid', 'filter_snmp_port_label', 'filter_snmp_port') as $vItem) {
                    zbx_subarray_push($fTypeVisibility, $typeNum, $vItem);
                }
                break;
        }
    }
    zbx_add_post_js("var filterTypeSwitcher = new CViewSwitcher('filter_type', 'change', " . zbx_jsvalue($fTypeVisibility, true) . ");");
    $col21 = new CCol(bold(S_TYPE . ': '));
    $col21->setAttribute('style', 'width: 170px');
    $col_table2->addRow(array($col21, $cmbType));
    //second row
    $label221 = new CSpan(bold(S_UPDATE_INTERVAL_IN_SEC . ': '));
    $label221->setAttribute('id', 'filter_delay_label');
    $field221 = new CNumericBox('filter_delay', $filter_delay, 5, null, true);
    $field221->setEnabled('no');
    $col_table2->addRow(array(array($label221, SPACE), array($field221, SPACE)));
    //third row
    $label231 = new CSpan(array(bold(S_SNMP_COMMUNITY), SPACE . S_LIKE_SMALL . ': '));
    $label231->setAttribute('id', 'filter_snmp_community_label');
    $field231 = new CTextBox('filter_snmp_community', $filter_snmp_community, 40);
    $field231->setEnabled('no');
    $label232 = new CSpan(array(bold(S_SNMPV3_SECURITY_NAME), SPACE . S_LIKE_SMALL . ': '));
    $label232->setAttribute('id', 'filter_snmpv3_securityname_label');
    $field232 = new CTextBox('filter_snmpv3_securityname', $filter_snmpv3_securityname, 40);
    $field232->setEnabled('no');
    $col_table2->addRow(array(array($label231, $label232, SPACE), array($field231, $field232, SPACE)));
    //fourth row
    $label241 = new CSpan(array(bold(S_SNMP_OID), SPACE . S_LIKE_SMALL . ': '));
    $label241->setAttribute('id', 'filter_snmp_oid_label');
    $field241 = new CTextBox('filter_snmp_oid', $filter_snmp_oid, 40);
    $field241->setEnabled('no');
    $col_table2->addRow(array(array($label241, SPACE), array($field241, SPACE)));
    //fifth row
    $label251 = new CSpan(array(bold(S_SNMP_PORT), SPACE . S_LIKE_SMALL . ': '));
    $label251->setAttribute('id', 'filter_snmp_port_label');
    $field251 = new CNumericBox('filter_snmp_port', $filter_snmp_port, 5, null, true);
    $field251->setEnabled('no');
    $col_table2->addRow(array(array($label251, SPACE), array($field251, SPACE)));
    // 3rd col
    $col_table3 = new CTable();
    $col_table3->setClass('filter');
    $fVTypeVisibility = array();
    $cmbValType = new CComboBox('filter_value_type', $filter_value_type);
    //, "javascript: create_var('zbx_filter', 'filter_set', '1', true);");
    $cmbValType->addItem(-1, S_ALL_SMALL);
    $cmbValType->addItem(ITEM_VALUE_TYPE_UINT64, S_NUMERIC_UNSIGNED);
    $cmbValType->addItem(ITEM_VALUE_TYPE_FLOAT, S_NUMERIC_FLOAT);
開發者ID:songyuanjie,項目名稱:zabbix-stats,代碼行數:67,代碼來源:forms.inc.php


注:本文中的CTextBox::setEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。