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


PHP CCol::setColSpan方法代码示例

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


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

示例1: bodyToString

 public function bodyToString()
 {
     $res = parent::bodyToString();
     $tbl = new CTable(null, $this->tableclass);
     $tbl->setCellSpacing(0);
     $tbl->setCellPadding(1);
     $tbl->setAlign($this->align);
     // add first row
     if (!is_null($this->title)) {
         $col = new CCol(null, 'form_row_first');
         $col->setColSpan(2);
         if (isset($this->help)) {
             $col->addItem($this->help);
         }
         if (isset($this->title)) {
             $col->addItem($this->title);
         }
         $tbl->setHeader($col);
     }
     // add last row
     $tbl->setFooter($this->bottom_items);
     // add center rows
     foreach ($this->center_items as $item) {
         $tbl->addRow($item);
     }
     return $res . $tbl->toString();
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:27,代码来源:class.cformtable.php

示例2: CLink

        }
    } else {
        if (empty($apps)) {
            $url = '?open=1&applicationid=0';
        } else {
            if (isset($apps[0])) {
                $url = '?close=1' . url_param($tmp_apps, false, 'apps');
            } else {
                $url = '?close=1&applicationid=0' . url_param($tmp_apps, false, 'apps');
            }
        }
    }
    $url .= url_param('groupid') . url_param('hostid') . url_param('fullscreen') . url_param('select');
    $link = new CLink($img, $url);
    $col = new CCol(array(bold('- ' . 'other' . ' -'), SPACE . '(' . _n('%1$s Item', '%1$s Items', $db_host['item_cnt']) . ')'));
    $col->setColSpan(5);
    // host JS menu link
    $hostSpan = null;
    if ($_REQUEST['hostid'] == 0) {
        $hostSpan = new CSpan($host['name'], 'link_menu menu-host');
        $scripts = $hostScripts[$host['hostid']];
        $hostSpan->setAttribute('data-menu', hostMenuData($host, $scripts));
    }
    $table->addRow(array($link, get_node_name_by_elid($db_host['hostid']), $hostSpan, $col));
    foreach ($app_rows as $row) {
        $table->addRow($row);
    }
}
$latest_wdgt->addItem($table);
$latest_wdgt->show();
require_once 'include/page_footer.php';
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:latest.php

