1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Users;
13
14 use ICanBoogie\I18n;
15
16 use Brickrouge\A;
17 use Brickrouge\Element;
18
19 use Icybee\Modules\Users\NonceLogin\NonceRequestForm;
20
21 class LoginComboElement extends Element
22 {
23 protected $elements = [];
24
25 public function __construct(array $attributes=[])
26 {
27 $login = new LoginForm;
28 $password = new NonceRequestForm();
29
30 $password->children['email'][Element::DESCRIPTION] = new A(I18n\t('Cancel', [], [ 'scope' => 'button' ]));
31
32 $this->elements['login'] = $login;
33 $this->elements['password'] = $password;
34
35 parent::__construct('div', $attributes + [
36
37 Element::WIDGET_CONSTRUCTOR => 'LoginCombo',
38
39 'id' => 'login',
40 'class' => 'widget-login-combo'
41
42 ]);
43 }
44
45 protected function render_inner_html()
46 {
47 return parent::render_inner_html() . <<<EOT
48 {$this->elements['login']}
49 {$this->elements['password']}
50 EOT;
51 }
52 }