Commit 1a6c64ce by semenov

Новый модуль

parents
# Created by .gitignore support plugin (hsz.mobi)
\ No newline at end of file
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 07.03.2015
*/
namespace skeeks\modules\cms\catalog;
use skeeks\cms\base\Module as CmsModule;
/**
* Class Module
* @package skeeks\cms\modules\admin
*/
class Module extends CmsModule
{
public $controllerNamespace = 'skeeks\modules\cms\catalog\controllers';
/**
* @return array
*/
protected function _descriptor()
{
return array_merge(parent::_descriptor(), [
"name" => "Модуль каталог",
"description" => "Модуль",
]);
}
}
\ No newline at end of file
Модуль для SkeekS cms
===================================
Игформация о модуле
-------------------
Установка
------------
Модуль в планах на разработку. Пока - пустышка.
1) Стандартная установка через composer
```
php composer.phar require --prefer-dist skeeks/cms-module-catalog "*"
```
or add
```
"skeeks/cms-module-catalog": "*"
```
to the require section of your `composer.json` file.
2) Установка миграций
```
php yii migrate @skeeks\modules\cms\catalog\migrations
```
> [![skeeks!](https://gravatar.com/userimage/74431132/13d04d83218593564422770b616e5622.jpg)](http://www.skeeks.com)
<i>Web development has never been so fun!</i>
[www.skeeks.com](http://www.skeeks.com)
{
"name": "skeeks/cms-module-catalog",
"description": "Модуль каталог SkeekS cms",
"keywords": ["module", "cms", "skeeks", "sx", "app", "yii2", "catalog"],
"homepage": "http://www.skeeks.com/",
"type": "yii2-extension",
"license": "BSD-3-Clause",
"support": {
"issues": "http://www.skeeks.com/",
"wiki": "http://git.skeeks.com/skeeks/cms-module-catalog/tree/master/docs/guide-ru",
"wiki-cms": "http://git.skeeks.com/skeeks/cms/tree/master/docs/guide-ru",
"source": "http://git.skeeks.com/skeeks/cms-module-catalog"
},
"authors": [
{
"name": "Semenov Alexander",
"email": "semenov@skeeks.com"
}
],
"minimum-stability": "dev",
"require": {
"skeeks/cms": "*"
},
"autoload": {
"psr-4": {
"skeeks\\modules\\cms\\catalog\\": ""
}
}
}
\ No newline at end of file
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 07.03.2015
*/
return [];
\ No newline at end of file
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 09.03.2015
*/
return [
'components' =>
[
'adminMenu' =>
[
'groups' =>
[
'catalog' =>
[
'label' => 'Каталог товаров',
'priority' => 0,
'items' =>
[
[
"label" => "Товары",
"url" => ["catalog/admin-product"]
],
[
"label" => "Свойства товаров",
"url" => ["catalog/admin-properties-product"]
],
[
"label" => "Группы свойств товаров",
"url" => ["catalog/admin-group-properties-product"]
],
]
]
]
]
],
'modules' =>
[
'form' => [
'class' => '\skeeks\modules\cms\catalog\Module',
]
]
];
\ No newline at end of file
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 09.03.2015
*/
namespace skeeks\modules\cms\catalog\controllers;
use skeeks\cms\modules\admin\controllers\AdminModelEditorSmartController;
use skeeks\modules\cms\catalog\models\Product;
/**
* Class AdminProductController
* @package skeeks\modules\cms\catalog\controllers
*/
class AdminProductController extends AdminModelEditorSmartController
{
public function init()
{
$this->_label = "Управление продуктами";
$this->_modelShowAttribute = "name";
$this->_modelClassName = Product::className();
$this->modelValidate = true;
$this->enableScenarios = true;
parent::init();
}
}
\ No newline at end of file
<?php
/**
* @author Semenov Alexander <semenov@skeeks.com>
* @link http://skeeks.com/
* @copyright 2010 SkeekS (СкикС)
* @date 09.03.2015
*/
namespace skeeks\modules\cms\catalog\models;
use skeeks\cms\base\db\ActiveRecord;
use skeeks\cms\models\behaviors\HasDescriptionsBehavior;
use skeeks\cms\models\behaviors\HasStatus;
use skeeks\cms\models\behaviors\Implode;
use skeeks\cms\models\Core;
/**
* Class Form
* @package skeeks\modules\cms\form\models
*/
class Product extends Core
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%form_form}}';
}
/**
* @inheritdoc
*/
public function behaviors()
{
return array_merge(parent::behaviors(), [
[
"class" => Implode::className(),
'fields' => ['emails', 'phones']
],
]);
}
/**
* @inheritdoc
*/
public function rules()
{
return array_merge(parent::rules(), [
[['name'], 'required'],
[['name', 'description'], 'string'],
[['emails', 'phones'], 'safe'],
]);
}
public function scenarios()
{
$scenarios = parent::scenarios();
$scenarios['create'] = ['name', 'description', 'emails', 'phones'];
$scenarios['update'] = ['name', 'description', 'emails', 'phones'];
return $scenarios;
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return array_merge(parent::attributeLabels(), [
'id' => \Yii::t('app', 'ID'),
'name' => \Yii::t('app', 'Name'),
'description' => \Yii::t('app', 'Description'),
]);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment