Blame view

protected/modules/admin/controllers/SiteParamsController.php 6.43 KB
a1684257   Administrator   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
  <?php
  
  class SiteParamsController extends AdminController
  {
      public function actions()
      {
          return array(
              'general' => array(
                  'class' => 'StaticDataEditor',
  
                  'submitLabel' => 'Сохранить',
                  'section' => 'site',
                  'key' => 'general',
                  'view' => '/static_editor',
                  'model' => array(
                      'schema' => array(
                          'first_menu' => array(
                              'label' => 'Первое меню',
                              'default' => array(),
                          ),
                          'second_menu' => array(
                              'label' => 'Второе меню',
                              'default' => array(),
                          ),
                          'footer_menu' => array(
                              'label' => 'Меню в подвале сайта',
                              'default' => array(),
                          ),
  
                          'gallery_id' => array(
                              'label' => 'Слайды под шапкой',
                              'default' => '',
                          ),
                          'contact_gallery_id' => array(
                              'label' => 'Слайды под шапкой на контактов',
                              'default' => '',
                          ),
                          'social_links' => array(
                              'label' => 'Сcилки на соц. сети(тюнинг)',
                              'default' => '',
                          ),
                          'social_links_sport' => array(
                              'label' => 'Сcилки на соц. сети(автоспорт)',
                              'default' => '',
                          ),
                          'bcc_emails' => array(
                              'label' => 'Адреса для скрытых копий писем с визиток',
                              'default' => '',
                          )
                      ),
                      'rules' => array(),
                  ),
                  'form' => array(
                      array(
                          'type' => 'inputWidget',
                          'attribute' => 'first_menu',
                          'class' => 'MenuSelect',
                          'config' => array(),
                      ),
                      array(
                          'type' => 'inputWidget',
                          'attribute' => 'second_menu',
                          'class' => 'MenuSelect',
                          'config' => array(),
                      ),
                      array(
                          'type' => 'inputWidget',
                          'attribute' => 'footer_menu',
                          'class' => 'MenuSelect',
                          'config' => array(),
                      ),
                      array(
                          'type' => 'inputWidget',
                          'class' => 'GalleryInput',
                          'attribute' => 'gallery_id',
                          'config' => array(
                              'versions' => array(
                                  'gallery' => array(
                                      'centeredpreview' => array(1008, 115),
                                  )
                              ),
                              'name' => true,
                              'description' => true,
                              'htmlOptions' => array('style' => 'float:left'),
                          ),
                      ),
                      array(
                          'type' => 'inputWidget',
                          'class' => 'GalleryInput',
                          'attribute' => 'contact_gallery_id',
                          'config' => array(
                              'versions' => array(
                                  'gallery' => array(
                                      'centeredpreview' => array(1008, 115),
                                  )
                              ),
                              'name' => true,
                              'description' => true,
                              'htmlOptions' => array('style' => 'float:left'),
                          ),
                      ),
                      array(
                          'type' => 'simpleInput',
                          'name' => 'textArea',
                          'attribute' => 'social_links',
                          'options' => array('class' => 'input-xxlarge', 'rows' => 10),
                      ),
                      array(
                          'type' => 'simpleInput',
                          'name' => 'textArea',
                          'attribute' => 'social_links_sport',
                          'options' => array('class' => 'input-xxlarge', 'rows' => 10),
                      ),
                      array(
                          'type' => 'simpleInput',
                          'name' => 'textArea',
                          'attribute' => 'bcc_emails',
                          'options' => array('class' => 'input-xxlarge', 'rows' => 10),
                      ),
                  ),
                  'i18nModel' => array(
                      'schema' => array( //                        'contactInfo' => array(
  //                            'label' => 'Контактная информация внизу страниц раздела',
  //                            'default' => null,
  //                        ),
                      ),
                      'rules' => array(),
                  ),
                  'i18nForm' => array( //                    array(
  //                        'type' => 'inputWidget',
  //                        'class' => 'TinyMce',
  //                        'attribute' => 'contactInfo',
  //                        'config' => array(),
  //                    ),
                  ),
              ),
          );
      }
  
      public function getSideMenu()
      {
          $res = array(
              array(
                  'label' => 'Страницы',
                  'items' => array(
                      array(
                          'label' => 'Общие параметры',
                          'url' => array('/' . $this->module->id . '/' . $this->id . '/general'),
                          'icon' => 'icon-file',
                          'active' => '/' . $this->module->id . '\/' . $this->id . '\/general/',
                      ),
                  ),
              ),
          );
          return $res;
      }
  }