ActionPagesController.php 5.84 KB
<?php

class ActionPagesController extends AdminController
{

    public function actions()
    {
        return array(
            'index' => array(
                'class' => 'StaticPageEditor',

                'submitLabel' => 'Сохранить',
                'section' => 'action',
                'key' => 'index',
                'view' => '/static_editor',
                'model' => array(
                    'schema' => array(
                        'contacts' => array(
                            'label' => 'Контакты',
                            'default' => '',
                        ),
                        'gallery_id' => array(
                            'label' => 'Слайды под шапкой',
                            'default' => '',
                        ),
                    ),
                    'rules' => array(),
                ),
                'form' => array(
                    array(
                        'type' => 'inputWidget',
                        'class' => 'ContactsSelect',
                        'attribute' => 'contacts',
                        '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'),
                        ),
                    ),
                ),
                'i18nModel' => array(
                    'schema' => array(
                        'content' => array(
                            'label' => 'Содержимое страницы',
                            'default' => null,
                        ),
                    ),
                    'rules' => array(),
                ),
                'i18nForm' => array(
                    array(
                        'type' => 'inputWidget',
                        'class' => 'TinyMce',
                        'attribute' => 'content',
                        'config' => array(),
                    ),
                ),
            ),
            'finished' => array(
                'class' => 'StaticPageEditor',

                'submitLabel' => 'Сохранить',
                'section' => 'action',
                'key' => 'finished',
                'view' => '/static_editor',
                'model' => array(
                    'schema' => array(
                        'contacts' => array(
                            'label' => 'Контакты',
                            'default' => '',
                        ),
                        'gallery_id' => array(
                            'label' => 'Слайды под шапкой',
                            'default' => '',
                        ),
                    ),
                    'rules' => array(),
                ),
                'form' => array(
                    array(
                        'type' => 'inputWidget',
                        'class' => 'ContactsSelect',
                        'attribute' => 'contacts',
                        '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'),
                        ),
                    ),
                ),
                'i18nModel' => array(
                    'schema' => array(
                        'content' => array(
                            'label' => 'Содержимое страницы',
                            'default' => null,
                        ),
                    ),
                    'rules' => array(),
                ),
                'i18nForm' => array(
                    array(
                        'type' => 'inputWidget',
                        'class' => 'TinyMce',
                        'attribute' => 'content',
                        'config' => array(),
                    ),
                ),
            ),
        );
    }

    public function getSideMenu()
    {
        $res = array(
            array(
                'label' => 'Страницы',
                'items' => array(
                    array(
                        'label' => 'Главная страница(текущие акции)',
                        'url' => array('/' . $this->module->id . '/' . $this->id . '/index'),
                        'icon' => 'icon-file',
                        'active' => '/' . $this->module->id . '\/' . $this->id . '\/index/',
                    ),
                    array(
                        'label' => 'Завершенные акции',
                        'url' => array('/' . $this->module->id . '/' . $this->id . '/finished'),
                        'icon' => 'icon-file',
                        'active' => '/' . $this->module->id . '\/' . $this->id . '\/finished/',
                    ),
                ),
            ),
        );
        return $res;
    }
}