Commits

Bogdan Savluk committed 92adf33 Merge

Merge changes from i18d fork

  • Participants
  • Parent commits 1f4b308, 7b0b631

Comments (0)

Files changed (46)

 testapp/protected/extensions/fileimagearbehavior=https://bitbucket.org/z_bodya/fileimagearbehavior
 testapp/protected/extensions/galleryManager=https://bitbucket.org/z_bodya/gallerymanager
 testapp/protected/extensions/image=https://bitbucket.org/z_bodya/yii-image
+testapp/protected/extensions/swiftMailer=https://bitbucket.org/z_bodya/yii-swiftmailer
+testapp/protected/extensions/multiselect=https://bitbucket.org/z_bodya/yii-multiselect
+testapp/protected/extensions/datetimepicker=https://bitbucket.org/z_bodya/yii-datetimepicker
 
 ac3ad7cfbd5100c05cc5761b946098d6f1f8d33f testapp/protected/extensions/chosen
 10f95710bd0c9fabee232b0b5dd6d0b9fa0c1928 testapp/protected/extensions/coordinatepicker
+9de050cb21a3dd1e4be5399dfd3f2cc2d7a6df01 testapp/protected/extensions/datetimepicker
 02a356417545212772a8f73651d4052f8648f591 testapp/protected/extensions/elFinder
 9b139a80de80fe528f69d02e57ef6af02a6e88f9 testapp/protected/extensions/fileimagearbehavior
 46dbff057db9e290ac46992c9bf4d3ccbec7ff29 testapp/protected/extensions/galleryManager
 2c669abd97f92c898b10672b8ebf0f2f7e73ff27 testapp/protected/extensions/image
+2ac3fda0ab7e2754826e5969cff43ec5ddf4229b testapp/protected/extensions/multiselect
+29a901c09ec8ec796efe967b2eb127790a78e3ea testapp/protected/extensions/swiftMailer
 4a204c302973fade3c2afdf56aec9729c5b655d5 testapp/protected/extensions/tinymce

File testapp/index.php

File contents unchanged.

File testapp/protected/components/Controller.php

  */
 class Controller extends CController
 {
-	/**
-	 * @var string the default layout for the controller view. Defaults to '//layouts/column1',
-	 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
-	 */
-	public $layout='//layouts/column1';
-	/**
-	 * @var array context menu items. This property will be assigned to {@link CMenu::items}.
-	 */
-	public $menu=array();
-	/**
-	 * @var array the breadcrumbs of the current page. The value of this property will
-	 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
-	 * for more details on how to specify this property.
-	 */
-	public $breadcrumbs=array();
+    /**
+     * @var string the default layout for the controller view. Defaults to '//layouts/column1',
+     * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
+     */
+    public $layout = '//layouts/column1';
+    /**
+     * @var array context menu items. This property will be assigned to {@link CMenu::items}.
+     */
+    public $menu = array();
+    /**
+     * @var array the breadcrumbs of the current page. The value of this property will
+     * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
+     * for more details on how to specify this property.
+     */
+    public $breadcrumbs = array();
+
+
+    public $keywords = null;
+    public $description = null;
+    public $pageName;
+    private $_pageTitle;
+
+    public function setSEOParams($title = null, $keywords = null, $description = null)
+    {
+        if ($title) $this->pageTitle = $title;
+        if ($keywords) $this->keywords = $keywords;
+        if ($description) $this->description = $description;
+    }
+
+    /**
+     * @return string the page title. Defaults to the controller name and the action name.
+     */
+    public function getPageTitle()
+    {
+        if ($this->_pageTitle !== null)
+            return $this->_pageTitle;
+        else {
+            if (!empty($this->pageName))
+                $this->_pageTitle = $this->pageName . " | " . Yii::app()->name;
+            else
+                $this->_pageTitle = Yii::app()->name;
+            return $this->_pageTitle;
+        }
+    }
+
+    /**
+     * @param string $value the page title.
+     */
+    public function setPageTitle($value)
+    {
+        $this->_pageTitle = $value;
+    }
 }

File testapp/protected/config/main.php.dist

         'ext.galleryManager.*',
         'ext.galleryManager.models.*',
         'ext.chosen.*',