示例3: array

             $time = 'lastdown';
         }
         $key_ = $dservice['key_'];
         if (!zbx_empty($key_)) {
             if (isset($gMacros[$key_])) {
                 $key_ = $gMacros[$key_]['value'];
             }
             $key_ = ': ' . $key_;
         }
         $service_name = discovery_check_type2str($dservice['type']) . discovery_port2str($dservice['type'], $dservice['port']) . $key_;
         $discovery_info[$dservice['ip']]['services'][$service_name] = array('class' => $class, 'time' => $dservice[$time]);
     }
 }
 if ($druleid == 0 && !empty($discovery_info)) {
     $col = new CCol(array(bold($drule['name']), SPACE . '(' . count($discovery_info) . SPACE . S_ITEMS . ')'));
     $col->setColSpan(count($services) + 3);
     $table->addRow(array(get_node_name_by_elid($drule['druleid']), $col));
 }
 order_result($discovery_info, $_REQUEST['sort'], $_REQUEST['sortorder']);
 foreach ($discovery_info as $ip => $h_data) {
     $table_row = array(get_node_name_by_elid($h_data['druleid']), $h_data['type'] == 'primary' ? new CSpan($ip, $h_data['class']) : new CSpan(SPACE . SPACE . $ip), new CSpan(empty($h_data['host']) ? '-' : $h_data['host']), new CSpan($h_data['time'] == 0 || $h_data['type'] === 'slave' ? '' : convert_units(time() - $h_data['time'], 'uptime'), $h_data['class']));
     foreach ($services as $name => $foo) {
         $class = null;
         $time = SPACE;
         $hint = new CDiv(SPACE, $class);
         $hintTable = null;
         if (isset($h_data['services'][$name])) {
             $class = $h_data['services'][$name]['class'];
             $time = $h_data['services'][$name]['time'];
             $hintTable = new CTableInfo();
             $hintTable->setAttribute('style', 'width: auto;');
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:discovery.php

示例4: bodyToString

 public function bodyToString()
 {
     parent::bodyToString();
     $tbl = new CTable(NULL, $this->tableclass);
     $tbl->setOddRowClass('form_odd_row');
     $tbl->setEvenRowClass('form_even_row');
     $tbl->setCellSpacing(0);
     $tbl->setCellPadding(1);
     $tbl->setAlign($this->align);
     // add first row
     $col = new CCol(NULL, 'form_row_first');
     $col->setColSpan(2);
     if (isset($this->help)) {
         $col->addItem($this->help);
     }
     if (isset($this->title)) {
         $col->addItem($this->title);
     }
     foreach ($this->top_items as $item) {
         $col->addItem($item);
     }
     $tbl->setHeader($col);
     // add last row
     $tbl->setFooter($this->bottom_items);
     // add center rows
     foreach ($this->center_items as $item) {
         $tbl->addRow($item);
     }
     return $tbl->toString();
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:30,代码来源:class.cformtable.php

示例5: make_latest_data

function make_latest_data()
{
    global $USER_DETAILS;
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
    while ($db_app = DBfetch($db_applications)) {
        $db_items = DBselect('SELECT DISTINCT i.* ' . ' FROM items i,items_applications ia' . ' WHERE ia.applicationid=' . $db_app['applicationid'] . ' AND i.itemid=ia.itemid' . ' AND i.status=' . ITEM_STATUS_ACTIVE . order_by('i.description,i.itemid,i.lastclock'));
        $app_rows = array();
        $item_cnt = 0;
        while ($db_item = DBfetch($db_items)) {
            $description = item_description($db_item);
            if (!zbx_empty($_REQUEST['select']) && !zbx_stristr($description, $_REQUEST['select'])) {
                continue;
            }
            ++$item_cnt;
            if (!uint_in_array($db_app['applicationid'], $_REQUEST['applications']) && !isset($show_all_apps)) {
                continue;
            }
            if (isset($db_item['lastclock'])) {
                $lastclock = date(S_DATE_FORMAT_YMDHMS, $db_item['lastclock']);
            } else {
                $lastclock = new CCol('-', 'center');
            }
            $lastvalue = format_lastvalue($db_item);
            if (isset($db_item['lastvalue']) && isset($db_item['prevvalue']) && $db_item['value_type'] == 0 && $db_item['lastvalue'] - $db_item['prevvalue'] != 0) {
                if ($db_item['lastvalue'] - $db_item['prevvalue'] < 0) {
                    $change = convert_units($db_item['lastvalue'] - $db_item['prevvalue'], $db_item['units']);
                } else {
                    $change = '+' . convert_units($db_item['lastvalue'] - $db_item['prevvalue'], $db_item['units']);
                }
                $change = nbsp($change);
            } else {
                $change = new CCol('-', 'center');
            }
            if ($db_item['value_type'] == ITEM_VALUE_TYPE_FLOAT || $db_item['value_type'] == ITEM_VALUE_TYPE_UINT64) {
                $actions = new CLink(S_GRAPH, 'history.php?action=showgraph&itemid=' . $db_item['itemid'], 'action');
            } else {
                $actions = new CLink(S_HISTORY, 'history.php?action=showvalues&period=3600&itemid=' . $db_item['itemid'], 'action');
            }
            array_push($app_rows, new CRow(array(is_show_all_nodes() ? SPACE : null, $_REQUEST['hostid'] > 0 ? NULL : SPACE, str_repeat(SPACE, 6) . $description, $lastclock, new CCol($lastvalue, $lastvalue == '-' ? 'center' : null), $change, $actions)));
        }
        if ($item_cnt > 0) {
            if (uint_in_array($db_app['applicationid'], $_REQUEST['applications']) || isset($show_all_apps)) {
                $link = new CLink(new CImg('images/general/opened.gif'), '?close=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
            } else {
                $link = new CLink(new CImg('images/general/closed.gif'), '?open=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
            }
            $col = new CCol(array($link, SPACE, bold($db_app['name']), SPACE . '(' . $item_cnt . SPACE . S_ITEMS . ')'));
            $col->setColSpan(5);
            $table->ShowRow(array(get_node_name_by_elid($db_app['hostid']), $_REQUEST['hostid'] > 0 ? NULL : $db_app['host'], $col));
            $any_app_exist = true;
            foreach ($app_rows as $row) {
                $table->ShowRow($row);
            }
        }
    }
}
开发者ID:phedders,项目名称:zabbix,代码行数:56,代码来源:blocks.inc.php

示例6: CRow

// row template
$hiddenRowTemplate = new CRow(array(new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move'), $numSpan, $profileLinksComboBox, $expressionTextBox, $iconsComboBox, $iconPreviewImage, new CButton('remove', _('Remove'), '', 'link_menu removeMapping')), 'hidden');
$hiddenRowTemplate->setAttribute('id', 'rowTpl');
$iconMapTable->addRow($hiddenRowTemplate);
// add row button
$addCol = new CCol(new CButton('addMapping', _('Add'), '', 'link_menu'));
$addCol->setColSpan(7);
$iconMapTable->addRow($addCol);
// <default icon row>
$numSpan = new CSpan($i++ . ':');
$numSpan->addClass('rowNum');
$iconsComboBox = new CComboBox('iconmap[default_iconid]', $this->data['iconmap']['default_iconid']);
$iconsComboBox->addClass('mappingIcon');
$iconsComboBox->addItems($this->data['iconList']);
$iconPreviewImage = new CImg('imgstore.php?iconid=' . $this->data['iconmap']['default_iconid'] . '&width=' . ZBX_ICON_PREVIEW_WIDTH . '&height=' . ZBX_ICON_PREVIEW_HEIGHT, _('Preview'), null, null, 'pointer preview');
$iconPreviewImage->setAttribute('data-image-full', 'imgstore.php?iconid=' . $this->data['iconmap']['default_iconid']);
$col = new CCol(_('Default'));
$col->setColSpan(4);
$iconMapTable->addRow(array($col, $iconsComboBox, $iconPreviewImage));
// </default icon row>
$iconMapTab->addRow(_('Mappings'), new CDiv($iconMapTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
$iconMapView = new CTabView();
$iconMapView->addTab('iconmap', _('Icon map'), $iconMapTab);
$iconMapForm->addItem($iconMapView);
// footer
$secondaryActions = array(new CButtonCancel());
if (isset($this->data['iconmapid'])) {
    array_unshift($secondaryActions, new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete icon map?'), url_param('form') . url_param('iconmapid')));
}
$iconMapForm->addItem(makeFormFooter(array(new CSubmit('save', _('Save'))), $secondaryActions));
return $iconMapForm;
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:administration.general.iconmap.edit.php

示例7: foreach

        $i = 1;
        foreach ($trigger['events'] as $enum => $event) {
            $i++;
            $eventStatusSpan = new CSpan(trigger_value2str($event['value']));
            // add colors and blinking to span depending on configuration and trigger parameters
            addTriggerValueStyle($eventStatusSpan, $event['value'], $event['clock'], $event['acknowledged']);
            $statusSpan = new CCol($eventStatusSpan);
            $statusSpan->setColSpan(2);
            $ack = getEventAckState($event, true);
            $ackCheckBox = $event['acknowledged'] == 0 && $event['value'] == TRIGGER_VALUE_TRUE ? new CCheckBox('events[' . $event['eventid'] . ']', 'no', null, $event['eventid']) : SPACE;
            $clock = new CLink(zbx_date2str(_('d M Y H:i:s'), $event['clock']), 'tr_events.php?triggerid=' . $trigger['triggerid'] . '&eventid=' . $event['eventid']);
            $nextClock = isset($trigger['events'][$enum - 1]) ? $trigger['events'][$enum - 1]['clock'] : time();
            $emptyColumn = new CCol(SPACE);
            $emptyColumn->setColSpan(3);
            $ackCheckBoxColumn = new CCol($ackCheckBox);
            $ackCheckBoxColumn->setColSpan(2);
            $row = new CRow(array(SPACE, $config['event_ack_enable'] ? $ackCheckBoxColumn : null, $statusSpan, $clock, zbx_date2age($event['clock']), zbx_date2age($nextClock, $event['clock']), $config['event_ack_enable'] ? $ack : null, $displayNodes ? SPACE : null, $emptyColumn), 'odd_row');
            $row->setAttribute('data-parentid', $trigger['triggerid']);
            $row->addStyle('display: none;');
            $triggerTable->addRow($row);
            if ($i > $config['event_show_max']) {
                break;
            }
        }
    }
}
/*
 * Go buttons
 */
$footer = null;
if ($config['event_ack_enable']) {
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:tr_status.php

示例8: get_timeperiod_form


//.........这里部分代码省略.........
    $new_timeperiod['month_feb'] = $month[1];
    $new_timeperiod['month_mar'] = $month[2];
    $new_timeperiod['month_apr'] = $month[3];
    $new_timeperiod['month_may'] = $month[4];
    $new_timeperiod['month_jun'] = $month[5];
    $new_timeperiod['month_jul'] = $month[6];
    $new_timeperiod['month_aug'] = $month[7];
    $new_timeperiod['month_sep'] = $month[8];
    $new_timeperiod['month_oct'] = $month[9];
    $new_timeperiod['month_nov'] = $month[10];
    $new_timeperiod['month_dec'] = $month[11];
    $bit_dayofweek = strrev($dayofweek);
    $bit_month = strrev($month);
    $cmbType = new CComboBox('new_timeperiod[timeperiod_type]', $new_timeperiod['timeperiod_type'], 'submit()');
    $cmbType->addItem(TIMEPERIOD_TYPE_ONETIME, _('One time only'));
    $cmbType->addItem(TIMEPERIOD_TYPE_DAILY, _('Daily'));
    $cmbType->addItem(TIMEPERIOD_TYPE_WEEKLY, _('Weekly'));
    $cmbType->addItem(TIMEPERIOD_TYPE_MONTHLY, _('Monthly'));
    $tblPeriod->addRow(array(_('Period type'), $cmbType));
    if ($new_timeperiod['timeperiod_type'] == TIMEPERIOD_TYPE_DAILY) {
        $tblPeriod->addItem(new CVar('new_timeperiod[dayofweek]', bindec($bit_dayofweek)));
        $tblPeriod->addItem(new CVar('new_timeperiod[month]', bindec($bit_month)));
        $tblPeriod->addItem(new CVar('new_timeperiod[day]', $new_timeperiod['day']));
        $tblPeriod->addItem(new CVar('new_timeperiod[start_date]', $new_timeperiod['start_date']));
        $tblPeriod->addItem(new CVar('new_timeperiod[month_date_type]', $new_timeperiod['month_date_type']));
        $tblPeriod->addRow(array(_('Every day(s)'), new CNumericBox('new_timeperiod[every]', $new_timeperiod['every'], 3)));
    } elseif ($new_timeperiod['timeperiod_type'] == TIMEPERIOD_TYPE_WEEKLY) {
        $tblPeriod->addItem(new CVar('new_timeperiod[month]', bindec($bit_month)));
        $tblPeriod->addItem(new CVar('new_timeperiod[day]', $new_timeperiod['day']));
        $tblPeriod->addItem(new CVar('new_timeperiod[start_date]', $new_timeperiod['start_date']));
        $tblPeriod->addItem(new CVar('new_timeperiod[month_date_type]', $new_timeperiod['month_date_type']));
        $tblPeriod->addRow(array(_('Every week(s)'), new CNumericBox('new_timeperiod[every]', $new_timeperiod['every'], 2)));
        $tabDays = new CTable();
        $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_mo]', $dayofweek[0], null, 1), _('Monday')));
        $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_tu]', $dayofweek[1], null, 1), _('Tuesday')));
        $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_we]', $dayofweek[2], null, 1), _('Wednesday')));
        $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_th]', $dayofweek[3], null, 1), _('Thursday')));
        $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_fr]', $dayofweek[4], null, 1), _('Friday')));
        $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_sa]', $dayofweek[5], null, 1), _('Saturday')));
        $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_su]', $dayofweek[6], null, 1), _('Sunday')));
        $tblPeriod->addRow(array(_('Day of week'), $tabDays));
    } elseif ($new_timeperiod['timeperiod_type'] == TIMEPERIOD_TYPE_MONTHLY) {
        $tblPeriod->addItem(new CVar('new_timeperiod[start_date]', $new_timeperiod['start_date']));
        $tabMonths = new CTable();
        $tabMonths->addRow(array(new CCheckBox('new_timeperiod[month_jan]', $month[0], null, 1), _('January'), SPACE, SPACE, new CCheckBox('new_timeperiod[month_jul]', $month[6], null, 1), _('July')));
        $tabMonths->addRow(array(new CCheckBox('new_timeperiod[month_feb]', $month[1], null, 1), _('February'), SPACE, SPACE, new CCheckBox('new_timeperiod[month_aug]', $month[7], null, 1), _('August')));
        $tabMonths->addRow(array(new CCheckBox('new_timeperiod[month_mar]', $month[2], null, 1), _('March'), SPACE, SPACE, new CCheckBox('new_timeperiod[month_sep]', $month[8], null, 1), _('September')));
        $tabMonths->addRow(array(new CCheckBox('new_timeperiod[month_apr]', $month[3], null, 1), _('April'), SPACE, SPACE, new CCheckBox('new_timeperiod[month_oct]', $month[9], null, 1), _('October')));
        $tabMonths->addRow(array(new CCheckBox('new_timeperiod[month_may]', $month[4], null, 1), _('May'), SPACE, SPACE, new CCheckBox('new_timeperiod[month_nov]', $month[10], null, 1), _('November')));
        $tabMonths->addRow(array(new CCheckBox('new_timeperiod[month_jun]', $month[5], null, 1), _('June'), SPACE, SPACE, new CCheckBox('new_timeperiod[month_dec]', $month[11], null, 1), _('December')));
        $tblPeriod->addRow(array(_('Month'), $tabMonths));
        $tblPeriod->addRow(array(_('Date'), array(new CRadioButton('new_timeperiod[month_date_type]', '0', null, null, !$new_timeperiod['month_date_type'], 'submit()'), _('Day'), SPACE, new CRadioButton('new_timeperiod[month_date_type]', '1', null, null, $new_timeperiod['month_date_type'], 'submit()'), _('Day of week'))));
        if ($new_timeperiod['month_date_type'] > 0) {
            $tblPeriod->addItem(new CVar('new_timeperiod[day]', $new_timeperiod['day']));
            $cmbCount = new CComboBox('new_timeperiod[every]', $new_timeperiod['every']);
            $cmbCount->addItem(1, _('First'));
            $cmbCount->addItem(2, _('Second'));
            $cmbCount->addItem(3, _('Third'));
            $cmbCount->addItem(4, _('Fourth'));
            $cmbCount->addItem(5, _('Last'));
            $td = new CCol($cmbCount);
            $td->setColSpan(2);
            $tabDays = new CTable();
            $tabDays->addRow($td);
            $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_mo]', $dayofweek[0], null, 1), _('Monday')));
            $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_tu]', $dayofweek[1], null, 1), _('Tuesday')));
            $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_we]', $dayofweek[2], null, 1), _('Wednesday')));
            $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_th]', $dayofweek[3], null, 1), _('Thursday')));
            $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_fr]', $dayofweek[4], null, 1), _('Friday')));
            $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_sa]', $dayofweek[5], null, 1), _('Saturday')));
            $tabDays->addRow(array(new CCheckBox('new_timeperiod[dayofweek_su]', $dayofweek[6], null, 1), _('Sunday')));
            $tblPeriod->addRow(array(_('Day of week'), $tabDays));
        } else {
            $tblPeriod->addItem(new CVar('new_timeperiod[dayofweek]', bindec($bit_dayofweek)));
            $tblPeriod->addRow(array(_('Day of month'), new CNumericBox('new_timeperiod[day]', $new_timeperiod['day'], 2)));
        }
    } else {
        $tblPeriod->addItem(new CVar('new_timeperiod[every]', $new_timeperiod['every'], 'new_timeperiod_every_tmp'));
        $tblPeriod->addItem(new CVar('new_timeperiod[month]', bindec($bit_month), 'new_timeperiod_month_tmp'));
        $tblPeriod->addItem(new CVar('new_timeperiod[day]', $new_timeperiod['day'], 'new_timeperiod_day_tmp'));
        $tblPeriod->addItem(new CVar('new_timeperiod[hour]', $new_timeperiod['hour'], 'new_timeperiod_hour_tmp'));
        $tblPeriod->addItem(new CVar('new_timeperiod[minute]', $new_timeperiod['minute'], 'new_timeperiod_minute_tmp'));
        $tblPeriod->addItem(new CVar('new_timeperiod[start_date]', $new_timeperiod['start_date']));
        $tblPeriod->addItem(new CVar('new_timeperiod[month_date_type]', $new_timeperiod['month_date_type']));
        $tblPeriod->addItem(new CVar('new_timeperiod[dayofweek]', bindec($bit_dayofweek)));
        if (isset($_REQUEST['add_timeperiod'])) {
            $date = array('y' => getRequest('new_timeperiod_start_date_year'), 'm' => getRequest('new_timeperiod_start_date_month'), 'd' => getRequest('new_timeperiod_start_date_day'), 'h' => getRequest('new_timeperiod_start_date_hour'), 'i' => getRequest('new_timeperiod_start_date_minute'));
        } else {
            $date = zbxDateToTime($new_timeperiod['start_date'] ? $new_timeperiod['start_date'] : date(TIMESTAMP_FORMAT_ZERO_TIME, time()));
        }
        $tblPeriod->addRow(array(_('Date'), createDateSelector('new_timeperiod_start_date', $date)));
    }
    if ($new_timeperiod['timeperiod_type'] != TIMEPERIOD_TYPE_ONETIME) {
        $tblPeriod->addRow(array(_('At (hour:minute)'), array(new CNumericBox('new_timeperiod[hour]', $new_timeperiod['hour'], 2), ':', new CNumericBox('new_timeperiod[minute]', $new_timeperiod['minute'], 2))));
    }
    $perHours = new CComboBox('new_timeperiod[period_hours]', $new_timeperiod['period_hours'], null, range(0, 23));
    $perMinutes = new CComboBox('new_timeperiod[period_minutes]', $new_timeperiod['period_minutes'], null, range(0, 59));
    $tblPeriod->addRow(array(_('Maintenance period length'), array(new CNumericBox('new_timeperiod[period_days]', $new_timeperiod['period_days'], 3), _('Days') . SPACE . SPACE, $perHours, _('Hours') . SPACE . SPACE, $perMinutes, _('Minutes'))));
    return $tblPeriod;
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:101,代码来源:forms.inc.php

