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


PHP CDiv::addStyle方法代码示例

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


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

示例1: get

 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     $image = new CImg('map.php?noedit=1&sysmapid=' . $this->screenitem['resourceid'] . '&width=' . $this->screenitem['width'] . '&height=' . $this->screenitem['height'] . '&curtime=' . time());
     $image->setAttribute('id', 'map_' . $this->screenitem['screenitemid']);
     if ($this->mode == SCREEN_MODE_PREVIEW) {
         $sysmap = API::Map()->get(array('sysmapids' => $this->screenitem['resourceid'], 'output' => API_OUTPUT_EXTEND, 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'expandUrls' => true, 'nopermissions' => true, 'preservekeys' => true));
         $sysmap = reset($sysmap);
         $actionMap = getActionMapBySysmap($sysmap);
         $image->setMap($actionMap->getName());
         $output = array($actionMap, $image);
     } elseif ($this->mode == SCREEN_MODE_EDIT) {
         $output = array($image, BR(), new CLink(_('Change'), $this->action));
     } else {
         $output = array($image);
     }
     $this->insertFlickerfreeJs();
     $div = new CDiv($output, 'map-container flickerfreescreen', $this->getScreenId());
     $div->setAttribute('data-timestamp', $this->timestamp);
     $div->addStyle('position: relative;');
     return $div;
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:26,代码来源:CScreenMap.php

示例2: CCheckbox

             $checked = uint_in_array($node['nodeid'], $ZBX_VIEWED_NODES['nodeids']);
             $combo_select_node = new CCheckbox('selected_nodes[' . $node['nodeid'] . ']', $checked, null, $node['nodeid']);
             // If not exist parent for node, link it to root (0)
             if (!isset($available_nodes[$node['masterid']])) {
                 $node['masterid'] = 0;
             }
             $node_tree[$node['nodeid']] = array('id' => $node['nodeid'], 'caption' => $node['name'], 'combo_select_node' => $combo_select_node, 'parentid' => $node['masterid']);
         }
         $node_tree_captions = array('caption' => bold(S_NODE), 'combo_select_node' => SPACE);
         $node_tree = new CTree('nodes', $node_tree, $node_tree_captions);
         // --- ---
         $div_node_tree = new CDiv();
         $div_node_tree->additem($node_tree->getHTML());
         $div_node_tree->additem(new CButton('select_nodes', S_SELECT, "javascript: " . " hidePopupDiv('select_iframe');" . " \$('div_node_tree').setStyle({display:'none'});"));
         $div_node_tree->setAttribute('id', 'div_node_tree');
         $div_node_tree->addStyle('display: none');
         if (!is_null($combo_node_list)) {
             $node_form->addItem(array(new CSpan(S_CURRENT_NODE, 'textcolorstyles'), $combo_node_list));
         }
         $node_form->addItem($button_show_tree);
         $node_form->addItem($div_node_tree);
         unset($combo_node_list);
     }
 }
 // 1st level menu
 $table = new CTable();
 $table->setCellSpacing(0);
 $table->setCellPadding(0);
 $table->setAttribute('style', 'width: 100%;');
 $r_col = new CCol($node_form);
 $r_col->setAttribute('align', 'right');
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:page_header.php

示例3: make_latest_issues

/**
 * Create DIV with latest problem triggers.
 *
 * If no sortfield and sortorder are defined, the sort indicater in the column name will not be displayed.
 *
 * @param array  $filter['screenid']
 * @param array  $filter['groupids']
 * @param array  $filter['hostids']
 * @param array  $filter['maintenance']
 * @param int    $filter['extAck']
 * @param int    $filter['severity']
 * @param int    $filter['limit']
 * @param string $filter['sortfield']
 * @param string $filter['sortorder']
 * @param string $filter['backUrl']
 *
 * @return CDiv
 */