+        'ext.swiftMailer.*',
     ),
 
     'modules' => array(
 
     // application components
     'components' => array(
+        'swiftMailer'=>array(
+            'class'=>'ext.swiftMailer.YiiSwiftMailer'
+        ),
+        'assetManager' => array(
+            'linkAssets' => true,
+        ),
         'widgetFactory' => array(
             'class' => 'CWidgetFactory',
             'widgets' => array(
                         'connectorRoute'=>'admin/elfinder/connector',
                     )
                 ),
-                'GalleryManager'=>array(
+                'GalleryManager' => array(
                     'controllerRoute' => '/admin/gallery',
-                ) ,
-                'ServerFileInput'=>array(
+                ),
+                'ServerFileInput' => array(
                     'connectorRoute' => 'admin/elfinder/connector',
                 ),
                 'ElFinderWidget' => array(
-                    'connectorRoute'=>'admin/elfinder/connector',
+                    'connectorRoute' => 'admin/elfinder/connector',
                 ),
             )
         ),

File testapp/protected/data/database.sql

File contents unchanged.

File testapp/protected/models/StaticData.php

File contents unchanged.

File testapp/protected/models/StaticPage.php

File contents unchanged.

File testapp/protected/modules/admin/assets/admin.css

     background-color: #eeeeee; /* Old browsers */
     background-repeat: repeat-x; /* Repeat the gradient */
     background-image: -moz-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* FF3.6+ */
-    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */
-    background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Chrome 10+,Safari 5.1+ */
-    background-image: -ms-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* IE10+ */
-    background-image: -o-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Opera 11.10+ */
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */
-    background-image: linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* W3C */
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f5f5f5), color-stop(100%, #eeeeee)); /* Chrome,Safari4+ */
+    background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* Chrome 10+,Safari 5.1+ */
+    background-image: -ms-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* IE10+ */
+    background-image: -o-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* Opera 11.10+ */
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#f5f5f5', endColorstr = '#eeeeee', GradientType = 0); /* IE6-9 */
+    background-image: linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* W3C */
     border: 1px solid #e5e5e5;
     -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
     border-radius: 4px;
 }
+
 .subnav .nav {
     margin-bottom: 0;
 }
+
 .subnav .nav > li > a {
     margin: 0;
-    padding-top:    11px;
+    padding-top: 11px;
     padding-bottom: 11px;
     border-left: 1px solid #f5f5f5;
     border-right: 1px solid #e5e5e5;
     -moz-border-radius: 0;
     border-radius: 0;
 }
+
 .subnav .nav > .active > a,
 .subnav .nav > .active > a:hover {
     padding-left: 13px;
     background-color: #e9e9e9;
     border-right-color: #ddd;
     border-left: 0;
-    -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
-    -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
-    box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
+    -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .05);
+    -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .05);
+    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .05);
 }
+
 .subnav .nav > .active > a .caret,
 .subnav .nav > .active > a:hover .caret {
     border-top-color: #777;
 }
+
 .subnav .nav > li:first-child > a,
 .subnav .nav > li:first-child > a:hover {
     border-left: 0;
     -moz-border-radius: 4px 0 0 4px;
     border-radius: 4px 0 0 4px;
 }
+
 .subnav .nav > li:last-child > a {
     border-right: 0;
 }
+
 .subnav .dropdown-menu {
     -webkit-border-radius: 0 0 4px 4px;
     -moz-border-radius: 0 0 4px 4px;
         -webkit-border-radius: 0;
         -moz-border-radius: 0;
         border-radius: 0;
-        -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
-        -moz-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
-        box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
+        -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0, 0, 0, .1);
+        -moz-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0, 0, 0, .1);
+        box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0, 0, 0, .1);
     }
-    .subnav-fixed .nav {
-        width: 938px;
-        margin: 0 auto;
-        padding: 0 1px;
-    }
+
+    /*
+        .subnav-fixed .nav {
+            width: 938px;
+            margin: 0 auto;
+            padding: 0 1px;
+        }
+    */
     .subnav .nav > li:first-child > a,
     .subnav .nav > li:first-child > a:hover {
         -webkit-border-radius: 0;

File testapp/protected/modules/admin/assets/bootstrap/css/bootstrap-responsive.css

File contents unchanged.

File testapp/protected/modules/admin/assets/bootstrap/css/bootstrap-responsive.min.css

File contents unchanged.

File testapp/protected/modules/admin/assets/bootstrap/css/bootstrap.css

File contents unchanged.

File testapp/protected/modules/admin/assets/bootstrap/css/bootstrap.min.css

File contents unchanged.

File testapp/protected/modules/admin/assets/bootstrap/js/bootstrap.js

File contents unchanged.

File testapp/protected/modules/admin/assets/bootstrap/js/bootstrap.min.js

File contents unchanged.

File testapp/protected/modules/admin/components/StaticDataEditor.php

         }
 
         $form = $this->getController()->beginWidget('BHorizontalForm', array());