示例9: CCheckBox

     $chkBox = new CCheckBox('group_httptestid[' . $httptest_data['httptestid'] . ']', null, null, $httptest_data['httptestid']);
     $step_cout = DBfetch(DBselect('select count(*) as cnt from httpstep where httptestid=' . $httptest_data['httptestid']));
     $step_cout = $step_cout['cnt'];
     array_push($app_rows, new CRow(array($chkBox, is_show_all_nodes() ? SPACE : NULL, $_REQUEST['hostid'] > 0 ? NULL : SPACE, array(str_repeat(SPACE, 4), $name), $step_cout, $httptest_data['delay'], $status)));
 }
 unset($app_rows);
 unset($db_app);
 foreach ($tab_rows as $appid => $app_rows) {
     $db_app =& $db_apps[$appid];
     if (uint_in_array($db_app['applicationid'], $_REQUEST['applications']) || isset($show_all_apps)) {
         $link = new CLink(new CImg('images/general/opened.gif'), '?close=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
     } else {
         $link = new CLink(new CImg('images/general/closed.gif'), '?open=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
     }
     $col = new CCol(array($link, SPACE, bold($db_app['name']), SPACE . '(' . $db_app['scenarios_cnt'] . SPACE . S_SCENARIOS . ')'));
     $col->setColSpan(6);
     $table->addRow(array(get_node_name_by_elid($db_app['applicationid']), $_REQUEST['hostid'] > 0 ? NULL : $db_app['host'], $col));
     $any_app_exist = true;
     foreach ($app_rows as $row) {
         $table->addRow($row);
     }
 }
 //----- GO ------
 $goBox = new CComboBox('go');
 $goBox->addItem('activate', S_ACTIVATE_SELECTED);
 $goBox->addItem('disable', S_DISABLE_SELECTED);
 $goBox->addItem('clean_history', S_CLEAN_HISTORY_SELECTED_ITEMS);
 $goBox->addItem('delete', S_DELETE_SELECTED);
 // goButton name is necessary!!!
 $goButton = new CButton('goButton', S_GO . ' (0)');
 $goButton->setAttribute('id', 'goButton');
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:httpconf.php

示例10: array

        $httpTableRows[$db_app['applicationid']] = array();
    }
    if (!uint_in_array($db_app['applicationid'], $_REQUEST['applications']) && !isset($this->data['showAllApps'])) {
        continue;
    }
    $httpTableRows[$db_app['applicationid']][] = array(new CCheckBox('group_httptestid[' . $httptest_data['httptestid'] . ']', null, null, $httptest_data['httptestid']), is_show_all_nodes() ? SPACE : null, $_REQUEST['hostid'] > 0 ? null : $db_app['hostname'], new CLink($httptest_data['name'], '?form=update' . '&httptestid=' . $httptest_data['httptestid'] . '&hostid=' . $db_app['hostid'] . url_param('groupid')), $httptest_data['step_count'], $httptest_data['delay'], new CCol(new CLink(httptest_status2str($httptest_data['status']), '?group_httptestid[]=' . $httptest_data['httptestid'] . '&go=' . ($httptest_data['status'] ? 'activate' : 'disable'), httptest_status2style($httptest_data['status']))));
}
foreach ($httpTableRows as $appid => $app_rows) {
    $db_app = $this->data['db_apps'][$appid];
    if (uint_in_array($db_app['applicationid'], $_REQUEST['applications']) || isset($this->data['showAllApps'])) {
        $link = new CLink(new CImg('images/general/minus.png'), '?close=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
    } else {
        $link = new CLink(new CImg('images/general/plus.png'), '?open=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
    }
    $column = new CCol(array($link, SPACE, bold($db_app['name']), SPACE . '(' . _n('%1$d scenario', '%1$d scenarios', $db_app['scenarios_cnt']) . ')'));
    $column->setColSpan(6);
    $httpTable->addRow(array(get_node_name_by_elid($db_app['applicationid']), $column));
    foreach ($app_rows as $row) {
        $httpTable->addRow($row);
    }
}
// create go buttons
$goComboBox = new CComboBox('go');
$goOption = new CComboItem('activate', _('Enable selected'));
$goOption->setAttribute('confirm', _('Enable selected WEB scenarios?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('disable', _('Disable selected'));
$goOption->setAttribute('confirm', _('Disable selected WEB scenarios?'));
$goComboBox->addItem($goOption);
$goOption = new CComboItem('clean_history', _('Clear history for selected'));
$goOption->setAttribute('confirm', _('Delete history of selected WEB scenarios?'));
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.httpconf.list.php

示例11: CForm

include 'include/views/js/administration.general.valuemapping.edit.js.php';
$valueMappingForm = new CForm();
$valueMappingForm->setName('valueMappingForm');
$valueMappingForm->addVar('form', $this->data['form']);
$valueMappingForm->addVar('form_refresh', $this->data['form_refresh'] + 1);
$valueMappingForm->addVar('valuemapid', $this->data['valuemapid']);
// create form list
$valueMappingFormList = new CFormList('valueMappingFormList');
// name
$valueMappingFormList->addRow(_('Name'), new CTextBox('mapname', $this->data['mapname'], 40, null, 64));
// mappings
$mappingsTable = new CTable(SPACE, 'formElementTable');
$mappingsTable->setAttribute('id', 'mappingsTable');
$mappingsTable->addRow(array(_('Value'), SPACE, _('Mapped to'), SPACE));
$addCol = new CCol(new CButton('addMapping', _('Add'), '', 'link_menu'));
$addCol->setColSpan(4);
$mappingsTable->addRow($addCol);
$valueMappingFormList->addRow(_('Mappings'), new CDiv($mappingsTable, 'border_dotted inlineblock objectgroup'));
// add mappings to form by js
if (empty($this->data['mappings'])) {
    zbx_add_post_js('mappingsManager.addNew();');
} else {
    $json = new CJSON();
    zbx_add_post_js('mappingsManager.addExisting(' . $json->encode(array_values($this->data['mappings'])) . ');');
}
// append tab
$valueMappingTab = new CTabView();
$valueMappingTab->addTab('valuemapping', _('Value mapping'), $valueMappingFormList);
$valueMappingForm->addItem($valueMappingTab);
// append buttons
$saveButton = new CSubmit('save', _('Save'));
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:administration.general.valuemapping.edit.php

示例12: get_regexp_form

function get_regexp_form()
{
    if (isset($_REQUEST['regexpid']) && !isset($_REQUEST['form_refresh'])) {
        $sql = 'SELECT re.* ' . ' FROM regexps re ' . ' WHERE ' . DBin_node('re.regexpid') . ' AND re.regexpid=' . zbx_dbstr($_REQUEST['regexpid']);
        $regexp = DBfetch(DBSelect($sql));
        $rename = $regexp['name'];
        $test_string = $regexp['test_string'];
        $expressions = array();
        $sql = 'SELECT e.* ' . ' FROM expressions e ' . ' WHERE ' . DBin_node('e.expressionid') . ' AND e.regexpid=' . zbx_dbstr($regexp['regexpid']) . ' ORDER BY e.expression_type';
        $db_exps = DBselect($sql);
        while ($exp = DBfetch($db_exps)) {
            $expressions[] = $exp;
        }
    } else {
        $rename = get_request('rename', '');
        $test_string = get_request('test_string', '');
        $expressions = get_request('expressions', array());
    }
    $tblRE = new CTable('', 'formtable nowrap');
    $tblRE->addRow(array(_('Name'), new CTextBox('rename', $rename, 60, 'no', 128)));
    $tblRE->addRow(array(_('Test string'), new CTextArea('test_string', $test_string)));
    $tabExp = new CTableInfo();
    $td1 = new CCol(_('Expression'));
    $td2 = new CCol(_('Expected result'));
    $td3 = new CCol(_('Result'));
    $tabExp->setHeader(array($td1, $td2, $td3));
    $final_result = !empty($test_string);
    foreach ($expressions as $id => $expression) {
        $results = array();
        $paterns = array($expression['expression']);
        if (!empty($test_string)) {
            if ($expression['expression_type'] == EXPRESSION_TYPE_ANY_INCLUDED) {
                $paterns = explode($expression['exp_delimiter'], $expression['expression']);
            }
            if (uint_in_array($expression['expression_type'], array(EXPRESSION_TYPE_TRUE, EXPRESSION_TYPE_FALSE))) {
                if ($expression['case_sensitive']) {
                    $results[$id] = preg_match('/' . $paterns[0] . '/', $test_string);
                } else {
                    $results[$id] = preg_match('/' . $paterns[0] . '/i', $test_string);
                }
                if ($expression['expression_type'] == EXPRESSION_TYPE_TRUE) {
                    $final_result &= $results[$id];
                } else {
                    $final_result &= !$results[$id];
                }
            } else {
                $results[$id] = true;
                $tmp_result = false;
                if ($expression['case_sensitive']) {
                    foreach ($paterns as $pid => $patern) {
                        $tmp_result |= zbx_strstr($test_string, $patern) !== false;
                    }
                } else {
                    foreach ($paterns as $pid => $patern) {
                        $tmp_result |= zbx_stristr($test_string, $patern) !== false;
                    }
                }
                if (uint_in_array($expression['expression_type'], array(EXPRESSION_TYPE_INCLUDED, EXPRESSION_TYPE_ANY_INCLUDED))) {
                    $results[$id] &= $tmp_result;
                } else {
                    if ($expression['expression_type'] == EXPRESSION_TYPE_NOT_INCLUDED) {
                        $results[$id] &= !$tmp_result;
                    }
                }
                $final_result &= $results[$id];
            }
        }
        if (isset($results[$id]) && $results[$id]) {
            $exp_res = new CSpan(_('TRUE'), 'green bold');
        } else {
            $exp_res = new CSpan(_('FALSE'), 'red bold');
        }
        $expec_result = expression_type2str($expression['expression_type']);
        if (EXPRESSION_TYPE_ANY_INCLUDED == $expression['expression_type']) {
            $expec_result .= ' (' . _('Delimiter') . "='" . $expression['exp_delimiter'] . "')";
        }
        $tabExp->addRow(array($expression['expression'], $expec_result, $exp_res));
    }
    $td = new CCol(_('Combined result'), 'bold');
    $td->setColSpan(2);
    if ($final_result) {
        $final_result = new CSpan(_('TRUE'), 'green bold');
    } else {
        $final_result = new CSpan(_('FALSE'), 'red bold');
    }
    $tabExp->addRow(array($td, $final_result));
    $tblRE->addRow(array(_('Result'), $tabExp));
    $tblFoot = new CTableInfo(null);
    $td = new CCol(array(new CSubmit('save', _('Save'))));
    $td->setColSpan(2);
    $td->addStyle('text-align: right;');
    $td->addItem(SPACE);
    $td->addItem(new CSubmit('test', _('Test')));
    if (isset($_REQUEST['regexpid'])) {
        $td->addItem(SPACE);
        $td->addItem(new CSubmit('clone', _('Clone')));
        $td->addItem(SPACE);
        $td->addItem(new CButtonDelete(_('Delete regular expression?'), url_param('form') . url_param('config') . url_param('regexpid') . url_param('delete', false, 'go')));
    }
    $td->addItem(SPACE);
//.........这里部分代码省略.........
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:101,代码来源:forms.inc.php

示例13: exibeEvento

     }
 }
 function exibeEvento($chave, $linha)
 {
     if (array_key_exists($chave, $linha)) {
         return array(imagem('down', $linha[$chave]['maior_desc'], $linha[$chave]['maiores']), imagem('up', $linha[$chave]['menor_desc'], $linha[$chave]['menores']));
     } else {
         return "";
     }
 }
 $table->setHeader(array(_zeT('Amount'), is_show_all_nodes() ? _('Node') : null, _('Host'), _('Trigger'), $eventTitles[1], $eventTitles[2], $eventTitles[3], $eventTitles[4], $eventTitles[5], $eventTitles[6], $eventTitles[7], $eventTitles[8], $eventTitles[9], $eventTitles[10]));
 // Atribuir ao table o report ----------------------------------------------
 if ($possui === false) {
     // Avisa que não foram encontrados eventos no período
     $tmp = new CCol(array(_zeT("Sem eventos para correlacionar com os parâmetros informados")), 'center');
     $tmp->setColSpan(13);
     $table->addRow($tmp);
 } else {
     // Ordenando o array
     $report = array_sort($report, 'count', SORT_DESC);
     foreach ($report as $enum => $linha) {
         /*inicio adail*/
         if ($linha['count'] >= $min_events) {
             $table->addRow(array($linha['count'], $linha['host'], $linha['description'], exibeEvento('event1', $linha), exibeEvento('event2', $linha), exibeEvento('event3', $linha), exibeEvento('event4', $linha), exibeEvento('event5', $linha), exibeEvento('event6', $linha), exibeEvento('event7', $linha), exibeEvento('event8', $linha), exibeEvento('event9', $linha), exibeEvento('event10', $linha)));
         }
         if ($CSV_EXPORT) {
             $csvRows[] = array(zbx_date2str(EVENTS_ACTION_TIME_FORMAT, $event['clock']), is_show_all_nodes() ? get_node_name_by_elid($event['objectid']) : null, $_REQUEST['hostid'] == 0 ? $host['name'] : null, $description, trigger_value2str($event['value']), getSeverityCaption($trigger['priority']), $event['duration'], $config['event_ack_enable'] ? $event['acknowledges'] ? _('Yes') : _('No') : null, strip_tags((string) $actions));
         }
     }
 }
 /*fim adail*/
开发者ID:zubayr,项目名称:zabbix-extras,代码行数:31,代码来源:zbxe-em.php

示例14: array

             $time = 'lastdown';
         }
         $key_ = $dservice['key_'];
         if (!zbx_empty($key_)) {
             if (isset($this->data['macros'][$key_])) {
                 $key_ = $this->data['macros'][$key_]['value'];
             }
             $key_ = NAME_DELIMITER . $key_;
         }
         $serviceName = discovery_check_type2str($dservice['type']) . discovery_port2str($dservice['type'], $dservice['port']) . $key_;
         $discovery_info[$dservice['ip']]['services'][$serviceName] = array('class' => $class, 'time' => $dservice[$time]);
     }
 }
 if (empty($this->data['druleid']) && !empty($discovery_info)) {
     $col = new CCol(array(bold($drule['name']), SPACE . '(' . _n('%d device', '%d devices', count($discovery_info)) . ')'));
     $col->setColSpan(count($this->data['services']) + 3);
     $discoveryTable->addRow($col);
 }
 order_result($discovery_info, $this->data['sort'], $this->data['sortorder']);
 foreach ($discovery_info as $ip => $h_data) {
     $dns = $h_data['dns'] == '' ? '' : ' (' . $h_data['dns'] . ')';
     $row = array($h_data['type'] == 'primary' ? new CSpan($ip . $dns, $h_data['class']) : new CSpan(SPACE . SPACE . $ip . $dns), new CSpan(empty($h_data['host']) ? '-' : $h_data['host']), new CSpan($h_data['time'] == 0 || $h_data['type'] === 'slave' ? '' : convert_units(array('value' => time() - $h_data['time'], 'units' => 'uptime')), $h_data['class']));
     foreach ($this->data['services'] as $name => $foo) {
         $class = null;
         $time = SPACE;
         $hint = new CDiv(SPACE, $class);
         $hintTable = null;
         if (isset($h_data['services'][$name])) {
             $class = $h_data['services'][$name]['class'];
             $time = $h_data['services'][$name]['time'];
             $hintTable = new CTableInfo();
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:monitoring.discovery.php

示例15: get_regexp_form

function get_regexp_form()
{
    $frm_title = S_REGULAR_EXPRESSION;
    if (isset($_REQUEST['regexpid']) && !isset($_REQUEST["form_refresh"])) {
        $sql = 'SELECT re.* ' . ' FROM regexps re ' . ' WHERE ' . DBin_node('re.regexpid') . ' AND re.regexpid=' . $_REQUEST['regexpid'];
        $regexp = DBfetch(DBSelect($sql));
        $frm_title .= ' [' . $regexp['name'] . ']';
        $rename = $regexp['name'];
        $test_string = $regexp['test_string'];
        $expressions = array();
        $sql = 'SELECT e.* ' . ' FROM expressions e ' . ' WHERE ' . DBin_node('e.expressionid') . ' AND e.regexpid=' . $regexp['regexpid'] . ' ORDER BY e.expression_type';
        $db_exps = DBselect($sql);
        while ($exp = DBfetch($db_exps)) {
            $expressions[] = $exp;
        }
    } else {
        $rename = get_request('rename', '');
        $test_string = get_request('test_string', '');
        $expressions = get_request('expressions', array());
    }
    $tblRE = new CTable('', 'nowrap');
    $tblRE->addStyle('border-left: 1px #AAA solid; border-right: 1px #AAA solid; background-color: #EEE; padding: 2px; padding-left: 6px; padding-right: 6px;');
    $tblRE->addRow(array(S_NAME, new CTextBox('rename', $rename, 60)));
    $tblRE->addRow(array(S_TEST_STRING, new CTextArea('test_string', $test_string, 66, 5)));
    $tabExp = new CTableInfo();
    $td1 = new CCol(S_EXPRESSION);
    $td1->addStyle('background-color: #CCC;');
    $td2 = new CCol(S_EXPECTED_RESULT);
    $td2->addStyle('background-color: #CCC;');
    $td3 = new CCol(S_RESULT);
    $td3->addStyle('background-color: #CCC;');
    $tabExp->setHeader(array($td1, $td2, $td3));
    $final_result = !empty($test_string);
    foreach ($expressions as $id => $expression) {
        $results = array();
        $paterns = array($expression['expression']);
        if (!empty($test_string)) {
            if ($expression['expression_type'] == EXPRESSION_TYPE_ANY_INCLUDED) {
                $paterns = explode($expression['exp_delimiter'], $expression['expression']);
            }
            if (uint_in_array($expression['expression_type'], array(EXPRESSION_TYPE_TRUE, EXPRESSION_TYPE_FALSE))) {
                if ($expression['case_sensitive']) {
                    $results[$id] = ereg($paterns[0], $test_string);
                } else {
                    $results[$id] = eregi($paterns[0], $test_string);
                }
                if ($expression['expression_type'] == EXPRESSION_TYPE_TRUE) {
                    $final_result &= $results[$id];
                } else {
                    $final_result &= !$results[$id];
                }
            } else {
                $results[$id] = true;
                $tmp_result = false;
                if ($expression['case_sensitive']) {
                    foreach ($paterns as $pid => $patern) {
                        $tmp_result |= zbx_stristr($test_string, $patern) !== false;
                    }
                } else {
                    foreach ($paterns as $pid => $patern) {
                        $tmp_result |= zbx_strstr($test_string, $patern) !== false;
                    }
                }
                $results[$id] &= $tmp_result;
                $final_result &= $results[$id];
            }
        }
        if (isset($results[$id]) && $results[$id]) {
            $exp_res = new CSpan(S_TRUE_BIG, 'green bold');
        } else {
            $exp_res = new CSpan(S_FALSE_BIG, 'red bold');
        }
        $expec_result = expression_type2str($expression['expression_type']);
        if (EXPRESSION_TYPE_ANY_INCLUDED == $expression['expression_type']) {
            $expec_result .= ' (' . S_DELIMITER . "='" . $expression['exp_delimiter'] . "')";
        }
        $tabExp->addRow(array($expression['expression'], $expec_result, $exp_res));
    }
    $td = new CCol(S_COMBINED_RESULT, 'bold');
    $td->setColSpan(2);
    if ($final_result) {
        $final_result = new CSpan(S_TRUE_BIG, 'green bold');
    } else {
        $final_result = new CSpan(S_FALSE_BIG, 'red bold');
    }
    $tabExp->addRow(array($td, $final_result));
    $tblRE->addRow(array(S_RESULT, $tabExp));
    $tblFoot = new CTableInfo(null);
    $td = new CCol(array(new CButton('save', S_SAVE)));
    $td->setColSpan(2);
    $td->addStyle('text-align: right;');
    $td->addItem(SPACE);
    $td->addItem(new CButton('test', S_TEST));
    if (isset($_REQUEST['regexpid'])) {
        $td->addItem(SPACE);
        $td->addItem(new CButton('clone', S_CLONE));
        $td->addItem(SPACE);
        $td->addItem(new CButtonDelete(S_DELETE_REGULAR_EXPRESSION_Q, url_param('form') . url_param('config') . url_param('regexpid')));
    }
    $td->addItem(SPACE);
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php


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