function make_latest_issues(array $filter = array())
{
    // hide the sort indicator if no sortfield and sortorder are given
    $showSortIndicator = isset($filter['sortfield']) || isset($filter['sortorder']);
    if (!isset($filter['sortfield'])) {
        $filter['sortfield'] = 'lastchange';
    }
    if (!isset($filter['sortorder'])) {
        $filter['sortorder'] = ZBX_SORT_DOWN;
    }
    $options = array('groupids' => $filter['groupids'], 'hostids' => isset($filter['hostids']) ? $filter['hostids'] : null, 'monitored' => true, 'maintenance' => $filter['maintenance'], 'filter' => array('priority' => $filter['severity'], 'value' => TRIGGER_VALUE_TRUE));
    $triggers = API::Trigger()->get(array_merge($options, array('withLastEventUnacknowledged' => isset($filter['extAck']) && $filter['extAck'] == EXTACK_OPTION_UNACK ? true : null, 'skipDependent' => true, 'output' => array('triggerid', 'state', 'error', 'url', 'expression', 'description', 'priority', 'lastchange'), 'selectHosts' => array('hostid', 'name'), 'selectLastEvent' => array('eventid', 'acknowledged', 'objectid', 'clock', 'ns'), 'sortfield' => $filter['sortfield'], 'sortorder' => $filter['sortorder'], 'limit' => isset($filter['limit']) ? $filter['limit'] : DEFAULT_LATEST_ISSUES_CNT)));
    // don't use withLastEventUnacknowledged and skipDependent because of performance issues
    $triggersTotalCount = API::Trigger()->get(array_merge($options, array('countOutput' => true)));
    // get acknowledges
    $eventIds = array();
    foreach ($triggers as $trigger) {
        if ($trigger['lastEvent']) {
            $eventIds[] = $trigger['lastEvent']['eventid'];
        }
    }
    if ($eventIds) {
        $eventAcknowledges = API::Event()->get(array('eventids' => $eventIds, 'select_acknowledges' => API_OUTPUT_EXTEND, 'preservekeys' => true));
    }
    foreach ($triggers as $tnum => $trigger) {
        // if trigger is lost (broken expression) we skip it
        if (empty($trigger['hosts'])) {
            unset($triggers[$tnum]);
            continue;
        }
        $host = reset($trigger['hosts']);
        $trigger['hostid'] = $host['hostid'];
        $trigger['hostname'] = $host['name'];
        if ($trigger['lastEvent']) {
            $trigger['lastEvent']['acknowledges'] = isset($eventAcknowledges[$trigger['lastEvent']['eventid']]) ? $eventAcknowledges[$trigger['lastEvent']['eventid']]['acknowledges'] : null;
        }
        $triggers[$tnum] = $trigger;
    }
    $hostIds = zbx_objectValues($triggers, 'hostid');
    // get hosts
    $hosts = API::Host()->get(array('hostids' => $hostIds, 'output' => array('hostid', 'name', 'status', 'maintenance_status', 'maintenance_type', 'maintenanceid'), 'selectScreens' => API_OUTPUT_COUNT, 'preservekeys' => true));
    // actions
    $actions = getEventActionsStatHints($eventIds);
    // ack params
    $ackParams = isset($filter['screenid']) ? array('screenid' => $filter['screenid']) : array();
    $config = select_config();
    // indicator of sort field
    if ($showSortIndicator) {
        $sortDiv = new CDiv(SPACE, $filter['sortorder'] === ZBX_SORT_DOWN ? 'icon_sortdown default_cursor' : 'icon_sortup default_cursor');
        $sortDiv->addStyle('float: left');
        $hostHeaderDiv = new CDiv(array(_('Host'), SPACE));
        $hostHeaderDiv->addStyle('float: left');
        $issueHeaderDiv = new CDiv(array(_('Issue'), SPACE));
        $issueHeaderDiv->addStyle('float: left');
        $lastChangeHeaderDiv = new CDiv(array(_('Time'), SPACE));
        $lastChangeHeaderDiv->addStyle('float: left');
    }
    $table = new CTableInfo(_('No events found.'));
    $table->setHeader(array(is_show_all_nodes() ? _('Node') : null, $showSortIndicator && $filter['sortfield'] === 'hostname' ? array($hostHeaderDiv, $sortDiv) : _('Host'), $showSortIndicator && $filter['sortfield'] === 'priority' ? array($issueHeaderDiv, $sortDiv) : _('Issue'), $showSortIndicator && $filter['sortfield'] === 'lastchange' ? array($lastChangeHeaderDiv, $sortDiv) : _('Last change'), _('Age'), _('Info'), $config['event_ack_enable'] ? _('Ack') : null, _('Actions')));
    $scripts = API::Script()->getScriptsByHosts($hostIds);
    // triggers
    foreach ($triggers as $trigger) {
        $host = $hosts[$trigger['hostid']];
        $hostName = new CSpan($host['name'], 'link_menu');
        $hostName->setMenuPopup(getMenuPopupHost($host, $scripts[$host['hostid']]));
        // add maintenance icon with hint if host is in maintenance
        $maintenanceIcon = null;
        if ($host['maintenance_status']) {
            $maintenanceIcon = new CDiv(null, 'icon-maintenance-abs');
            // get maintenance
            $maintenances = API::Maintenance()->get(array('maintenanceids' => $host['maintenanceid'], 'output' => API_OUTPUT_EXTEND, 'limit' => 1));
            if ($maintenance = reset($maintenances)) {
                $hint = $maintenance['name'] . ' [' . ($host['maintenance_type'] ? _('Maintenance without data collection') : _('Maintenance with data collection')) . ']';
                if (isset($maintenance['description'])) {
                    // double quotes mandatory
                    $hint .= "\n" . $maintenance['description'];
                }
                $maintenanceIcon->setHint($hint);
                $maintenanceIcon->addClass('pointer');
            }
            $hostName->addClass('left-to-icon-maintenance-abs');
        }
//.........这里部分代码省略.........
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:101,代码来源:blocks.inc.php

示例4: CFormList

** 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.
**/
include 'include/views/js/administration.general.triggerSeverity.js.php';
$severityTab = new CFormList('scriptsTab');
$headerDiv = new CDiv(_('Custom severity'), 'inlineblock');
$headerDiv->addStyle('width: 16.3em; margin-left: 3px; zoom:1; *display: inline;');
$severityTab->addRow(SPACE, array($headerDiv, _('Colour')));
$severityNameTB0 = new CTextBox('severity_name_0', $this->data['config']['severity_name_0']);
$severityNameTB0->addStyle('width: 15em;');
$severityNameTB0->setAttribute('maxlength', 32);
$severityColorTB0 = new CColor('severity_color_0', $this->data['config']['severity_color_0']);
$severityTab->addRow(_('Not classified'), array($severityNameTB0, SPACE, $severityColorTB0));
$severityNameTB1 = new CTextBox('severity_name_1', $this->data['config']['severity_name_1']);
$severityNameTB1->addStyle('width: 15em;');
$severityNameTB1->setAttribute('maxlength', 32);
$severityColorTB1 = new CColor('severity_color_1', $this->data['config']['severity_color_1']);
$severityTab->addRow(_('Information'), array($severityNameTB1, SPACE, $severityColorTB1));
$severityNameTB2 = new CTextBox('severity_name_2', $this->data['config']['severity_name_2']);
$severityNameTB2->addStyle('width: 15em;');
$severityNameTB2->setAttribute('maxlength', 32);
$severityColorTB2 = new CColor('severity_color_2', $this->data['config']['severity_color_2']);
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:administration.general.triggerSeverity.edit.php

示例5: CSpan

            $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));
}
// clearing the float
$clearFixDiv = new CDiv();
$clearFixDiv->addStyle('clear: both;');
$inventoryFormList->addRow('', $clearFixDiv);
$divTabs->addTab('inventoryTab', _('Host inventory'), $inventoryFormList);
$frmHost->addItem($divTabs);
/*
 * footer
 */
