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


PHP CWidget::setTitle方法代码示例

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


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

示例1: CWidget

** 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.
**/
$widget = new CWidget();
if (!empty($this->data['parent_discoveryid'])) {
    $widget->setTitle(_('Graph prototypes'))->addItem(get_header_host_table('graphs', $this->data['hostid'], $this->data['parent_discoveryid']));
} else {
    $widget->setTitle(_('Graphs'))->addItem(get_header_host_table('graphs', $this->data['hostid']));
}
// create form
$graphForm = (new CForm())->setName('graphForm')->addVar('form', $this->data['form'])->addVar('hostid', $this->data['hostid'])->addVar('ymin_itemid', $this->data['ymin_itemid'])->addVar('ymax_itemid', $this->data['ymax_itemid']);
if (!empty($this->data['parent_discoveryid'])) {
    $graphForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
}
if (!empty($this->data['graphid'])) {
    $graphForm->addVar('graphid', $this->data['graphid']);
}
// create form list
$graphFormList = new CFormList('graphFormList');
$is_templated = (bool) $this->data['templates'];
if ($is_templated) {
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.graph.edit.php

示例2: CWidget

** (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.
**/
$screenWidget = new CWidget();
$form = (new CFilter('web.hostscreen.filter.state'))->addNavigator();
$screenWidget->addItem($form);
if (empty($this->data['screen']) || empty($this->data['host'])) {
    $screenWidget->setTitle(_('Screens'))->addItem(new CTableInfo());
    $screenBuilder = new CScreenBuilder();
    CScreenBuilder::insertScreenStandardJs(['timeline' => $screenBuilder->timeline]);
} else {
    $screenWidget->setTitle([$this->data['screen']['name'], SPACE, _('on'), SPACE, (new CSpan($this->data['host']['name']))->addClass(ZBX_STYLE_ORANGE)]);
    $controls = new CList();
    // host screen list
    if (!empty($this->data['screens'])) {
        $screenComboBox = new CComboBox('screenList', 'host_screen.php?hostid=' . $this->data['hostid'] . '&screenid=' . $this->data['screenid'], 'javascript: redirect(this.options[this.selectedIndex].value);');
        foreach ($this->data['screens'] as $screen) {
            $screenComboBox->addItem('host_screen.php?hostid=' . $this->data['hostid'] . '&screenid=' . $screen['screenid'], $screen['name']);
        }
        $controls->addItem($screenComboBox)->addItem(get_icon('fullscreen', ['fullscreen' => $this->data['fullscreen']]));
        $screenWidget->setControls($controls);
    }
    // append screens to widget
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:monitoring.hostscreen.php

示例3: getRequest

}
// create history screen
$screen = CScreenBuilder::getScreen(['resourcetype' => SCREEN_RESOURCE_HISTORY, 'action' => $this->data['action'], 'itemids' => $data['itemids'], 'profileIdx' => $profileIdx, 'profileIdx2' => $profileIdx2, 'updateProfile' => $updateProfile, 'period' => $this->data['period'], 'stime' => $this->data['stime'], 'filter' => getRequest('filter'), 'filter_task' => getRequest('filter_task'), 'mark_color' => getRequest('mark_color'), 'plaintext' => $this->data['plaintext'], 'graphtype' => $this->data['graphtype']]);
// append plaintext to widget
if ($this->data['plaintext']) {
    foreach ($headerPlaintext as $text) {
        $historyWidget->addItem([new CSpan($text), BR()]);
    }
    $screen = $screen->get();
    $pre = new CPre();
    foreach ($screen as $text) {
        $pre->addItem([$text, BR()]);
    }
    $historyWidget->addItem($pre);
} else {
    $historyWidget->setTitle($header['left'])->setControls($header['right']);
    if (isset($this->data['iv_string'][$this->data['value_type']])) {
        $filterForm->addNavigator();
    }
    if (in_array($this->data['action'], [HISTORY_VALUES, HISTORY_GRAPH, HISTORY_BATCH_GRAPH])) {
        if (!isset($filterForm)) {
            $filterForm = new CFilter('web.history.filter.state');
        }
        // display the graph type filter for graphs with multiple items
        if ($this->data['action'] == HISTORY_BATCH_GRAPH) {
            $filterForm->addColumn((new CFormList())->addRow(_('Graph type'), (new CRadioButtonList('graphtype', (int) $this->data['graphtype']))->addValue(_('Normal'), GRAPH_TYPE_NORMAL)->addValue(_('Stacked'), GRAPH_TYPE_STACKED)->setModern(true)));
            $filterForm->removeButtons();
            $filterForm->addVar('fullscreen', $this->data['fullscreen']);
            $filterForm->addVar('action', $this->data['action']);
            $filterForm->addVar('itemids', $this->data['itemids']);
        }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:monitoring.history.php

示例4: CWidget

** 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.
**/
$triggersWidget = new CWidget();
// append host summary to widget header
if (!empty($this->data['hostid'])) {
    $hostTableElement = $this->data['elements_field'] == 'group_graphid' ? 'graphs' : 'trigger';
    $triggersWidget->addItem(get_header_host_table($hostTableElement, $this->data['hostid']));
}
if (!empty($this->data['title'])) {
    $triggersWidget->setTitle($this->data['title']);
}
// create form
$triggersForm = (new CForm())->setName('triggersForm')->addVar($this->data['elements_field'], $this->data['elements'])->addVar('hostid', $this->data['hostid'])->addVar('action', $this->data['action']);
// create form list
$triggersFormList = new CFormList('triggersFormList');
// append copy types to form list
$triggersFormList->addRow(_('Target type'), new CComboBox('copy_type', $this->data['copy_type'], 'submit()', [COPY_TYPE_TO_HOST => _('Hosts'), COPY_TYPE_TO_TEMPLATE => _('Templates'), COPY_TYPE_TO_HOST_GROUP => _('Host groups')]));
// append groups to form list
if ($this->data['copy_type'] == COPY_TYPE_TO_HOST || $this->data['copy_type'] == COPY_TYPE_TO_TEMPLATE) {
    $groupComboBox = new CComboBox('copy_groupid', $this->data['copy_groupid'], 'submit()');
    foreach ($this->data['groups'] as $group) {
        if (empty($this->data['copy_groupid'])) {
            $this->data['copy_groupid'] = $group['groupid'];
        }
        $groupComboBox->addItem($group['groupid'], $group['name']);
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:configuration.copy.elements.php


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