__construct() 공개 메소드

Constructor.
public __construct ( $request, $template )
예제 #1
0
 /**
  * Constructor.
  * @param $request PKPRequest
  */
 function __construct($request)
 {
     parent::__construct($request, 'install/install.tpl');
     // FIXME Move the below options to an external configuration file?
     $this->supportedLocales = AppLocale::getAllLocales();
     $this->localesComplete = array();
     foreach ($this->supportedLocales as $key => $name) {
         $this->localesComplete[$key] = AppLocale::isLocaleComplete($key);
     }
     $this->supportedClientCharsets = array('utf-8' => 'Unicode (UTF-8)', 'iso-8859-1' => 'Western (ISO-8859-1)');
     $this->supportedConnectionCharsets = array('' => __('common.notApplicable'), 'utf8' => 'Unicode (UTF-8)');
     $this->supportedDatabaseCharsets = array('' => __('common.notApplicable'), 'utf8' => 'Unicode (UTF-8)');
     $this->supportedDatabaseDrivers = array('mysql' => array('mysql', 'MySQL'), 'mysqli' => array('mysqli', 'MySQLi'), 'postgres' => array('pgsql', 'PostgreSQL'), 'oracle' => array('oci8', 'Oracle'), 'mssql' => array('mssql', 'MS SQL Server'), 'fbsql' => array('fbsql', 'FrontBase'), 'ibase' => array('ibase', 'Interbase'), 'firebird' => array('ibase', 'Firebird'), 'informix' => array('ifx', 'Informix'), 'sybase' => array('sybase', 'Sybase'), 'odbc' => array('odbc', 'ODBC'));
     // Validation checks for this form
     $this->addCheck(new FormValidatorInSet($this, 'locale', 'required', 'installer.form.localeRequired', array_keys($this->supportedLocales)));
     $this->addCheck(new FormValidatorCustom($this, 'locale', 'required', 'installer.form.localeRequired', array('AppLocale', 'isLocaleValid')));
     $this->addCheck(new FormValidatorInSet($this, 'clientCharset', 'required', 'installer.form.clientCharsetRequired', array_keys($this->supportedClientCharsets)));
     $this->addCheck(new FormValidator($this, 'filesDir', 'required', 'installer.form.filesDirRequired'));
     $this->addCheck(new FormValidator($this, 'adminUsername', 'required', 'installer.form.usernameRequired'));
     $this->addCheck(new FormValidatorUsername($this, 'adminUsername', 'required', 'installer.form.usernameAlphaNumeric'));
     $this->addCheck(new FormValidator($this, 'adminPassword', 'required', 'installer.form.passwordRequired'));
     $this->addCheck(new FormValidatorCustom($this, 'adminPassword', 'required', 'installer.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'adminPassword2\');'), array($this)));
     $this->addCheck(new FormValidatorEmail($this, 'adminEmail', 'required', 'installer.form.emailRequired'));
     $this->addCheck(new FormValidatorInSet($this, 'databaseDriver', 'required', 'installer.form.databaseDriverRequired', array_keys($this->supportedDatabaseDrivers)));
     $this->addCheck(new FormValidator($this, 'databaseName', 'required', 'installer.form.databaseNameRequired'));
 }
 /**
  * Constructor.
  */
 function __construct($request)
 {
     parent::__construct($request, 'install/upgrade.tpl');
 }