$others = array();
// do not display the clone and delete buttons for clone forms and new host forms
if (getRequest('hostid') && !in_array(getRequest('form'), array('clone', 'full_clone'))) {
    $others[] = new CSubmit('clone', _('Clone'));
    $others[] = new CSubmit('full_clone', _('Full clone'));
    $others[] = new CButtonDelete(_('Delete selected host?'), url_param('form') . url_param('hostid') . url_param('groupid'));
}
$others[] = new CButtonCancel(url_param('groupid'));
$frmHost->addItem(makeFormFooter(new CSubmit('save', _('Save')), $others));
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.edit.php

示例6: CButton

$exprTable->setFooter(new CButton('add', _('Add'), null, 'link_menu exprAdd'));
$exprTab->addRow(_('Expressions'), new CDiv($exprTable, 'inlineblock border_dotted objectgroup'));
$exprForm = new CTable(null, 'formElementTable');
$exprForm->addRow(array(_('Expression'), new CTextBox('expressionNew', null, ZBX_TEXTBOX_STANDARD_SIZE)));
$exprForm->addRow(array(_('Expression type'), new CComboBox('typeNew', null, null, expression_type2str())));
$exprForm->addRow(array(_('Delimiter'), new CComboBox('delimiterNew', null, null, expressionDelimiters())), null, 'delimiterNewRow');
$exprForm->addRow(array(_('Case sensitive'), new CCheckBox('case_sensitiveNew')));
$exprFormFooter = array(new CButton('saveExpression', _('Add'), null, 'link_menu'), SPACE, new CButton('cancelExpression', _('Cancel'), null, 'link_menu'));
$exprTab->addRow(null, new CDiv(array($exprForm, $exprFormFooter), 'objectgroup inlineblock border_dotted'), true, 'exprForm');
/*
 * Test tab
 */
