当前位置: 首页>>代码示例>>PHP>>正文


PHP CComboBox::addItemsInGroup方法代码示例

本文整理汇总了PHP中CComboBox::addItemsInGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP CComboBox::addItemsInGroup方法的具体用法?PHP CComboBox::addItemsInGroup怎么用?PHP CComboBox::addItemsInGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComboBox的用法示例。


在下文中一共展示了CComboBox::addItemsInGroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CComboBox

}
$httpFormList->addRow(_('Name'), $nameTextBox);
// Application
if ($this->data['application_list']) {
    $applications = zbx_array_merge([''], $this->data['application_list']);
    $httpFormList->addRow(_('Application'), new CComboBox('applicationid', $this->data['applicationid'], null, $applications));
} else {
    $httpFormList->addRow(_('Application'), new CSpan(_('No applications found.')));
}
// New application
$httpFormList->addRow(new CLabel(_('New application'), 'new_application'), (new CSpan((new CTextBox('new_application', $this->data['new_application']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)))->addClass(ZBX_STYLE_FORM_NEW_GROUP))->addRow(_('Update interval (in sec)'), (new CNumericBox('delay', $this->data['delay'], 5))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH))->addRow(_('Attempts'), (new CNumericBox('retries', $this->data['retries'], 2))->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH));
$agentComboBox = new CComboBox('agent', $this->data['agent']);
$userAgentsAll = userAgents();
$userAgentsAll[_('Others')][ZBX_AGENT_OTHER] = _('other') . ' ...';
foreach ($userAgentsAll as $userAgentGroup => $userAgents) {
    $agentComboBox->addItemsInGroup($userAgentGroup, $userAgents);
}
$httpFormList->addRow(_('Agent'), $agentComboBox);
$httpFormList->addRow(_('User agent string'), (new CTextBox('agent_other', $this->data['agent_other']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH), 'row_agent_other');
// append HTTP proxy to form list
$httpFormList->addRow(_('HTTP proxy'), (new CTextBox('http_proxy', $this->data['http_proxy'], false, 255))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)->setAttribute('placeholder', 'http://[user[:password]@]proxy.example.com[:port]'))->addRow(_('Variables'), (new CTextArea('variables', $this->data['variables']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('Headers'), (new CTextArea('headers', $this->data['headers']))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('Enabled'), (new CCheckBox('status'))->setChecked(!$this->data['status']));
/*
 * Authentication tab
 */
$httpAuthenticationFormList = new CFormList('httpAuthenticationFormList');
// Authentication type
$httpAuthenticationFormList->addRow(_('HTTP authentication'), new CComboBox('authentication', $this->data['authentication'], null, httptest_authentications()));
$httpAuthenticationFormList->addRow(_('User'), (new CTextBox('http_user', $this->data['http_user'], false, 64))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('Password'), (new CTextBox('http_password', $this->data['http_password'], false, 64))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('SSL verify peer'), (new CCheckBox('verify_peer'))->setChecked($this->data['verify_peer'] == 1))->addRow(_('SSL verify host'), (new CCheckBox('verify_host'))->setChecked($this->data['verify_host'] == 1))->addRow(_('SSL certificate file'), (new CTextBox('ssl_cert_file', $this->data['ssl_cert_file'], false, 255))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('SSL key file'), (new CTextBox('ssl_key_file', $this->data['ssl_key_file'], false, 255))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH))->addRow(_('SSL key password'), (new CTextBox('ssl_key_password', $this->data['ssl_key_password'], false, 64))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH));
/*
 * Step tab
 */
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.httpconf.edit.php

示例2: CWidget

