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

  • ActivateOperation
  • AvailableSitesBlock
  • ConfigBlock
  • ConfigOperation
  • DeactivateOperation
  • DeleteBlock
  • DeleteOperation
  • EditBlock
  • Hooks
  • IsUniqueOperation
  • LoginComboElement
  • LoginForm
  • LoginOperation
  • LogoutOperation
  • ManageBlock
  • Model
  • Module
  • OwnershipResolver
  • PermissionResolver
  • ProfileController
  • QueryOperationOperation
  • SaveOperation
  • UnlockLoginOperation
  • Update20131021
  • User
  • ViewProvider

Interfaces

  • OwnershipResolverInterface
  • PermissionResolverInterface

Traits

  • LoggedAtProperty

Exceptions

  • WebsiteAdminNotAccessible
  1 <?php
  2 
  3 /*
  4  * This file is part of the Icybee 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\Modules\Users;
 13 
 14 use ICanBoogie\I18n;
 15 use ICanBoogie\Operation;
 16 
 17 use Brickrouge;
 18 use Brickrouge\A;
 19 use Brickrouge\Button;
 20 use Brickrouge\Element;
 21 use Brickrouge\Form;
 22 use Brickrouge\Text;
 23 
 24 class LoginForm extends Form
 25 {
 26     const PASSWORD_RECOVERY_LINK = '#password-recovery-link';
 27 
 28     public $lost_password = [];
 29 
 30     /**
 31      * Adds the "widget.css" and "widget.js" assets.
 32      *
 33      * @param Brickrouge\Document $document
 34      */
 35     static protected function add_assets(\Brickrouge\Document $document)
 36     {
 37         $document->css->add(DIR . 'public/widget.css');
 38         $document->js->add(DIR . 'public/widget.js');
 39 
 40         parent::add_assets($document);
 41     }
 42 
 43     public function __construct(array $attributes=[])
 44     {
 45         global $core;
 46 
 47         $this->lost_password = new A(I18n\t('lost_password', [], [ 'scope' => 'users.label', 'default' => 'I forgot my password' ]), "#lost-password", [
 48 
 49             'rel' => 'nonce-request'
 50 
 51         ]);
 52 
 53         parent::__construct($attributes + [
 54 
 55             Form::ACTIONS => [
 56 
 57                 new Button('Connect', [
 58 
 59                     'type' => 'submit',
 60                     'class' => 'btn-primary'
 61 
 62                 ])
 63 
 64             ],
 65 
 66             Form::RENDERER => 'Simple',
 67 
 68             Form::HIDDENS => [
 69 
 70                 Operation::DESTINATION => 'users',
 71                 Operation::NAME => Module::OPERATION_LOGIN,
 72                 Operation::SESSION_TOKEN => $core->session->token,
 73                 'redirect_to' => $core->request['redirect_to']
 74 
 75             ],
 76 
 77             Element::CHILDREN => [
 78 
 79                 User::USERNAME => new Text([
 80 
 81                     Form::LABEL => 'username',
 82                     Element::REQUIRED => true,
 83 
 84                     'autofocus' => true
 85 
 86                 ]),
 87 
 88                 User::PASSWORD => new Text([
 89 
 90                     Form::LABEL => 'password',
 91                     Element::REQUIRED => true,
 92                     Element::DESCRIPTION => $this->lost_password,
 93 
 94                     'type' => 'password'
 95 
 96                 ])
 97             ],
 98 
 99             Element::WIDGET_CONSTRUCTOR => 'Login',
100 
101             'class' => 'widget-login',
102             'name' => 'users/login'
103 
104         ]);
105     }
106 
107     public function render()
108     {
109         $password_recovery_link = $this[self::PASSWORD_RECOVERY_LINK];
110 
111         if ($password_recovery_link)
112         {
113             $this->lost_password['href'] = $password_recovery_link;
114         }
115 
116         return parent::render();
117     }
118 }
Autodoc API documentation generated by ApiGen 2.8.0