$testTab = new CFormList('testTab');
$testTab->addRow(_('Test string'), new CTextArea('test_string', $this->get('test_string')));
$preloaderDiv = new CDiv(null, 'preloader', 'testPreloader');
$preloaderDiv->addStyle('display: none');
$testTab->addRow(SPACE, array(new CButton('testExpression', _('Test expressions')), $preloaderDiv));
$tabExp = new CTableInfo(null);
$tabExp->attr('id', 'testResultTable');
$tabExp->setHeader(array(_('Expression'), _('Expression type'), _('Result')));
$testTab->addRow(_('Result'), $tabExp);
$regExpView = new CTabView();
if (!$this->data['form_refresh']) {
    $regExpView->setSelected(0);
}
$regExpView->addTab('expr', _('Expressions'), $exprTab);
$regExpView->addTab('test', _('Test'), $testTab);
$form->addItem($regExpView);
// footer
if (isset($this->data['regexpid'])) {
    $form->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CButton('clone', _('Clone')), new CButtonDelete(_('Delete regular expression?'), url_param('regexpid') . url_param('regexp.massdelete', false, 'action')), new CButtonCancel())));
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:administration.general.regularexpressions.edit.php

示例7: CFormList

** 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.
**/
include 'include/views/js/administration.general.triggerDisplayOptions.js.php';
$triggerDOFormList = new CFormList('scriptsTab');
$headerDiv = new CDiv(_('Colour'), 'inlineblock trigger_displaying_form_col');
$headerDiv->addStyle('margin-left: 2px;');
$triggerDOFormList->addRow(SPACE, array($headerDiv, _('Blinking')));
// Unacknowledged problem events
$triggerDOFormList->addRow(_('Unacknowledged PROBLEM events'), array(new CDiv(new CColor('problem_unack_color', $this->data['problem_unack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('problem_unack_style', $this->data['problem_unack_style'] == 1, null, 1)));
// Acknowledged problem events
$triggerDOFormList->addRow(_('Acknowledged PROBLEM events'), array(new CDiv(new CColor('problem_ack_color', $this->data['problem_ack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('problem_ack_style', $this->data['problem_ack_style'] == 1, null, 1)));
// Unacknowledged recovery events
$triggerDOFormList->addRow(_('Unacknowledged OK events'), array(new CDiv(new CColor('ok_unack_color', $this->data['ok_unack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('ok_unack_style', $this->data['ok_unack_style'] == 1, null, 1)));
// Acknowledged recovery events
$triggerDOFormList->addRow(_('Acknowledged OK events'), array(new CDiv(new CColor('ok_ack_color', $this->data['ok_ack_color']), 'inlineblock trigger_displaying_form_col'), new CCheckBox('ok_ack_style', $this->data['ok_ack_style'] == 1, null, 1)));
// some air between the sections
$triggerDOFormList->addRow(BR());
// Display OK triggers
$okPeriodTextBox = new CTextBox('ok_period', $this->data['ok_period']);
$okPeriodTextBox->addStyle('width: 4em;');
$okPeriodTextBox->setAttribute('maxlength', '6');
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:administration.general.triggerDisplayOptions.edit.php

示例8: getOutput

 /**
  * Get enveloped screen inside container.
  *
  * @param object	$item
  * @param boolean	$insertFlickerfreeJs
  * @param array		$flickerfreeData
  *
  * @return CDiv
  */
 public function getOutput($item = null, $insertFlickerfreeJs = true, $flickerfreeData = array())
 {
     if ($insertFlickerfreeJs) {
         $this->insertFlickerfreeJs($flickerfreeData);
     }
     if ($this->mode == SCREEN_MODE_EDIT) {
         $div = new CDiv(array($item, BR(), new CLink(_('Change'), $this->action)), 'flickerfreescreen', $this->getScreenId());
     } else {
         $div = new CDiv($item, 'flickerfreescreen', $this->getScreenId());
     }
     $div->setAttribute('data-timestamp', $this->timestamp);
     $div->addStyle('position: relative;');
     return $div;
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:23,代码来源:CScreenBase.php

示例9: CComboBox

 // Draw type selector
 $cmbDrawType = new CComboBox('draw_type', $draw_type);
 foreach (graph_item_drawtypes() as $dt) {
     $cmbDrawType->addItem($dt, graph_item_drawtype2str($dt));
 }
 // Yaxisside selector
 $cmbYaxisside = new CComboBox('yaxisside', $yaxisside);
 foreach (array(0, 1) as $side) {
     $cmbYaxisside->addItem($side, $side == 0 ? _('Left') : _('Right'));
 }
 $graph_params_w = new CWidget();
 $graph_params_w->setClass('header');
 $graph_params_w->addHeader(_('Graphs'));
 $graph_params_div = new CDiv();
 $graph_params_div->setAttribute("id", "graphparams");
 $graph_params_div->addStyle("width: {$right_widget_width};");
 $graph_params_tbl = new CTable();
 $graph_params_tbl->attr('class', 'formtable');
 $graph_params_tbl->addStyle("width: 100%; align: left; border-width: 0 0 0 0;");
 $graph_params_tbl->setCellPadding(0);
 $graph_params_tbl->setCellSpacing(0);
 $graph_params_tbl1 = new CTable();
 $graph_params_tbl1->attr('class', 'formtable');
 $graph_params_tbl1->addStyle("width: 100%; align: left; border-width: 0 0 0 0;");
 $graph_params_tbl1->addRow(array(_('Create graph'), $graphCreate, _('Name') . ':', $graphName, _('Width') . ':', $graphWidth, _('Height') . ':', $graphHeight, _('Graph type') . ':', $cmbGraphType));
 $graph_params_tbl2 = new CTable();
 $graph_params_tbl2->attr('class', 'formtable');
 $graph_params_tbl2->addStyle("width: 100%; align: left; border-width: 0 0 0 0;");
 $graph_params_tbl2->addRow(array(_('Function') . ':', $cmbGraphFunc, _('Draw style') . ':', $cmbDrawType, _('Y axis side') . ':', $cmbYaxisside));
 $graph_params_tbl->addRow($graph_params_tbl1);
 $graph_params_tbl->addRow($graph_params_tbl2);
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:snmp_builder.php

示例10: insert_mass_update_host_form


//.........这里部分代码省略.........
    $vbox = new CVisibilityBox('visible[template_table]', isset($visible['template_table']), 'template_table', S_ORIGINAL);
    $vbox->setAttribute('id', 'cb_tpladd');
    if (isset($visible['template_table_r'])) {
        $vbox->setAttribute('disabled', 'disabled');
    }
    $action = $vbox->getAttribute('onclick');
    $action .= 'if($("cb_tplrplc").disabled) $("cb_tplrplc").enable(); else $("cb_tplrplc").disable();';
    $vbox->setAttribute('onclick', $action);
    $frmHost->addRow(array($vbox, S_LINK_ADDITIONAL_TEMPLATES), $template_table, 'T');
    // }}} LINK TEMPLATES
    // RELINK TEMPLATES {{{
    $template_table_r = new CTable();
    $template_table_r->setAttribute('name', 'template_table_r');
    $template_table_r->setAttribute('id', 'template_table_r');
    $template_table_r->setCellPadding(0);
    $template_table_r->setCellSpacing(0);
    foreach ($templates as $id => $temp_name) {
        $frmHost->addVar('templates[' . $id . ']', $temp_name);
        $template_table_r->addRow(array(new CCheckBox('templates_rem[' . $id . ']', 'no', null, $id), $temp_name));
    }
    $template_table_r->addRow(array(new CButton('add_template', S_ADD, "return PopUp('popup.php?dstfrm=" . $frmHost->getName() . "&dstfld1=new_template&srctbl=templates&srcfld1=hostid&srcfld2=host" . url_param($templates, false, 'existed_templates') . "',450,450)"), new CButton('unlink', S_REMOVE)));
    $vbox = new CVisibilityBox('visible[template_table_r]', isset($visible['template_table_r']), 'template_table_r', S_ORIGINAL);
    $vbox->setAttribute('id', 'cb_tplrplc');
    if (isset($visible['template_table'])) {
        $vbox->setAttribute('disabled', 'disabled');
    }
    $action = $vbox->getAttribute('onclick');
    $action .= <<<JAVASCRIPT
if(\$("cb_tpladd").disabled){
\t\$("cb_tpladd").enable();
}
else{
\t\$("cb_tpladd").disable();
}
\$("clrcbdiv").toggle();
JAVASCRIPT;
    $vbox->setAttribute('onclick', $action);
    $clear_cb = new CCheckBox('mass_clear_tpls', get_request('mass_clear_tpls', false));
    $div = new CDiv(array($clear_cb, S_CLEAR_WHEN_UNLINKING));
    $div->setAttribute('id', 'clrcbdiv');
    $div->addStyle('margin-left: 20px;');
    if (!isset($visible['template_table_r'])) {
        $div->addStyle('display: none;');
    }
    $frmHost->addRow(array($vbox, S_RELINK_TEMPLATES, $div), $template_table_r, 'T');
    // }}} RELINK TEMPLATES
    $frmHost->addRow(array(new CVisibilityBox('visible[useipmi]', isset($visible['useipmi']), 'useipmi', S_ORIGINAL), S_USEIPMI), new CCheckBox('useipmi', $useipmi, 'submit()'));
    if ($useipmi == 'yes') {
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_ip]', isset($visible['ipmi_ip']), 'ipmi_ip', S_ORIGINAL), S_IPMI_IP_ADDRESS), new CTextBox('ipmi_ip', $ipmi_ip, defined('ZBX_HAVE_IPV6') ? 39 : 15));
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_port]', isset($visible['ipmi_port']), 'ipmi_port', S_ORIGINAL), S_IPMI_PORT), new CNumericBox('ipmi_port', $ipmi_port, 15));
        $cmbIPMIAuthtype = new CComboBox('ipmi_authtype', $ipmi_authtype);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_DEFAULT, S_AUTHTYPE_DEFAULT);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_NONE, S_AUTHTYPE_NONE);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_MD2, S_AUTHTYPE_MD2);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_MD5, S_AUTHTYPE_MD5);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_STRAIGHT, S_AUTHTYPE_STRAIGHT);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_OEM, S_AUTHTYPE_OEM);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_RMCP_PLUS, S_AUTHTYPE_RMCP_PLUS);
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_authtype]', isset($visible['ipmi_authtype']), 'ipmi_authtype', S_ORIGINAL), S_IPMI_AUTHTYPE), $cmbIPMIAuthtype);
        $cmbIPMIPrivilege = new CComboBox('ipmi_privilege', $ipmi_privilege);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_CALLBACK, S_PRIVILEGE_CALLBACK);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_USER, S_PRIVILEGE_USER);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_OPERATOR, S_PRIVILEGE_OPERATOR);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_ADMIN, S_PRIVILEGE_ADMIN);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_OEM, S_PRIVILEGE_OEM);
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_privilege]', isset($visible['ipmi_privilege']), 'ipmi_privilege', S_ORIGINAL), S_IPMI_PRIVILEGE), $cmbIPMIPrivilege);
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_username]', isset($visible['ipmi_username']), 'ipmi_username', S_ORIGINAL), S_IPMI_USERNAME), new CTextBox('ipmi_username', $ipmi_username, 16));
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_password]', isset($visible['ipmi_password']), 'ipmi_password', S_ORIGINAL), S_IPMI_PASSWORD), new CTextBox('ipmi_password', $ipmi_password, 20));
    }
    $frmHost->addRow(array(new CVisibilityBox('visible[useprofile]', isset($visible['useprofile']), 'useprofile', S_ORIGINAL), S_USE_PROFILE), new CCheckBox('useprofile', $useprofile, 'submit()'));
    // BEGIN: HOSTS PROFILE EXTENDED Section
    $frmHost->addRow(array(new CVisibilityBox('visible[useprofile_ext]', isset($visible['useprofile_ext']), 'useprofile_ext', S_ORIGINAL), S_USE_EXTENDED_PROFILE), new CCheckBox('useprofile_ext', $useprofile_ext, 'submit()'));
    // END:   HOSTS PROFILE EXTENDED Section
    if ($useprofile === 'yes') {
        if ($useprofile === 'yes') {
            foreach ($profile_fields as $field => $caption) {
                $frmHost->addRow(array(new CVisibilityBox('visible[' . $field . ']', isset($visible[$field]), 'host_profile[' . $field . ']', S_ORIGINAL), $caption), new CTextBox('host_profile[' . $field . ']', $host_profile[$field], 80));
            }
        } else {
            foreach ($profile_fields as $field => $caption) {
                $frmHost->addVar('host_profile[' . $field . ']', $host_profile[$field]);
            }
        }
    }
    // BEGIN: HOSTS PROFILE EXTENDED Section
    if ($useprofile_ext == 'yes') {
        foreach ($ext_profiles_fields as $prof_field => $caption) {
            $frmHost->addRow(array(new CVisibilityBox('visible[' . $prof_field . ']', isset($visible[$prof_field]), 'ext_host_profiles[' . $prof_field . ']', S_ORIGINAL), $caption), new CTextBox('ext_host_profiles[' . $prof_field . ']', $ext_host_profiles[$prof_field], 80));
        }
    } else {
        foreach ($ext_profiles_fields as $prof_field => $caption) {
            $frmHost->addVar('ext_host_profiles[' . $prof_field . ']', $ext_host_profiles[$prof_field]);
        }
    }
    // END:   HOSTS PROFILE EXTENDED Section
    $frmHost->addItemToBottomRow(new CButton('masssave', S_SAVE));
    $frmHost->addItemToBottomRow(SPACE);
    $frmHost->addItemToBottomRow(new CButtonCancel(url_param('config') . url_param('groupid')));
    return $frmHost;
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:forms.inc.php

