private function makeHeaders() { $c = 0; $tr = new CRow(); $tr->addItem($this->fields['caption']); $tr->setClass('treeheader'); unset($this->fields['caption']); foreach ($this->fields as $id => $caption) { $tr->addItem($caption); $fields[$c] = $id; $c++; } $this->fields = $fields; return $tr; }
public function prepareRow($item, $rowClass = NULL) { if (is_null($item)) { return NULL; } if (strtolower(get_class($item)) == 'ccol') { if (isset($this->header) && !isset($item->attributes['colspan'])) { $item->attributes['colspan'] = $this->colnum; } $item = new CRow($item, $rowClass); } if (strtolower(get_class($item)) == 'crow') { if (isset($rowClass)) { $item->setClass($rowClass); } } else { $item = new CRow($item, $rowClass); } if (!isset($item->attributes['class'])) { $item->setClass($this->rownum % 2 ? $this->oddRowClass : $this->evenRowClass); } return $item; }
$row[] = $data['logeventid'] == 0 ? '-' : $data['logeventid']; } } $data['value'] = encode_log(trim($data['value'], "\r\n")); $row[] = new CCol($data['value'], 'pre'); $crow = new CRow($row); if (is_null($color_style)) { $min_color = 0x98; $max_color = 0xf8; $int_color = ($max_color - $min_color) / count($_REQUEST['itemid']); $int_color *= array_search($data['itemid'], $_REQUEST['itemid']); $int_color += $min_color; $crow->setAttribute('style', 'background-color: ' . sprintf("#%X%X%X", $int_color, $int_color, $int_color)); } else { if (!is_null($color_style)) { $crow->setClass($color_style); } } $table->addRow($crow); // Plain Text if (!isset($_REQUEST['plaintext'])) { continue; } $ptData['body'][] = zbx_date2str(S_HISTORY_LOG_ITEM_PLAINTEXT, $data['clock']); $ptData['body'][] = "\t" . $data['clock'] . "\t" . htmlspecialchars($data['value']) . "\n"; } } else { // NUMERIC, FLOAT $table = new CTableInfo(); $table->setHeader(array(S_TIMESTAMP, S_VALUE)); $options['sortfield'] = 'clock';