$mediaTypeWidget = new CWidget();
$mediaTypeWidget->addPageHeader(_('CONFIGURATION OF MEDIA TYPES'));
// create form
$mediaTypeForm = new CForm();
$mediaTypeForm->setName('mediaTypeForm');
$mediaTypeForm->addVar('form', $this->data['form']);
$mediaTypeForm->addVar('mediatypeid', $this->data['mediatypeid']);
// create form list
$mediaTypeFormList = new CFormList('mediaTypeFormList');
$nameTextBox = new CTextBox('description', $this->data['description'], ZBX_TEXTBOX_STANDARD_SIZE, false, 100);
$nameTextBox->attr('autofocus', 'autofocus');
$mediaTypeFormList->addRow(_('Name'), $nameTextBox);
// append type to form list
$cmbType = new CComboBox('type', $this->data['type'], 'submit()');
$cmbType->addItems(array(MEDIA_TYPE_EMAIL => _('Email'), MEDIA_TYPE_EXEC => _('Script'), MEDIA_TYPE_SMS => _('SMS'), MEDIA_TYPE_JABBER => _('Jabber')));
$cmbType->addItemsInGroup(_('Commercial'), array(MEDIA_TYPE_EZ_TEXTING => _('Ez Texting')));
$cmbTypeRow = array($cmbType);
if ($this->data['type'] == MEDIA_TYPE_EZ_TEXTING) {
    $ez_texting_link = new CLink('https://app.eztexting.com', 'https://app.eztexting.com/', null, null, 'nosid');
    $ez_texting_link->setTarget('_blank');
    $cmbTypeRow[] = $ez_texting_link;
}
$mediaTypeFormList->addRow(_('Type'), $cmbTypeRow);
// append others fields to form list
if ($this->data['type'] == MEDIA_TYPE_EMAIL) {
    $mediaTypeFormList->addRow(_('SMTP server'), new CTextBox('smtp_server', $this->data['smtp_server'], ZBX_TEXTBOX_STANDARD_SIZE));
    $mediaTypeFormList->addRow(_('SMTP helo'), new CTextBox('smtp_helo', $this->data['smtp_helo'], ZBX_TEXTBOX_STANDARD_SIZE));
    $mediaTypeFormList->addRow(_('SMTP email'), new CTextBox('smtp_email', $this->data['smtp_email'], ZBX_TEXTBOX_STANDARD_SIZE));
} elseif ($this->data['type'] == MEDIA_TYPE_SMS) {
    $mediaTypeFormList->addRow(_('GSM modem'), new CTextBox('gsm_modem', $this->data['gsm_modem'], ZBX_TEXTBOX_STANDARD_SIZE));
} elseif ($this->data['type'] == MEDIA_TYPE_EXEC) {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.mediatypes.edit.php

示例3: CFormTable

     $smtp_helo = get_request('smtp_helo', 'localhost');
     $smtp_email = get_request('smtp_email', 'zabbix@localhost');
     $exec_path = get_request('exec_path', '');
     $gsm_modem = get_request('gsm_modem', '/dev/ttyS0');
     $default_username = $type == MEDIA_TYPE_EZ_TEXTING ? 'username' : 'user@server';
     $username = get_request('username', $default_username);
 }
 $frmMedia = new CFormTable(S_MEDIA);
 //		$frmMeadia->setHelp('web.config.medias.php');
 if (isset($_REQUEST['mediatypeid'])) {
     $frmMedia->addVar('mediatypeid', $_REQUEST['mediatypeid']);
 }
 $frmMedia->addRow(S_DESCRIPTION, new CTextBox('description', $description, 30));
 $cmbType = new CComboBox('type', $type, 'submit()');
 $cmbType->addItems(array(MEDIA_TYPE_EMAIL => S_EMAIL, MEDIA_TYPE_EXEC => S_SCRIPT, MEDIA_TYPE_SMS => S_SMS, MEDIA_TYPE_JABBER => S_JABBER));
 $cmbType->addItemsInGroup(S_COMMERCIAL, array(MEDIA_TYPE_EZ_TEXTING => S_EZ_TEXTING));
 $row = array($cmbType);
 if ($type == MEDIA_TYPE_EZ_TEXTING) {
     $ez_texting_link = new CLink('https://app.eztexting.com', 'https://app.eztexting.com/', null, null, 'nosid');
     $ez_texting_link->setTarget('_blank');
     $row[] = $ez_texting_link;
 }
 $frmMedia->addRow(S_TYPE, $row);
 if ($type == MEDIA_TYPE_EMAIL) {
     $frmMedia->addRow(S_SMTP_SERVER, new CTextBox('smtp_server', $smtp_server, 30));
     $frmMedia->addRow(S_SMTP_HELO, new CTextBox('smtp_helo', $smtp_helo, 30));
     $frmMedia->addRow(S_SMTP_EMAIL, new CTextBox('smtp_email', $smtp_email, 30));
 } else {
     if ($type == MEDIA_TYPE_SMS) {
         $frmMedia->addRow(S_GSM_MODEM, new CTextBox('gsm_modem', $gsm_modem, 50));
     } else {
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:media_types.php


注:本文中的CComboBox::addItemsInGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。