Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • CoreConfigRequirement
  • DatabaseForm
  • DatabaseOperation
  • DocumentDecorator
  • InstallForm
  • InstallOperation
  • InstallRequirements
  • LanguageElement
  • Operation
  • PanelDecorator
  • PanelForm
  • PDODriversRequirement
  • RepositoryRequirement
  • Requirement
  • Requirements
  • RequirementsOperation
  • SiteForm
  • SiteOperation
  • StepsController
  • TellMeMore
  • UserConfigRequirement
  • UserForm
  • UserOperation
  • WelcomePanel
  • WelcomeRequirements

Functions

  • t
  1 <?php
  2 
  3 /*
  4  * This file is part of the Icybee/Installer package.
  5  *
  6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
  7  *
  8  * For the full copyright and license information, please view the LICENSE
  9  * file that was distributed with this source code.
 10  */
 11 
 12 namespace Icybee\Installer;
 13 
 14 use Brickrouge\Element;
 15 use Brickrouge\Form;
 16 use Brickrouge\Group;
 17 use Brickrouge\Text;
 18 
 19 class UserForm extends PanelForm
 20 {
 21     public function __construct()
 22     {
 23         global $core;
 24 
 25         $values = array();
 26 
 27         if (isset($core->session->install['user']))
 28         {
 29             $values = $core->session->install['user'];
 30 
 31             if (isset($values['password']))
 32             {
 33                 $values['password'];
 34                 $values['password_confirm'] = $values['password'];
 35             }
 36         }
 37 
 38         $random_password = \ICanBoogie\generate_token(8, \ICanBoogie\TOKEN_MEDIUM);
 39 
 40         parent::__construct
 41         (
 42             array
 43             (
 44                 PanelDecorator::TITLE => t('panel.user.title'),
 45                 PanelDecorator::DESCRIPTION => t('panel.user.description'),
 46 
 47                 Form::VALUES => $values,
 48                 Form::HIDDENS => array
 49                 (
 50                     'random_password' => $random_password
 51                 ),
 52 
 53                 Element::CHILDREN => array
 54                 (
 55                     'username' => new Text
 56                     (
 57                         array
 58                         (
 59                             Group::LABEL => 'Username',
 60                             Element::DESCRIPTION => t('panel.user.username'),
 61                             Element::DEFAULT_VALUE => 'admin'
 62                         )
 63                     ),
 64 
 65                     'email' => new Text
 66                     (
 67                         array
 68                         (
 69                             Group::LABEL => 'Your E-mail',
 70                             Element::REQUIRED => true,
 71                             Element::DESCRIPTION => t('panel.user.email')
 72                         )
 73                     ),
 74 
 75                     'password' => new Text
 76                     (
 77                         array
 78                         (
 79                             Group::LABEL => 'Password',
 80                             Element::DESCRIPTION => t('panel.user.password'),
 81 
 82                             'type' => 'password',
 83                             'placeholder' => $random_password
 84                         )
 85                     ),
 86 
 87                     'password_confirm' => new Text
 88                     (
 89                         array
 90                         (
 91                             Element::DESCRIPTION => t('panel.user.password_confirm'),
 92                             Element::LABEL_MISSING => "Password confirm",
 93 
 94                             'type' => 'password',
 95                             'placeholder' => empty($values['password']) ? $random_password : null
 96                         )
 97                     ),
 98 
 99                     'language' => new LanguageElement
100                     (
101                         array
102                         (
103                             Group::LABEL => 'Language',
104                             Element::DESCRIPTION => t('panel.user.language')
105                         )
106                     )
107                 ),
108 
109                 'action' => '/api/install/user',
110                 'autocomplete' => 'off',
111                 'name' => 'user'
112             )
113         );
114     }
115 }
Autodoc API documentation generated by ApiGen 2.8.0