SiteParamsController.php 6.43 KB
<?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;
    }
}