本文整理汇总了PHP中CCol::SetColSpan方法的典型用法代码示例。如果您正苦于以下问题:PHP CCol::SetColSpan方法的具体用法?PHP CCol::SetColSpan怎么用?PHP CCol::SetColSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCol
的用法示例。
在下文中一共展示了CCol::SetColSpan方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CLink
foreach ($db_hosts as $hostid => $db_host) {
if (!isset($tab_rows[$hostid])) {
continue;
}
$app_rows = $tab_rows[$hostid];
if (uint_in_array(0, $_REQUEST['applications']) || isset($show_all_apps)) {
$url = '?close=1&applicationid=0' . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select');
$link = new CLink(new CImg('images/general/opened.gif'), $url);
// $link = new CLink(new CImg('images/general/opened.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');");
} else {
$url = '?open=1&applicationid=0' . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select');
$link = new CLink(new CImg('images/general/closed.gif'), $url);
// $link = new CLink(new CImg('images/general/closed.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');");
}
$col = new CCol(array($link, SPACE, bold(S_MINUS_OTHER_MINUS), SPACE . '(' . $db_host['item_cnt'] . SPACE . S_ITEMS . ')'));
$col->SetColSpan(5);
$table->AddRow(array(get_node_name_by_elid($db_host['hostid']), $_REQUEST['hostid'] > 0 ? NULL : $db_host['host'], $col));
foreach ($app_rows as $row) {
$table->AddRow($row);
}
}
$p_elements[] = $table;
/*
// Refresh tab
$refresh_tab = array(
array('id' => ZBX_PAGE_MAIN_HAT,
'interval' => $USER_DETAILS['refresh'],
'url' => zbx_empty($_SERVER['QUERY_STRING'])?'':'?'.$_SERVER['QUERY_STRING'],
)
);
//*/
示例2: get_screen
//.........这里部分代码省略.........
$value = new CCol(trigger_value2str($event['value']), get_trigger_value_style($event['value']));
// $row = zbx_array_merge($triggers[$row['triggerid']],$row);
// if((1 == $hide_unknown) && (!event_initial_time($row,$hide_unknown))) continue;
$item->addRow(array(zbx_date2str(S_EVENTS_TRIGGERS_EVENTS_HISTORY_LIST_DATE_FORMAT, $event['clock']), get_node_name_by_elid($event['objectid']), $host['host'], new CLink($trigger['description'], 'tr_events.php?triggerid=' . $event['objectid'] . '&eventid=' . $event['eventid']), $value, new CCol(get_severity_description($trigger['priority']), get_severity_style($trigger['priority']))));
}
$item = array($item);
if ($editmode == 1) {
array_push($item, new CLink(S_CHANGE, $action));
}
} else {
$item = array(SPACE);
if ($editmode == 1) {
array_push($item, BR(), new CLink(S_CHANGE, $action));
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
$str_halign = 'def';
if ($halign == HALIGN_CENTER) {
$str_halign = 'cntr';
}
if ($halign == HALIGN_LEFT) {
$str_halign = 'left';
}
if ($halign == HALIGN_RIGHT) {
$str_halign = 'right';
}
$str_valign = 'def';
if ($valign == VALIGN_MIDDLE) {
$str_valign = 'mdl';
}
if ($valign == VALIGN_TOP) {
$str_valign = 'top';
}
if ($valign == VALIGN_BOTTOM) {
$str_valign = 'bttm';
}
if ($editmode == 1 && !$item_form) {
$item = new CDiv($item, 'draggable');
$item->setAttribute('id', 'position_' . $r . '_' . $c);
if ($editmode == 1) {
$item->setAttribute('onclick', 'javascript: ' . $onclick_action);
}
}
$new_col = new CCol($item, $str_halign . '_' . $str_valign);
if ($colspan) {
$new_col->SetColSpan($colspan);
}
if ($rowspan) {
$new_col->SetRowSpan($rowspan);
}
array_push($new_cols, $new_col);
}
if ($editmode == 1) {
$rmv_icon = new Cimg('images/general/opened.gif', NULL, NULL, NULL, 'pointer');
if ($empty_screen_row) {
$rmv_row_link = "javascript: location.href = 'screenedit.php?config=1&screenid={$screenid}&rmv_row={$r}';";
} else {
$rmv_row_link = "javascript: if(Confirm('" . S_THIS_SCREEN_ROW_NOT_EMPTY . '. ' . S_DELETE_IT_Q . "')){" . " location.href = 'screenedit.php?config=1&screenid={$screenid}&rmv_row={$r}';}";
}
$rmv_icon->addAction('onclick', $rmv_row_link);
array_push($new_cols, new Ccol($rmv_icon));
}
$table->addRow(new CRow($new_cols));
}
if ($editmode == 1) {
$add_icon = new Cimg('images/general/closed.gif', NULL, NULL, NULL, 'pointer');
$add_icon->addAction('onclick', "javascript: location.href = 'screenedit.php?config=1&screenid={$screenid}&add_row={$row['vsize']}';");
$new_cols = array(new Ccol($add_icon));
for ($c = 0; $c < $row['hsize']; $c++) {
$rmv_icon = new Cimg('images/general/opened.gif', NULL, NULL, NULL, 'pointer');
if (isset($empty_screen_col[$c])) {
$rmv_col_link = "javascript: if(Confirm('" . S_THIS_SCREEN_COLUMN_NOT_EMPTY . '. ' . S_DELETE_IT_Q . "')){" . " location.href = 'screenedit.php?config=1&screenid={$screenid}&rmv_col={$c}';}";
} else {
$rmv_col_link = "javascript: location.href = 'screenedit.php?config=1&screenid={$screenid}&rmv_col={$c}';";
}
$rmv_icon->addAction('onclick', $rmv_col_link);
array_push($new_cols, new Ccol($rmv_icon));
}
array_push($new_cols, new Ccol(new Cimg('images/general/zero.gif', 'zero', 1, 1)));
$table->addRow($new_cols);
}
return $table;
}
示例3: CRow
$status['style'] = 'enabled';
}
} else {
$state = S_IDLE_TILL . ' ' . zbx_date2str(S_WEB_SCENARIO_IDLE_DATE_FORMAT, $httptest_data['nextcheck']);
$status['msg'] = S_UNKNOWN;
$status['style'] = 'unknown';
}
}
array_push($app_rows, new CRow(array(is_show_all_nodes() ? SPACE : NULL, $_REQUEST['hostid'] > 0 ? NULL : SPACE, array(str_repeat(SPACE, 6), $name), $httptest_data['step_cout'], $state, $lastcheck, new CSpan($status['msg'], $status['style']))));
}
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);
}
}
$form->addItem($table);
$httpmon_wdgt->addItem($form);
$httpmon_wdgt->show();
include_once 'include/page_footer.php';
示例4: get_screen
//.........这里部分代码省略.........
if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_ACTIONS) {
$item = array(get_history_of_actions($elements));
if ($editmode == 1) {
array_push($item, new CLink(S_CHANGE, $action));
}
} else {
if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_EVENTS) {
$item = array(get_history_of_triggers_events(0, $elements));
if ($editmode == 1) {
array_push($item, new CLink(S_CHANGE, $action));
}
} else {
$item = array(SPACE);
if ($editmode == 1) {
array_push($item, BR(), new CLink(S_CHANGE, $action));
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
$str_halign = 'def';
if ($halign == HALIGN_CENTER) {
$str_halign = 'cntr';
}
if ($halign == HALIGN_LEFT) {
$str_halign = 'left';
}
if ($halign == HALIGN_RIGHT) {
$str_halign = 'right';
}
$str_valign = 'def';
if ($valign == VALIGN_MIDDLE) {
$str_valign = 'mdl';
}
if ($valign == VALIGN_TOP) {
$str_valign = 'top';
}
if ($valign == VALIGN_BOTTOM) {
$str_valign = 'bttm';
}
if ($editmode == 1 && !$item_form) {
$item = new CDiv($item, 'draggable');
$item->setAttribute('id', 'position_' . $r . '_' . $c);
if ($editmode == 1) {
$item->setAttribute('onclick', 'javascript: ' . $onclick_action);
}
}
$new_col = new CCol($item, $str_halign . '_' . $str_valign);
if ($colspan) {
$new_col->SetColSpan($colspan);
}
if ($rowspan) {
$new_col->SetRowSpan($rowspan);
}
array_push($new_cols, $new_col);
}
if ($editmode == 1) {
$rmv_icon = new Cimg('images/general/opened.gif');
if ($empty_screen_row) {
$rmv_row_link = 'javascript: location.href = ' . "'screenedit.php?config=1&screenid=" . $screenid . '&rmv_row=' . $r . "';";
} else {
$rmv_row_link = "javascript: if(Confirm('This screen-row is not empty. Delete it?')){" . " location.href = 'screenedit.php?config=1&screenid=" . $screenid . "&rmv_row=" . $r . "';}";
}
$rmv_icon->addAction('onclick', $rmv_row_link);
array_push($new_cols, new Ccol($rmv_icon));
}
$table->AddRow(new CRow($new_cols));
}
if ($editmode == 1) {
$add_row_link = 'screenedit.php?config=1&screenid=' . $screenid . '&add_row=';
$new_cols = array(new Ccol(new Clink(new Cimg('images/general/closed.gif'), $add_row_link . $row['vsize'])));
for ($c = 0; $c < $row['hsize']; $c++) {
$rmv_icon = new Cimg('images/general/opened.gif');
if (isset($empty_screen_col[$c])) {
$rmv_col_link = "javascript: if(Confirm('This screen-column is not empty. Delete it?')){" . " location.href = 'screenedit.php?config=1&screenid=" . $screenid . "&rmv_col=" . $c . "';}";
} else {
$rmv_col_link = "javascript: location.href = 'screenedit.php?config=1&screenid=" . $screenid . "&rmv_col=" . $c . "';";
}
$rmv_icon->addAction('onclick', $rmv_col_link);
array_push($new_cols, new Ccol($rmv_icon));
}
array_push($new_cols, new Ccol(new Cimg('images/general/zero.gif', 'zero', 1, 1)));
$table->addRow($new_cols);
}
return $table;
}
示例5: CScript
if ($new_service_time['type'] == SERVICE_TIME_TYPE_ONETIME_DOWNTIME) {
// $time_param->AddRow(array(S_NOTE, new CTextBox('new_service_time[note]','<short description>',40)));
// $time_param->AddRow(array(S_FROM, new CTextBox('new_service_time[from]','d M Y H:i',20)));
// $time_param->AddRow(array(S_TILL, new CTextBox('new_service_time[to]','d M Y H:i',20)));
$script = new CScript("javascript: if(CLNDR['downtime_since'].clndr.setSDateFromOuterObj()){" . "\$('new_service_time[from]').value = parseInt(CLNDR['downtime_since'].clndr.sdt.getTime()/1000);}" . "if(CLNDR['downtime_till'].clndr.setSDateFromOuterObj()){" . "\$('new_service_time[to]').value = parseInt(CLNDR['downtime_till'].clndr.sdt.getTime()/1000);}");
$frmService->AddAction('onsubmit', $script);
$frmService->AddVar('new_service_time[from]', '');
$frmService->AddVar('new_service_time[to]', '');
$clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
$clndr_icon->AddAction('onclick', 'javascript: var pos = getPosition(this);' . ' pos.top-=203; pos.left+=16; ' . " CLNDR['downtime_since'].clndr.clndrshow(pos.top,pos.left);");
$filtertimetab = new CTable(null, 'calendar');
$filtertimetab->setAttribute('width', '10%');
$filtertimetab->SetCellPadding(0);
$filtertimetab->SetCellSpacing(0);
$td_tmp = new CCol(new CTextBox('new_service_time[note]', '<short description>', 40));
$td_tmp->SetColSpan(10);
$filtertimetab->AddRow(array(S_NOTE, $td_tmp));
$filtertimetab->AddRow(array(S_FROM, new CNumericBox('downtime_since_day', '', 2), '/', new CNumericBox('downtime_since_month', '', 2), '/', new CNumericBox('downtime_since_year', '', 4), SPACE, new CNumericBox('downtime_since_hour', '', 2), ':', new CNumericBox('downtime_since_minute', '', 2), $clndr_icon));
zbx_add_post_js('create_calendar(' . 'null,' . '["downtime_since_day","downtime_since_month","downtime_since_year","downtime_since_hour","downtime_since_minute"],' . '"downtime_since");');
$clndr_icon->AddAction('onclick', 'javascript: var pos = getPosition(this);' . ' pos.top-=203; pos.left+=16; ' . " CLNDR['downtime_till'].clndr.clndrshow(pos.top,pos.left);");
$filtertimetab->AddRow(array(S_TILL, new CNumericBox('downtime_till_day', '', 2), '/', new CNumericBox('downtime_till_month', '', 2), '/', new CNumericBox('downtime_till_year', '', 4), SPACE, new CNumericBox('downtime_till_hour', '', 2), ':', new CNumericBox('downtime_till_minute', '', 2), $clndr_icon));
zbx_add_post_js('create_calendar(' . 'null,' . '["downtime_till_day","downtime_till_month","downtime_till_year","downtime_till_hour","downtime_till_minute"],' . '"downtime_till");');
$time_param->AddRow($filtertimetab);
} else {
$cmbWeekFrom = new CComboBox('new_service_time[from_week]', 'Sunday');
$cmbWeekTo = new CComboBox('new_service_time[to_week]', 'Sunday');
foreach (array('Sunday' => S_SUNDAY, 'Monday' => S_MONDAY, 'Tuesday' => S_TUESDAY, 'Wednesday' => S_WEDNESDAY, 'Thursday' => S_THURSDAY, 'Friday' => S_FRIDAY, 'Saturday' => S_SATURDAY) as $day_num => $day_str) {
$cmbWeekFrom->AddItem($day_num, $day_str);
$cmbWeekTo->AddItem($day_num, $day_str);
}
$time_param->AddRow(array(S_FROM, $cmbWeekFrom, new CTextBox('new_service_time[from]', 'H:i', 9)));
示例6: array
$discovery_info[$dhost['ip']] = array('class' => $class, 'time' => $dhost[$time], 'druleid' => $dhost['druleid']);
$db_dservices = DBselect('SELECT type,port,key_,status,lastup,lastdown FROM dservices ' . ' WHERE dhostid=' . $dhost['dhostid'] . ' order by status,type,port');
while ($dservice = DBfetch($db_dservices)) {
$class = 'active';
$time = 'lastup';
if (DSVC_STATUS_DISABLED == $dservice['status']) {
$class = 'inactive';
$time = 'lastdown';
}
$service_name = discovery_check_type2str($dservice['type']) . discovery_port2str($dservice['type'], $dservice['port']) . (empty($dservice['key_']) ? '' : ':' . $dservice['key_']);
$discovery_info[$dhost['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) + 2);
$table->AddRow(array(get_node_name_by_elid($drule['druleid']), $col));
}
foreach ($discovery_info as $ip => $h_data) {
$table_row = array(get_node_name_by_elid($h_data['druleid']), new CSpan($ip, $h_data['class']), new CSpan($h_data['time'] == 0 ? '' : 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 = new CTableInfo();
$hintTable->addOption('border', 0);
if (isset($h_data['services'][$name])) {
$class = $h_data['services'][$name]['class'];
$time = $h_data['services'][$name]['time'];
if ($class == 'active') {
$hintTable->setHeader(S_UP_TIME);