function bodyToString($destroy = true) { $setup_left = (new CDiv([(new CDiv())->addClass(ZBX_STYLE_SIGNIN_LOGO), $this->getList()]))->addClass(ZBX_STYLE_SETUP_LEFT); $setup_right = (new CDiv($this->getStage()))->addClass(ZBX_STYLE_SETUP_RIGHT); if (CWebUser::$data && CWebUser::getType() == USER_TYPE_SUPER_ADMIN) { $cancel_button = (new CSubmit('cancel', _('Cancel')))->addClass(ZBX_STYLE_BTN_ALT)->addClass(ZBX_STYLE_FLOAT_LEFT); if ($this->DISABLE_CANCEL_BUTTON) { $cancel_button->setEnabled(false); } } else { $cancel_button = null; } if (array_key_exists($this->getStep() + 1, $this->stage)) { $next_button = new CSubmit('next[' . $this->getStep() . ']', _('Next step')); } else { $next_button = new CSubmit($this->SHOW_RETRY_BUTTON ? 'retry' : 'finish', _('Finish')); } $back_button = (new CSubmit('back[' . $this->getStep() . ']', _('Back')))->addClass(ZBX_STYLE_BTN_ALT)->addClass(ZBX_STYLE_FLOAT_LEFT); if ($this->getStep() == 0 || $this->DISABLE_BACK_BUTTON) { $back_button->setEnabled(false); } $setup_footer = (new CDiv([new CDiv([$next_button, $back_button]), $cancel_button]))->addClass(ZBX_STYLE_SETUP_FOOTER); $setup_container = (new CDiv([$setup_left, $setup_right, $setup_footer]))->addClass(ZBX_STYLE_SETUP_CONTAINER); return parent::bodyToString($destroy) . $setup_container->ToString(); }
function bodyToString($destroy = true) { $left = new CDiv(null, 'left'); $left->addItem(new CDiv($this->getList(), 'left_menu')); $link1 = new CLink('www.zabbix.com', 'http://www.zabbix.com/', null, null, true); $link1->setAttribute('target', '_blank'); $link2 = new CLink('GPL v2', 'http://www.zabbix.com/license.php', null, null, true); $link2->setAttribute('target', '_blank'); $licence = new CDiv(array($link1, BR(), ' Licensed under ', $link2), 'setup_wizard_licence'); $left->addItem($licence); $right = new CDiv(null, 'right'); if ($this->getStep() == 0) { $right->addItem(new CDiv(null, 'blank_title')); $right->addItem(new CDiv($this->getState(), 'blank_under_title')); $container = new CDiv(array($left, $right), 'setup_wizard setup_wizard_welcome'); } else { $right->addItem(new CDiv($this->stage[$this->getStep()]['title'], 'setup_title')); $right->addItem(new CDiv($this->getState(), 'under_title')); $container = new CDiv(array($left, $right), 'setup_wizard'); } if (isset($this->stage[$this->getStep() + 1])) { $next = new CSubmit('next[' . $this->getStep() . ']', _('Next') . SPACE . '»'); } else { $next = new CSubmit('finish', _('Finish')); } if (isset($this->HIDE_CANCEL_BUTTON) && $this->HIDE_CANCEL_BUTTON) { $cancel = null; } else { $cancel = new CDiv(new CSubmit('cancel', _('Cancel')), 'footer_left'); } if ($this->DISABLE_NEXT_BUTTON) { $next->setEnabled(false); } // if the user is not logged in (first setup run) hide the "previous" button on the final step if ($this->getStep() && (CWebUser::$data && CWebUser::getType() == USER_TYPE_SUPER_ADMIN || $this->getStep() < 5)) { $back = new CSubmit('back[' . $this->getStep() . ']', '«' . SPACE . _('Previous')); } else { $back = null; } $footer = new CDiv(array($cancel, new CDiv(array($back, $next), 'footer_right')), 'footer'); $container->addItem($footer); return parent::bodyToString($destroy) . $container->ToString(); }
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(); }
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(); }
function bodyToString($destroy = true) { $left = new CDiv(null, 'left'); $left->addItem(new CDiv(null, 'setup_logo')); $left->addItem(new CDiv(ZABBIX_VERSION, 'setup_version')); $left->addItem(new CDiv($this->getList(), 'left_menu')); $link1 = new CLink('www.zabbix.com', 'http://www.zabbix.com/', null, null, true); $link1->setAttribute('target', '_blank'); $link2 = new CLink('GPL v2', 'http://www.zabbix.com/license.php', null, null, true); $link2->setAttribute('target', '_blank'); $licence = new CDiv(array($link1, BR(), ' Licensed under ', $link2), 'setup_wizard_licence'); $left->addItem($licence); $right = new CDiv(null, 'right'); if ($this->getStep() == 0) { $right->addItem(new CDiv(null, 'blank_title')); $right->addItem(new CDiv($this->getState(), 'blank_under_title')); $container = new CDiv(array($left, $right), 'setup_wizard setup_wizard_welcome'); } else { $right->addItem(new CDiv($this->stage[$this->getStep()]['title'], 'setup_title')); $right->addItem(new CDiv($this->getState(), 'under_title')); $container = new CDiv(array($left, $right), 'setup_wizard'); } if (isset($this->stage[$this->getStep() + 1])) { $next = new CSubmit('next[' . $this->getStep() . ']', _('Next') . ' >>'); } else { $next = new CSubmit('finish', _('Finish')); } if (isset($this->HIDE_CANCEL_BUTTON) && $this->HIDE_CANCEL_BUTTON) { $cancel = null; } else { $cancel = new CDiv(new CSubmit('cancel', _('Cancel')), 'footer_left'); } if ($this->DISABLE_NEXT_BUTTON) { $next->setEnabled(false); } $footer = new CDiv(array($cancel, new CDiv(array($this->getStep() != 0 ? new CSubmit('back[' . $this->getStep() . ']', '<< ' . _('Previous')) : null, $next), 'footer_right')), 'footer'); $container->addItem($footer); return parent::bodyToString($destroy) . $container->ToString(); }