示例11: CWidget

 //Oidview
 $oid_view_w = new CWidget();
 $oid_view_w->setClass('header');
 $oid_view_w->addHeader(array("Oid View - click to view as table:", new CCheckBox('viewtype', 'no', 'onViewType()', 1)));
 $oid_view_div = new CDiv();
 $oid_view_div->setAttribute("id", "oidview");
 $oid_view_div->addStyle("overflow: auto; max-height: 250px; width: 800px");
 $oid_view_w->addItem($oid_view_div);
 $right_tab->addRow($oid_view_w);
 //Itemlist
 $item_list_w = new CWidget();
 $item_list_w->setClass('header');
 $item_list_w->addHeader("Item List");
 $item_list_div = new CDiv();
 $item_list_div->setAttribute("id", "itemlist");
 $item_list_div->addStyle("overflow: auto; max-height: 150px; width: 800px");
 $item_list_w->addItem($item_list_div);
 $right_tab->addRow($item_list_w);
 //Action srow
 $action_w = new CWidget();
 $action_w->setClass('header');
 $action_w->addHeader(array(new CButton('save', 'Save', 'javascript: onSaveItems()'), SPACE, new CButton('clear', 'Clear List', 'javascript: onClearItems()')));
 //$action_div = new CDiv();
 //$action_w->addItem($action_div);
 $right_tab->addRow($action_w);
 // Left panel
 $td_l = new CCol($left_tab);
 $td_l->setAttribute('valign', 'top');
 $td_l->setAttribute('width', '300px');
 //Right panel
 $td_r = new CCol($right_tab);
开发者ID:vikerian,项目名称:snmpbuilder,代码行数:31,代码来源:snmp_builder.php


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