function stage5() { $dbType = $this->getConfig('DB_TYPE'); $frontendSetup = new CFrontendSetup(); $databases = $frontendSetup->getSupportedDatabases(); $table = new CTable(null, 'requirements'); $table->setAlign('center'); $table->addRow(array(new CCol(_('Database type'), 'header'), $databases[$dbType])); switch ($dbType) { case ZBX_DB_SQLITE3: $table->addRow(array(new CCol(_('Database file'), 'header'), $this->getConfig('DB_DATABASE'))); break; default: $table->addRow(array(new CCol(_('Database server'), 'header'), $this->getConfig('DB_SERVER'))); $dbPort = $this->getConfig('DB_PORT'); $table->addRow(array(new CCol(_('Database port'), 'header'), $dbPort == 0 ? _('default') : $dbPort)); $table->addRow(array(new CCol(_('Database name'), 'header'), $this->getConfig('DB_DATABASE'))); $table->addRow(array(new CCol(_('Database user'), 'header'), $this->getConfig('DB_USER'))); $table->addRow(array(new CCol(_('Database password'), 'header'), preg_replace('/./', '*', $this->getConfig('DB_PASSWORD')))); if ($dbType == ZBX_DB_DB2 || $dbType == ZBX_DB_POSTGRESQL) { $table->addRow(array(new CCol(_('Database schema'), 'header'), $this->getConfig('DB_SCHEMA'))); } break; } $table->addRow(BR()); $table->addRow(array(new CCol(_('Zabbix server'), 'header'), $this->getConfig('ZBX_SERVER'))); $table->addRow(array(new CCol(_('Zabbix server port'), 'header'), $this->getConfig('ZBX_SERVER_PORT'))); $table->addRow(array(new CCol(_('Zabbix server name'), 'header'), $this->getConfig('ZBX_SERVER_NAME'))); return array('Please check configuration parameters.', BR(), 'If all is correct, press "Next" button, or "Previous" button to change configuration parameters.', BR(), BR(), $table); }
function stage4() { $db_type = $this->getConfig('DB_TYPE'); $databases = CFrontendSetup::getSupportedDatabases(); $table = new CFormList(); $table->addRow((new CSpan(_('Database type')))->addClass(ZBX_STYLE_GREY), $databases[$db_type]); switch ($db_type) { case ZBX_DB_SQLITE3: $table->addRow((new CSpan(_('Database file')))->addClass(ZBX_STYLE_GREY), $this->getConfig('DB_DATABASE')); break; default: $db_port = $this->getConfig('DB_PORT') == 0 ? _('default') : $this->getConfig('DB_PORT'); $db_password = preg_replace('/./', '*', $this->getConfig('DB_PASSWORD')); $table->addRow((new CSpan(_('Database server')))->addClass(ZBX_STYLE_GREY), $this->getConfig('DB_SERVER')); $table->addRow((new CSpan(_('Database port')))->addClass(ZBX_STYLE_GREY), $db_port); $table->addRow((new CSpan(_('Database name')))->addClass(ZBX_STYLE_GREY), $this->getConfig('DB_DATABASE')); $table->addRow((new CSpan(_('Database user')))->addClass(ZBX_STYLE_GREY), $this->getConfig('DB_USER')); $table->addRow((new CSpan(_('Database password')))->addClass(ZBX_STYLE_GREY), $db_password); if ($db_type == ZBX_DB_DB2 || $db_type == ZBX_DB_POSTGRESQL) { $table->addRow((new CSpan(_('Database schema')))->addClass(ZBX_STYLE_GREY), $this->getConfig('DB_SCHEMA')); } break; } $table->addRow(null, null); $table->addRow((new CSpan(_('Zabbix server')))->addClass(ZBX_STYLE_GREY), $this->getConfig('ZBX_SERVER')); $table->addRow((new CSpan(_('Zabbix server port')))->addClass(ZBX_STYLE_GREY), $this->getConfig('ZBX_SERVER_PORT')); $table->addRow((new CSpan(_('Zabbix server name')))->addClass(ZBX_STYLE_GREY), $this->getConfig('ZBX_SERVER_NAME')); return [new CTag('h1', true, _('Pre-installation summary')), (new CDiv([new CTag('p', true, _s('Please check configuration parameters. If all is correct, press "%1$s" button, or "%2$s" button to change configuration parameters.', _('Next step'), _('Back'))), $table]))->addClass(ZBX_STYLE_SETUP_RIGHT_BODY)]; }