ServicePagesController.php 2.75 KB
<?php

class ServicePagesController extends AdminController
{

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

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