1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Installer;
13
14 use ICanBoogie\I18n;
15
16 use Brickrouge\Element;
17 use Brickrouge\Form;
18 use Brickrouge\Group;
19 use Brickrouge\Text;
20 use Brickrouge\Widget\TimeZone;
21
22 class SiteForm extends PanelForm
23 {
24 public function __construct()
25 {
26 global $core;
27
28 $values = array();
29
30 if (isset($core->session->install['site']))
31 {
32 $values = $core->session->install['site'];
33 }
34
35 parent::__construct
36 (
37 array
38 (
39 PanelDecorator::TITLE => t('panel.site.title'),
40 PanelDecorator::DESCRIPTION => t('panel.site.description'),
41
42 Form::VALUES => $values + array
43 (
44 'language' => $core->language,
45 'timezone' => date_default_timezone_get() ?: 'UTC'
46 ),
47
48 Element::CHILDREN => array
49 (
50 'title' => new Text
51 (
52 array
53 (
54 Group::LABEL => 'Title',
55 Element::REQUIRED => true
56 )
57 ),
58
59 'language' => new LanguageElement
60 (
61 array
62 (
63 Group::LABEL => 'Language',
64 Element::REQUIRED => true,
65 Element::DEFAULT_VALUE => $core->language
66 )
67 ),
68
69 'timezone' => new TimeZone
70 (
71 array
72 (
73 Group::LABEL => 'Timezone',
74 Element::REQUIRED => true
75 )
76 )
77 ),
78
79 'action' => '/api/install/site',
80 'name' => 'site'
81 )
82 );
83 }
84 }