-        $this->getController()->beginWidget('FormGenerator', array(
+        $this->getController()->beginWidget('FormWidget', array(
             'form' => $form,
             'model' => $model,
             'config' => $this->form,

File testapp/protected/modules/admin/components/StaticPageEditor.php

                 'config' => array(
                     array(
                         'type' => 'widget',
-                        'class' => 'FormGenerator',
+                        'class' => 'FormWidget',
                         'config' => array(
                             'form' => $form,
                             'model' => $dataModel,
                 //'change_freq',
             ),
         );
-        $this->getController()->widget('FormGenerator', array(
+        $this->getController()->widget('FormWidget', array(
             'form' => $form,
             'model' => $model,
             'config' => $formConfig,

File testapp/protected/modules/admin/components/widgets/FormGenerator.php

-<?php
-/**
- * Widget to render form by config in BHorizontalForm.
- */
-class FormGenerator extends CWidget
-{
-    /**
-     * @var BHorizontalForm
-     */
-    public $form;
-    /**
-     * @var CModel
-     */
-    public $model;
-    /**
-     * Suffix to separate different input  with same model, like: Model[suf1][field1] and Model[suf2][field1]
-     * @var string
-     */
-    public $suffix;
-    /**
-     * @var array
-     */
-    public $config = array(
-        array(
-            'type' => 'widget',
-            'class' => 'ClassName',
-            'config' => array(),
-        ),
-        array(
-            'type' => 'inputWigdet',
-            'class' => 'ClassName',
-            'attribute' => 'attribute',
-            'config' => array(),
-        ),
-        array(
-            'type' => 'simpleInput',
-            'name' => 'textField',
-            'attribute' => 'attribute',
-            'options' => array(),
-        ),
-        array(
-            'type' => 'listInput',
-            'name' => 'textField',
-            'attribute' => 'attribute',
-            'data' => array(),
-            'options' => array(),
-        ),
-    );
-
-    public function init()
-    {
-        parent::init();
-    }
-
-    public function run()
-    {
-        parent::run();
-        $this->renderForm($this->config);
-    }
-
-    private function renderForm($config)
-    {
-        foreach ($config as $item) {
-            switch ($item['type']) {
-                case 'fieldset':
-                    echo  $this->form->beginFieldset($item['legend']);
-                    $this->renderForm($item['config']);
-                    echo $this->form->endFieldset();
-                    break;
-                case 'widget':
-                    Yii::app()->getController()->widget($item['class'], $item['config']);
-                    break;
-
-                case 'inputWidget':
-                    $config = isset($item['config'])?$item['config']:array();
-                    if (isset($this->suffix)) {
-                        $attr = '[' . $this->suffix . ']' . $item['attribute'];
-                    } else {
-                        $attr = $item['attribute'];
-                    }
-                    $config['attribute'] = $attr;
-                    $config['model'] = $this->model;
-                    echo $this->form->beginControlGroup($this->model, $attr);
-                    Yii::app()->getController()->widget($item['class'], $config);
-                    echo $this->form->endControlGroup();
-                    break;
-                case 'simpleInput':
-                    $method = $item['name'] . 'ControlGroup';
-                    echo $this->form->$method($this->model, $item['attribute'], $item['options']);
-                    break;
-                case 'listInput':
-                    $method = $item['name'] . 'ControlGroup';
-                    echo $this->form->$method($this->model, $item['attribute'], $item['data'], $item['options']);
-                    break;
-                default:
-                    throw new CException('Not implemented!!!');
-            }
-        }
-    }
-
-}

File testapp/protected/modules/admin/components/widgets/FormWidget.php

+<?php
+/**
+ * Widget to render form by config in BHorizontalForm.
+ */
+class FormWidget extends CWidget
+{
+    /**
+     * @var BHorizontalForm
+     */
+    public $form;
+    /**
+     * @var CModel
+     */
+    public $model;
+    /**
+     * Suffix to separate different input  with same model, like: Model[suf1][field1] and Model[suf2][field1]
+     * @var string
+     */
+    public $suffix;
+    /**
+     * @var array
+     */
+    public $config = array(
+        array(
+            'type' => 'widget',
+            'class' => 'ClassName',
+            'config' => array(),
+        ),
+        array(
+            'type' => 'inputWigdet',
+            'class' => 'ClassName',
+            'attribute' => 'attribute',
+            'config' => array(),
+        ),
+        array(
+            'type' => 'simpleInput',
+            'name' => 'textField',
+            'attribute' => 'attribute',
+            'options' => array(),
+        ),
+        array(
+            'type' => 'listInput',
+            'name' => 'textField',
+            'attribute' => 'attribute',
+            'data' => array(),
+            'options' => array(),
+        ),
+    );
+
+    public function init()
+    {
+        parent::init();
+    }
+
+    public function run()
+    {
+        parent::run();
+        $this->renderForm($this->config);
+    }
+
+    private function renderForm($config)
+    {
+        foreach ($config as $item) {
+            switch ($item['type']) {
+                case 'fieldset':
+                    echo  $this->form->beginFieldset($item['legend']);
+                    $this->renderForm($item['config']);
+                    echo $this->form->endFieldset();
+                    break;
+                case 'widget':
+                    Yii::app()->getController()->widget($item['class'], $item['config']);
+                    break;
+
+                case 'inputWidget':
+                    $config = isset($item['config']) ? $item['config'] : array();
+                    if (isset($this->suffix)) {
+                        $attr = '[' . $this->suffix . ']' . $item['attribute'];
+                    } else {
+                        $attr = $item['attribute'];
+                    }
+                    $config['attribute'] = $attr;
+                    $config['model'] = $this->model;
+                    echo $this->form->beginControlGroup($this->model, $attr);
+                    Yii::app()->getController()->widget($item['class'], $config);
+                    echo $this->form->endControlGroup();
+                    break;
+                case 'simpleInput':
+                    if (isset($this->suffix)) {
+                        $attr = '[' . $this->suffix . ']' . $item['attribute'];
+                    } else {
+                        $attr = $item['attribute'];
+                    }
+                    $method = $item['name'] . 'ControlGroup';
+                    $options = isset($item['options'])?$item['options']:array();
+                    echo $this->form->$method($this->model, $attr, $options);
+                    break;
+                case 'listInput':
+                    if (isset($this->suffix)) {
+                        $attr = '[' . $this->suffix . ']' . $item['attribute'];
+                    } else {
+                        $attr = $item['attribute'];
+                    }
+                    $method = $item['name'] . 'ControlGroup';
+                    $options = isset($item['options'])?$item['options']:array();
+                    echo $this->form->$method($this->model, $attr, $item['data'], $options);
+                    break;
+                default:
+                    throw new CException('Not implemented!!!');
+            }
+        }
+    }
+
+}

File testapp/protected/modules/admin/components/widgets/GalleryInput.php

+<?php
+/**
+ * Created by JetBrains PhpStorm.
+ * User: z_bodya
+ * Date: 8/2/12
+ * Time: 10:53 PM
+ * To change this template use File | Settings | File Templates.
+ */
+class GalleryInput extends CWidget
+{
+    /**
+     * @var CModel the data model associated with this widget.
+     */
+    public $model;
+    /**
+     * @var string the attribute associated with this widget.
+     * The name can contain square brackets (e.g. 'name[1]') which is used to collect tabular data input.
+     */
+    public $attribute;
+    /**
+     * @var array additional HTML options to be rendered in the input tag
+     */
+    public $htmlOptions = array();
+    /**
+     * @var array Settings for image auto-generation
+     * @example
+     *  array(
+     *       'small' => array(
+     *              'resize' => array(200, null),
+     *       ),
+     *      'medium' => array(
+     *              'resize' => array(800, null),
+     *      )
+     *  );
+     */
+    public $versions;
+    /** @var boolean does images in gallery need names */
+    public $name;
+    /** @var boolean does images in gallery need descriptions */
+    public $description;
+    /** @var boolean does images in gallery need links */
+    public $link;
+
+    public function run()
+    {
+        $name = CHtml::resolveName($this->model, $this->attribute);
+        $value = $this->model->{$this->attribute};
+
+        if (empty($value)) {
+            $gallery = new Gallery();
+            $gallery->name = $this->name;
+            $gallery->description = $this->description;
+            $gallery->link = $this->link;
+            $gallery->versions = $this->versions;
+            $gallery->save();
+
+            $value = $gallery->id;
+        } else {
+            $gallery = Gallery::model()->findByPk((int)$value);
+            $changed = false;
+            if ($gallery->name != $this->name) {
+                $changed = true;
+            }
+            if ($gallery->description != $this->description) {
+                $changed = true;
+            }
+            if ($gallery->link != $this->link) {
+                $changed = true;
+            }
+            if ($gallery->versions_data != serialize($this->versions)) {
+                $changed = true;
+            }
+            if ($changed) {
+                foreach ($gallery->galleryPhotos as $photo) {
+                    $photo->removeImages();
+                }
+
+                $gallery->name = $this->name;
+                $gallery->description = $this->description;
+                $gallery->link = $this->link;
+                $gallery->versions = $this->versions;
+
+                $gallery->save();
+
+                foreach ($gallery->galleryPhotos as $photo) {
+                    $photo->updateImages();
+                }
+            }
+        }
+//        CVarDumper::dump($gallery,10,true);exit();
+
+        echo CHtml::hiddenField($name, $value);
+        $this->widget('GalleryManager', array(
+            'gallery' => $gallery,
+            'htmlOptions' => $this->htmlOptions,
+        ));
+    }
+}

File testapp/protected/modules/admin/components/widgets/WidgetTabs.php

+<?php
+/**
+ * Widget to render nested widgets in tabs
+ */
+class WidgetTabs extends CWidget
+{
+
+    /**
+     * Each element in configuration for corresponding tab, it should be an dictionary with following keys
+     * label - tab label
+     * className - widget class for tab
+     * properties - widget configuration
+     * @var array
+     */
+    public $tabs = array();
+
+    public function init()
+    {
+    }
+
+    public function run()
+    {
+        /**
+         * @var BTabs $tabs
+         */
+        $tabs = $this->getController()->beginWidget('BTabs');
+        foreach ($this->tabs as $tab) {
+            $tabs->beginTab($tab['label']);
+            $this->getController()->widget($tab['className'], $tab['properties']);
+            $tabs->endTab();
+        }
+        $this->getController()->endWidget();
+    }
+
+}

File testapp/protected/modules/admin/config/mainMenu.php

 // ),
 return array(
     array(
-        'label' => 'Сайт',
-        'plain' => false,
+        'label' => 'Test area',
         'items' => array(
             array(
-                'label' => 'Статические страницы',
-                'url' => array('/admin/staticPage/web'),
-                'activateOn' => array(
-                    array('route' => '/admin\/staticPage/',),
-                ),
+                'label' => 'StaticData Editor',
+                'url' => array('/admin/test/index'),
+                'roles' => 'developer',
             ),
             array(
-                'label' => 'Текстовые страницы',
-                'url' => array('/admin/pageManager'),
-                'activateOn' => array(
-                    array('route' => '/admin\/pageManager/',),
-                ),
-            ),
-        ),
-    ),
-    array(
-        'label' => 'Параметры сайта',
-        'plain' => true,
-        'items' => array(
-            array(
-                'label' => 'Параметры сайта',
-                'url' => array('/admin/params/index'),
-                'activateOn' => array(
-                    array('route' => '/admin\/params\/index/',),
-                ),
-            ),
-        ),
-    ),
-//    array(
-//        'label' => 'Test1',
-//        'plain' => false,
-//        'items' => array(
-//            array(
-//                'label' => 'Главная',
-//                'url' => array('/admin/mainPage/index'),
-//                'activateOn' => array(
-//                    array('route' => '/admin\/mainPage/',),
-//                ),
-//            ),
-//            array(
-//                'label' => 'Услуги',
-//                'url' => array('/admin/service/web'),
-//                'activateOn' => array(
-//                    array('route' => '/admin\/service/',),
-//                ),
-//            ),
-//            array(
-//                'label' => 'Текстовые страницы',
-//                'url' => array('/admin/pageManager'),
-//                'activateOn' => array(
-//                    array('route' => '/admin\/pageManager/',),
-//                ),
-//            ),
-//        ),
-//    ),
-    array(
-        'label' => 'Test area',
-        'items' => array(
-            array(
                 'label' => 'Gallery Manager',
                 'url' => array('/admin/test/gallery'),
                 'roles' => 'developer',
                 'url' => array('/admin/test/widgets'),
                 'roles' => 'developer',
             ),
-            array(
-                'label' => 'Data',
-                'url' => array('/admin/test/index'),
-                'roles' => 'developer',
-            ),
         )
     )
 );

File testapp/protected/modules/admin/controllers/DefaultController.php

     {
         // $this->layout = 'base';
         // $this->render('index');
-        $this->redirect(array('/admin/staticPage/web'));
+        $this->redirect(array('/admin/test/index'));
     }
 
     public function actionChangePassword()

File testapp/protected/modules/admin/controllers/PageManagerController.php

-<?php
-
-class PageManagerController extends CrudController
-{
-    public $modelName = 'Page';
-}

File testapp/protected/modules/admin/controllers/ParamsController.php

-<?php
-
-class ParamsController extends AdminController
-{
-    public function actions()
-    {
-        return array(
-            'index' => array(
-                'class' => 'StaticDataEditor',
-
-                'submitLabel' => 'Сохранить',
-                'storageModel' => 'StaticData',
-                'key' => 100,
-                'view' => 'static_editor',
-                'model' => array(
-                    'schema' => array(
-                        'phone' => array(
-                            'label' => 'Телефон в шапке и подвале сайта',
-                            'default' => '<span class="tel-code">(495)</span> 585-88-99',
-                        ),
-                        'adminEmail' => array(
-                            'label' => 'Email для уведомлений с сайта',
-                            'default' => 'admin@example.com',
-                        ),
-                    ),
-                    'rules' => array(),
-                ),
-                'form' => array(
-                    array(
-                        'type' => 'fieldset',
-                        'legend' => 'Параметры сайта',
-                        'config' => array(
-                            array(
-                                'type' => 'simpleInput',
-                                'name' => 'textField',
-                                'attribute' => 'phone',
-                                'options' => array('class' => 'input-xxlarge'),
-                            ),
-                            array(
-                                'type' => 'simpleInput',
-                                'name' => 'textField',
-                                'attribute' => 'adminEmail',
-                                'options' => array('class' => 'input-xxlarge', 'type' => 'email'),
-                            ),
-                        ),
-                    ),
-                ),
-            ),
-        );
-    }
-}

File testapp/protected/modules/admin/controllers/StaticPageController.php

-<?php
-/**
- * Created by JetBrains PhpStorm.
- * User: z_bodya
- * Date: 4/5/12
- * Time: 4:59 PM
- * To change this template use File | Settings | File Templates.
- */
-class StaticPageController extends AdminController
-{
-    public function actions()
-    {
-        $model = array(
-            'schema' => array(
-                'content' => array(
-                    'label' => 'Контент',
-                    'default' => null,
-                ),
-            ),
-            'rules' => array(),
-        );
-        $tinyFull = array(
-            'htmlOptions' => array(
-                'rows' => 6,
-                'cols' => 60,
-            ),
-        );
-        $web = array(
-            'class' => 'StaticPageEditor',
-
-            'submitLabel' => 'Сохранить',
-            'section' => 'service',
-            'key' => 'web',
-            'view' => '/static_editor',
-            'model' => $model,
-            'form' => array(
-                array(
-                    'type' => 'inputWidget',
-                    'class' => 'ext.tinymce.TinyMce',
-                    'attribute' => 'content',
-                    'config' => $tinyFull,
-                ),
-            ),
-        );
-        $mobile = $web;
-        $mobile['key'] = 'mobile';
-        $promo = $web;
-        $promo['key'] = 'promo';
-        $style = $web;
-        $style['key'] = 'style';
-        return array(
-            'web' => $web,
-            'mobile' => $mobile,
-            'promo' => $promo,
-            'style' => $style,
-        );
-    }
-
-    public function getSideMenu()
-    {
-        $res = array(
-            array(
-                'label' => 'Страницы',
-                'items' => array(
-                    array(
-                        'label' => 'Разработка веб-сайтов',
-                        'url' => array('/admin/service/web'),
-                        'icon' => 'icon-file',
-                        'active' => '/\/service\/web/',
-                    ),
-                    array(
-                        'label' => 'Разработка мобильных приложений',
-                        'url' => array('/admin/service/mobile'),
-                        'icon' => 'icon-file',
-                        'active' => '/\/service\/mobile/',
-                    ),
-                    array(
-                        'label' => 'Оптимизация, продвижение и реклама',
-                        'url' => array('/admin/service/promo'),
-                        'icon' => 'icon-file',
-                        'active' => '/\/service\/promo/',
-                    ),
-                    array(
-                        'label' => 'Разработка фирменного стиля',
-                        'url' => array('/admin/service/style'),
-                        'icon' => 'icon-file',
-                        'active' => '/\/service\/style/',
-                    ),
-                ),
-            ),
-        );
-        return $res;
-    }
-}
-

File testapp/protected/modules/admin/controllers/TestController.php

     public $long;
 
     public $text;
+    public $date = '10.12.2012 13:35:00';
     public $password;
     public $checkBox;
     public $textArea;
             'dropDown' => 'DropDown',
             'file' => 'File',
             'serverFile' => 'Server File',
+            'date' => 'DateTime input',
         );
     }
 
         $gallery = Gallery::model()->findByPk(1);
         if (empty($gallery)) {
             $gallery = new Gallery();
-            $gallery->name = true;
-            $gallery->description = true;
-            $gallery->versions = array(
-                'small' => array(
-                    'resize' => array(200, null),
-                ),
-                'medium' => array(
-                    'resize' => array(800, null),
-                )
-            );
-            $gallery->save();
-//            print_r($gallery->getErrors());
         }
 
         $gallery->name = true;

File testapp/protected/modules/admin/gii/bcrud/BCrudGenerator.php

 <?php
 
+require_once(dirname(__FILE__) . '/CrudCode.php');
+
 class BCrudGenerator extends CCodeGenerator
 {
-	public $codeModel='gii.generators.crud.CrudCode';
+	public $codeModel='CrudCode';
 }

File testapp/protected/modules/admin/gii/bcrud/templates/default/admin.php

 ?>
 
 $this->actionsMenu = array(
-    array('label' => 'Добавить <?php echo $this->modelClass; ?>', 'url' => array('create'), 'icon' => 'icon-plus', 'active' => '/\/create/'),
+    array('label' => 'Добавить <?php echo $this->modelClass; ?>', 'url' => array('create'), 'icon' => 'icon-plus', 'active' => '/'.$this->id.'\/create/'),
 );
 
 ?>

File testapp/protected/modules/admin/gii/bcrud/templates/default/create.php

 ?>
 
 $this->actionsMenu = array(
-    array('label' => 'Управление <?php echo $this->modelClass; ?>', 'url' => array('admin'), 'icon'=>'icon-list', 'active'=>'/\/admin/'),
+    array('label' => 'Управление <?php echo $this->modelClass; ?>', 'url' => array('admin'), 'icon'=>'icon-list', 'active'=>'/'.$this->id.'\/admin/'),
 );
 ?>
 

File testapp/protected/modules/admin/gii/bcrud/templates/default/update.php

 $label=$this->pluralize($this->class2name($this->modelClass));
 ?>
 $this->actionsMenu = array(
-array('label' => 'Добавить <?php echo $this->modelClass; ?>', 'url' => array('create'), 'icon'=>'icon-plus', 'active'=>'/\/create/'),
-array('label' => 'Управление <?php echo $this->modelClass; ?>', 'url' => array('admin'), 'icon'=>'icon-list', 'active'=>'/\/admin/'),
+array('label' => 'Добавить <?php echo $this->modelClass; ?>', 'url' => array('create'), 'icon'=>'icon-plus', 'active'=>'/'.$this->id.'\/create/'),
+array('label' => 'Управление <?php echo $this->modelClass; ?>', 'url' => array('admin'), 'icon'=>'icon-list', 'active'=>'/'.$this->id.'\/admin/'),
 );
 ?>
 

File testapp/protected/modules/admin/views/default/changePassword.php

  * @var ChangePasswordForm $model
  */
 ?>
-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span12">
             <?php
             /**

File testapp/protected/modules/admin/views/default/index.php

-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span2">&nbsp;</div>
         <div class="span8">
             <h2>Добро пожаловать в систему управления контентом!</h2>

File testapp/protected/modules/admin/views/layouts/base.php

 
 </head>
 <body>
-<div class="navbar navbar-fixed-top navbar-inverse" style="z-index: 1031;">
+<div class="navbar navbar-inverse navbar-fixed-top" style="z-index: 1031;">
     <div class="navbar-inner">
-        <div class="container">
+        <div class="container-fluid">
             <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                 <span class="icon-bar"></span>
                 <span class="icon-bar"></span>
                 ));
                 ?>
                 <ul class="nav pull-right">
+                    <li class="divider-vertical"></li>
                     <li class="dropdown">
                         <a href="#"
                            class="dropdown-toggle"
                            data-toggle="dropdown">
-                            <?php echo Yii::app()->user->fullName ?>
+                            <i class="icon-user icon-white"></i>
                             <b class="caret"></b>
                         </a>
                         <ul class="dropdown-menu">
+                            <li><a><b><?php echo Yii::app()->user->fullName ?></b></a></li>
+                            <li class="divider"></li>
                             <li><?php echo CHtml::link('Сменить пароль', array('/admin/default/changePassword'))?></li>
                             <?php if (Yii::app()->user->checkAccess('admin')): ?>
                             <li><?php echo CHtml::link('Управление пользователями', array('/admin/user/admin'))?></li>
 
 <?php if (!empty($this->module->sectionMenu)): ?>
 <div class="subnav subnav-fixed">
-    <?php
-    $this->widget('BHorizontalMenu', array(
-        'items' => $this->module->sectionMenu,
-        'class' => 'nav nav-pills',
-        'style' => 'width:1170px;',
-    ));
-    ?>
-    <!--    <ul class="nav nav-pills">-->
-    <!--        <li><a href="#labels">Labels</a></li>-->
-    <!--        <li><a href="#thumbnails">Thumbnails</a></li>-->
-    <!--        <li><a href="#alerts">Alerts</a></li>-->
-    <!--        <li><a href="#progress">Progress bars</a></li>-->
-    <!--        <li><a href="#misc">Miscellaneous</a></li>-->
-    <!--    </ul>-->
+    <div class="container-fluid">
+        <?php
+        $this->widget('BHorizontalMenu', array(
+            'items' => $this->module->sectionMenu,
+            'class' => 'nav nav-pills',
+        ));
+        ?>
+    </div>
 </div>
+
     <?php endif;?>
-
 <?php echo $content ?>
 </body>
 </html>

File testapp/protected/modules/admin/views/layouts/crud_layout.php

  */
 ?>
 <?php $this->beginContent('/layouts/base'); ?>
-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span2">
             <div class="">
                 <?php

File testapp/protected/modules/admin/views/pageManager/_form.php

-<div class="form">
-
-    <?php
-    /**
-     * @var BHorizontalForm $form
-     * @var Page $model
-     */
-    ?>
-
-    <?php $form = $this->beginWidget('BHorizontalForm',
-    array(
-        'enableAjaxValidation' => false,
-        'htmlOptions' => array(
-            'enctype' => "multipart/form-data",
-        )
-    )); ?>
-    <?php
-
-    echo $form->textFieldControlGroup($model, 'name', array('size' => 60, 'maxlength' => 256));
-    echo $form->textFieldControlGroup($model, 'link', array('size' => 60, 'maxlength' => 64));
-
-
-    echo $form->beginControlGroup($model, 'content');
-    $this->widget('ext.tinymce.TinyMce', array(
-        'model' => $model,
-        'attribute' => 'content',
-        'htmlOptions' => array(
-            'rows' => 6,
-            'cols' => 60,
-        ),));
-    echo $form->endControlGroup($model);
-
-    //SEO
-    echo $form->textFieldControlGroup($model, 'title', array('size' => 60, 'maxlength' => 512));
-    echo $form->textAreaControlGroup($model, 'description', array('rows' => 6, 'cols' => 50));
-    echo $form->textAreaControlGroup($model, 'keywords', array('rows' => 6, 'cols' => 50));
-    ?>
-
-    <div class="form-actions">
-        <button type="submit" class="btn btn-large btn-primary">
-            <?php echo ($model->isNewRecord ? 'Создать' : 'Сохранить'); ?>
-        </button>
-    </div>
-
-    <?php $this->endWidget(); ?>
-
-</div><!-- form -->

File testapp/protected/modules/admin/views/pageManager/admin.php

-<?php
-$this->actionsMenu = array(
-    array('label' => 'Добавить страницу', 'url' => array('create'), 'icon' => 'icon-plus', 'active' => '/\/create/'),
-);
-?>
-
-<h1>Управление текстовыми страницами</h1>
-<br/>
-
-<?php $this->widget('BGridView',
-    array(
-        'id' => 'employee-grid',
-        'dataProvider' => $model->search(),
-        'filter' => $model,
-        'columns' => array(
-            'name',
-            array(
-                'name' => 'link',
-                'value' => "Yii::app()->createAbsoluteUrl('site/page',array('link'=>\$data->link))",
-                'header' => 'Адрес на сайте'
-            ),
-            array(
-                'class' => 'CButtonColumn',
-                'template' => '{update} {delete}',
-            ),
-        ),
-    )); ?>

File testapp/protected/modules/admin/views/pageManager/create.php

-<?php
-$this->actionsMenu = array(
-    array('label' => 'Управление текстовыми страницами', 'url' => array('admin'), 'icon' => 'icon-list', 'active' => '/\/admin/'),
-);
-?>
-
-<h1>Добавить страницу</h1>
-<br/>
-<?php echo $this->renderPartial('_form', array('model' => $model)); ?>

File testapp/protected/modules/admin/views/pageManager/update.php

-<?php
-$this->actionsMenu = array(
-    array('label' => 'Добавить страницу', 'url' => array('create'), 'icon' => 'icon-plus', 'active' => '/\/create/'),
-    array('label' => 'Управление текстовыми страницами', 'url' => array('admin'), 'icon' => 'icon-list', 'active' => '/\/admin/'),
-);
-?>
-
-<h1>Редактирование страницы <?php echo $model->name; ?></h1>
-<br/>
-<?php echo $this->renderPartial('_form', array('model' => $model)); ?>

File testapp/protected/modules/admin/views/params/static_editor.php

-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span12">
             <?php echo $content;?>
         </div>

File testapp/protected/modules/admin/views/static_editor.php

 <?php
 /**
- * @var PageController $this
+ * @var AdminController $this
+ * @var string $content
  */
 ?>
-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span2">
             <div class="">
                 <?php $this->widget('BSideMenu', array('items' => $this->sideMenu));?>

File testapp/protected/modules/admin/views/test/gallery.php

-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span<?php echo(isset($_GET['w']) ? $_GET['w'] : '12')?>">
             <?php
             $this->widget('GalleryManager', array(

File testapp/protected/modules/admin/views/test/static_editor.php

-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span12">
             <?php echo $content;?>
         </div>

File testapp/protected/modules/admin/views/test/widgets.php

-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span12">
             <?php
             /**
                 )
             );
             echo $form->endControlGroup($model);
+
+            echo $form->beginControlGroup($model, 'date');
+
+                $this->widget('ext.datetimepicker.DateTimePicker', array(
+                    'model' => $model,
+                    'attribute' => 'date',
+                    'language' => 'ru',
+                    'options' => array(
+                        'dateFormat' => 'dd.mm.yy',
+                        'timeFormat' => 'hh:mm:ss',
+                    ),
+                ));
+
+            echo $form->endControlGroup($model);
+
             echo '<div class="control-group">' .
                 CHtml::label('FileManager', 'none', array('class' => 'control-label')) .
                 '<div class="controls">';

File testapp/protected/modules/admin/views/user/layout.php

-<div class="container">
-    <div class="row">
+<div class="container-fluid">
+    <div class="row-fluid">
         <div class="span2">
-            <!--            <br/>-->
-            <!--            <br/>-->
-
             <div>
                 <!--                <ul class="nav nav-list">-->
                 <!--                    <li class="nav-header">Действия</li>-->

File testcms.mwb

Binary file modified.