Пример #1
0
 public function __construct()
 {
     global $core;
     $values = array();
     if (isset($core->session->install['database'])) {
         $values = $core->session->install['database'];
     }
     parent::__construct(array(PanelDecorator::TITLE => t('panel.database.title'), PanelDecorator::DESCRIPTION => t('panel.database.description'), Form::VALUES => $values, Element::CHILDREN => array('username' => new Text(array(Group::LABEL => "User name", Element::REQUIRED => true, Element::DESCRIPTION => t('panel.database.username'))), 'password' => new Text(array(Group::LABEL => "Password", 'type' => 'password')), 'name' => new Text(array(Group::LABEL => "Database name", Element::REQUIRED => true, Element::DESCRIPTION => t('panel.database.name'), Element::DEFAULT_VALUE => "icybee")), 'host' => new Text(array(Group::LABEL => "Database host", 'placeholder' => "localhost")), 'prefix' => new Text(array(Group::LABEL => "Table prefix", Element::DESCRIPTION => t('panel.database.prefix')))), 'action' => '/api/install/database', 'autocomplete' => 'off', 'name' => 'database'));
 }
Пример #2
0
 public function __construct()
 {
     global $core;
     $values = array();
     if (isset($core->session->install['site'])) {
         $values = $core->session->install['site'];
     }
     parent::__construct(array(PanelDecorator::TITLE => t('panel.site.title'), PanelDecorator::DESCRIPTION => t('panel.site.description'), Form::VALUES => $values + array('language' => $core->language, 'timezone' => date_default_timezone_get() ?: 'UTC'), Element::CHILDREN => array('title' => new Text(array(Group::LABEL => 'Title', Element::REQUIRED => true)), 'language' => new LanguageElement(array(Group::LABEL => 'Language', Element::REQUIRED => true, Element::DEFAULT_VALUE => $core->language)), 'timezone' => new TimeZone(array(Group::LABEL => 'Timezone', Element::REQUIRED => true))), 'action' => '/api/install/site', 'name' => 'site'));
 }
Пример #3
0
 public function __construct()
 {
     global $core;
     $values = array();
     if (isset($core->session->install['user'])) {
         $values = $core->session->install['user'];
         if (isset($values['password'])) {
             $values['password'];
             $values['password_confirm'] = $values['password'];
         }
     }
     $random_password = \ICanBoogie\generate_token(8, \ICanBoogie\TOKEN_MEDIUM);
     parent::__construct(array(PanelDecorator::TITLE => t('panel.user.title'), PanelDecorator::DESCRIPTION => t('panel.user.description'), Form::VALUES => $values, Form::HIDDENS => array('random_password' => $random_password), Element::CHILDREN => array('username' => new Text(array(Group::LABEL => 'Username', Element::DESCRIPTION => t('panel.user.username'), Element::DEFAULT_VALUE => 'admin')), 'email' => new Text(array(Group::LABEL => 'Your E-mail', Element::REQUIRED => true, Element::DESCRIPTION => t('panel.user.email'))), 'password' => new Text(array(Group::LABEL => 'Password', Element::DESCRIPTION => t('panel.user.password'), 'type' => 'password', 'placeholder' => $random_password)), 'password_confirm' => new Text(array(Element::DESCRIPTION => t('panel.user.password_confirm'), Element::LABEL_MISSING => "Password confirm", 'type' => 'password', 'placeholder' => empty($values['password']) ? $random_password : null)), 'language' => new LanguageElement(array(Group::LABEL => 'Language', Element::DESCRIPTION => t('panel.user.language')))), 'action' => '/api/install/user', 'autocomplete' => 'off', 'name' => 'user'));
 }