Beispiel #1
0
 private function createHeader()
 {
     $header = reset($this->headers);
     $columnRights = array();
     if (!is_null($header['right'])) {
         foreach ($header['right'] as $right) {
             $columnRights[] = new CDiv($right, 'floatright');
         }
     }
     if ($columnRights) {
         $columnRights = array_reverse($columnRights);
     }
     // header table
     $table = new CTable(null, $this->css_class . ' maxwidth');
     $table->setCellSpacing(0);
     $table->setCellPadding(1);
     $table->addRow($this->createHeaderRow($header['left'], $columnRights), 'first');
     if ($this->css_class != 'header_wide') {
         $table->addClass('ui-widget-header ui-corner-all');
     }
     foreach ($this->headers as $num => $header) {
         if ($num > 0) {
             $table->addRow($this->createHeaderRow($header['left'], $header['right']), 'next');
         }
     }
     return new CDiv($table);
 }
Beispiel #2
0
 private function createHeader()
 {
     $header = reset($this->headers);
     $columnRights = array();
     if (!is_null($header['right'])) {
         foreach ($header['right'] as $right) {
             $columnRights[] = new CDiv($right, 'floatright');
         }
     }
     if (!is_null($this->state)) {
         $icon = new CIcon(_('Show') . '/' . _('Hide'), $this->state ? 'arrowup' : 'arrowdown', "change_hat_state(this, '" . $this->bodyId . "');");
         $icon->setAttribute('id', $this->bodyId . '_icon');
         $columnRights[] = $icon;
     }
     if ($columnRights) {
         $columnRights = array_reverse($columnRights);
     }
     // header table
     $table = new CTable(null, $this->css_class . ' maxwidth');
     $table->setCellSpacing(0);
     $table->setCellPadding(1);
     $table->addRow($this->createHeaderRow($header['left'], $columnRights), 'first');
     if ($this->css_class != 'header_wide') {
         $table->addClass('ui-widget-header ui-corner-all');
     }
     foreach ($this->headers as $num => $header) {
         if ($num > 0) {
             $table->addRow($this->createHeaderRow($header['left'], $header['right']), 'next');
         }
     }
     return new CDiv($table);
 }
    if ($interfaceTableHeaderSet) {
        $jmxInterfacesTable->addClass('element-row');
    } else {
        $jmxInterfacesTable->addClass('element-row-first');
        $jmxInterfacesTable->setHeader(array(_('IP address'), _('DNS name'), _('Connect to'), _('Port')));
    }
    foreach ($jmxInterfaceRows as $interface) {
        $jmxInterfacesTable->addRow($interface);
    }
    $overviewFormList->addRow(_('JMX interfaces'), new CDiv($jmxInterfacesTable));
}
// IPMI interface
if ($ipmiInterfaceRows) {
    $ipmiInterfacesTable = new CTable(null, 'formElementTable border_dotted objectgroup interfaces');
    if ($interfaceTableHeaderSet) {
        $ipmiInterfacesTable->addClass('element-row');
    } else {
        $ipmiInterfacesTable->addClass('element-row-first');
        $ipmiInterfacesTable->setHeader(array(_('IP address'), _('DNS name'), _('Connect to'), _('Port')));
        $interfaceTableHeaderSet = true;
    }
    foreach ($ipmiInterfaceRows as $interface) {
        $ipmiInterfacesTable->addRow($interface);
    }
    $overviewFormList->addRow(_('IPMI interfaces'), new CDiv($ipmiInterfacesTable));
}
// inventory (OS, Hardware, Software)
if ($this->data['host']['inventory']) {
    if ($this->data['host']['inventory']['os']) {
        $overviewFormList->addRow($this->data['tableTitles']['os']['title'], new CSpan(zbx_str2links($this->data['host']['inventory']['os']), 'text-field'));
    }
$histortTab = new CTable(null, 'formElementTable');
$histortTab->addRow(array(new CLabel(_('Enable internal housekeeping'), 'hk_history_mode'), new CCheckBox('hk_history_mode', $this->data['config']['hk_history_mode'], null, 1)));
$houseKeeperHistoryGlobal = new CCheckBox('hk_history_global', $this->data['config']['hk_history_global'], null, 1);
$houseKeeperHistoryModeGlobal = new CNumericBox('hk_history', $this->data['config']['hk_history'], 5);
if (!$this->data['config']['hk_history_global']) {
    $houseKeeperHistoryModeGlobal->setAttribute('disabled', 'disabled');
}
$histortTab->addRow(array(new CLabel(_('Override item history period'), 'hk_history_global'), $houseKeeperHistoryGlobal));
$histortTab->addRow(array(new CLabel(_('Data storage period (in days)'), 'hk_history'), $houseKeeperHistoryModeGlobal));
$histortTab->addClass('border_dotted objectgroup element-row');
$houseKeeperTab->addRow(_('History'), new CDiv($histortTab));
// trend
$trendTab = new CTable(null, 'formElementTable');
$trendTab->addRow(array(new CLabel(_('Enable internal housekeeping'), 'hk_trends_mode'), new CCheckBox('hk_trends_mode', $this->data['config']['hk_trends_mode'], null, 1)));
$houseKeeperTrendGlobal = new CCheckBox('hk_trends_global', $this->data['config']['hk_trends_global'], null, 1);
$houseKeeperTrendModeGlobal = new CNumericBox('hk_trends', $this->data['config']['hk_trends'], 5);
if (!$this->data['config']['hk_trends_global']) {
    $houseKeeperTrendModeGlobal->setAttribute('disabled', 'disabled');
}
$trendTab->addRow(array(new CLabel(_('Override item trend period'), 'hk_trends_global'), $houseKeeperTrendGlobal));
$trendTab->addRow(array(new CLabel(_('Data storage period (in days)'), 'hk_trends'), $houseKeeperTrendModeGlobal));
$trendTab->addClass('border_dotted objectgroup element-row');
$houseKeeperTab->addRow(_('Trends'), new CDiv($trendTab));
$houseKeeperView = new CTabView();
$houseKeeperView->addTab('houseKeeper', _('Housekeeping'), $houseKeeperTab);
$houseKeeperForm = new CForm();
$houseKeeperForm->setName('houseKeeperForm');
$houseKeeperForm->addVar('form_refresh', $this->data['form_refresh'] + 1);
$houseKeeperForm->addItem($houseKeeperView);
$houseKeeperForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButton('resetDefaults', _('Reset defaults'))));
return $houseKeeperForm;