diff --git a/backend/views/accounts-vin/_form.php b/backend/views/accounts-vin/_form.php index 371ac17..9b9a4cd 100755 --- a/backend/views/accounts-vin/_form.php +++ b/backend/views/accounts-vin/_form.php @@ -29,7 +29,7 @@ use yii\widgets\ActiveForm; field($model, 'timestamp')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/accounts-vin/create.php b/backend/views/accounts-vin/create.php index f5a4812..2955d11 100755 --- a/backend/views/accounts-vin/create.php +++ b/backend/views/accounts-vin/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\AccountsVin */ -$this->title = 'Create Accounts Vin'; +$this->title = 'Добавить Accounts Vin'; $this->params['breadcrumbs'][] = ['label' => 'Accounts Vins', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/accounts-vin/index.php b/backend/views/accounts-vin/index.php index ee80c76..03fd2fa 100755 --- a/backend/views/accounts-vin/index.php +++ b/backend/views/accounts-vin/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> diff --git a/backend/views/accounts/create.php b/backend/views/accounts/create.php index 551756c..88367dd 100755 --- a/backend/views/accounts/create.php +++ b/backend/views/accounts/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Accounts */ -$this->title = 'Create Accounts'; +$this->title = 'Добавить Accounts'; $this->params['breadcrumbs'][] = ['label' => 'Accounts', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/accounts/index.php b/backend/views/accounts/index.php index cabefab..e335930 100755 --- a/backend/views/accounts/index.php +++ b/backend/views/accounts/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'dt')->textInput(['maxlength' => true]) ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/art-history/create.php b/backend/views/art-history/create.php index bfa1c09..bd74299 100755 --- a/backend/views/art-history/create.php +++ b/backend/views/art-history/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\ArtHistory */ -$this->title = 'Create Art History'; +$this->title = 'Добавить Art History'; $this->params['breadcrumbs'][] = ['label' => 'Art Histories', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/art-history/index.php b/backend/views/art-history/index.php index ab6800b..254c60e 100755 --- a/backend/views/art-history/index.php +++ b/backend/views/art-history/index.php @@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'timestamp')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/brands-replace/create.php b/backend/views/brands-replace/create.php index 0966038..643723e 100755 --- a/backend/views/brands-replace/create.php +++ b/backend/views/brands-replace/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\BrandsReplace */ -$this->title = 'Create Brands Replace'; +$this->title = 'Добавить Brands Replace'; $this->params['breadcrumbs'][] = ['label' => 'Brands Replaces', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/brands-replace/index.php b/backend/views/brands-replace/index.php index 7f7ccec..da371dc 100755 --- a/backend/views/brands-replace/index.php +++ b/backend/views/brands-replace/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'timestamp')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/brands/create.php b/backend/views/brands/create.php index 40f4c07..2bf8d50 100755 --- a/backend/views/brands/create.php +++ b/backend/views/brands/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Brands */ -$this->title = 'Create Brands'; +$this->title = 'Добавить Brands'; $this->params['breadcrumbs'][] = ['label' => 'Brands', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/cat/create.php b/backend/views/cat/create.php index acf8b42..f164e92 100755 --- a/backend/views/cat/create.php +++ b/backend/views/cat/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Cat */ -$this->title = 'Create Cat'; +$this->title = 'Добавить Cat'; $this->params['breadcrumbs'][] = ['label' => 'Cats', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/cat/index.php b/backend/views/cat/index.php index 1ae5368..8c55e98 100755 --- a/backend/views/cat/index.php +++ b/backend/views/cat/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'timestamp')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/details-crosses/create.php b/backend/views/details-crosses/create.php index 01f22d1..d959601 100755 --- a/backend/views/details-crosses/create.php +++ b/backend/views/details-crosses/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\DetailsCrosses */ -$this->title = 'Create Details Crosses'; +$this->title = 'Добавить Details Crosses'; $this->params['breadcrumbs'][] = ['label' => 'Details Crosses', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/details/_form.php b/backend/views/details/_form.php index b123675..cb205c3 100755 --- a/backend/views/details/_form.php +++ b/backend/views/details/_form.php @@ -33,7 +33,7 @@ use yii\widgets\ActiveForm; field($model, 'timestamp')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/details/create.php b/backend/views/details/create.php index 130e939..0f28abb 100755 --- a/backend/views/details/create.php +++ b/backend/views/details/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Details */ -$this->title = 'Create Details'; +$this->title = 'Добавить Details'; $this->params['breadcrumbs'][] = ['label' => 'Details', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/dic-statuses/_form.php b/backend/views/dic-statuses/_form.php index d941f74..b959ddf 100755 --- a/backend/views/dic-statuses/_form.php +++ b/backend/views/dic-statuses/_form.php @@ -23,7 +23,7 @@ use yii\widgets\ActiveForm; field($model, 'if_mail')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/dic-statuses/create.php b/backend/views/dic-statuses/create.php index 2ecc6fe..9f13852 100755 --- a/backend/views/dic-statuses/create.php +++ b/backend/views/dic-statuses/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\DicStatuses */ -$this->title = 'Create Dic Statuses'; +$this->title = 'Добавить Dic Statuses'; $this->params['breadcrumbs'][] = ['label' => 'Dic Statuses', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/dic-statuses/index.php b/backend/views/dic-statuses/index.php index 8e64942..d3bc77e 100755 --- a/backend/views/dic-statuses/index.php +++ b/backend/views/dic-statuses/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'who_comment')->textInput(['maxlength' => true]) ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/emails/create.php b/backend/views/emails/create.php index 2b34a50..645a43c 100755 --- a/backend/views/emails/create.php +++ b/backend/views/emails/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Emails */ -$this->title = 'Create Emails'; +$this->title = 'Добавить Emails'; $this->params['breadcrumbs'][] = ['label' => 'Emails', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/emails/index.php b/backend/views/emails/index.php index 865d7a7..a2b92a0 100755 --- a/backend/views/emails/index.php +++ b/backend/views/emails/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/importers/create.php b/backend/views/importers/create.php index 05925af..8fb5bf8 100755 --- a/backend/views/importers/create.php +++ b/backend/views/importers/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model backend\models\Importers */ -$this->title = 'Create Importers'; +$this->title = 'Добавить Importers'; $this->params['breadcrumbs'][] = ['label' => 'Importers', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/importers/index.php b/backend/views/importers/index.php index d42d505..fa387ab 100755 --- a/backend/views/importers/index.php +++ b/backend/views/importers/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'original_url')->textInput(['maxlength' => true]) ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/manufacturers/create.php b/backend/views/manufacturers/create.php index 20cec00..b39d84e 100755 --- a/backend/views/manufacturers/create.php +++ b/backend/views/manufacturers/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Manufacturers */ -$this->title = 'Create Manufacturers'; +$this->title = 'Добавить Manufacturers'; $this->params['breadcrumbs'][] = ['label' => 'Manufacturers', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/margins-groups/_form.php b/backend/views/margins-groups/_form.php index b3b57c7..bd49c48 100755 --- a/backend/views/margins-groups/_form.php +++ b/backend/views/margins-groups/_form.php @@ -21,7 +21,7 @@ use yii\helpers\ArrayHelper;
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/margins-groups/create.php b/backend/views/margins-groups/create.php index 0c4d6d5..ca226ee 100755 --- a/backend/views/margins-groups/create.php +++ b/backend/views/margins-groups/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\MarginsGroups */ -$this->title = 'Create Margins Groups'; +$this->title = 'Добавить Margins Groups'; $this->params['breadcrumbs'][] = ['label' => 'Margins Groups', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/margins-groups/index.php b/backend/views/margins-groups/index.php index b487574..22d3cc4 100755 --- a/backend/views/margins-groups/index.php +++ b/backend/views/margins-groups/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'finish')->checkbox() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/margins-importers-import/create.php b/backend/views/margins-importers-import/create.php index 58fa978..463bb90 100755 --- a/backend/views/margins-importers-import/create.php +++ b/backend/views/margins-importers-import/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\MarginsImportersImport */ -$this->title = 'Create Margins Importers Import'; +$this->title = 'Добавить Margins Importers Import'; $this->params['breadcrumbs'][] = ['label' => 'Margins Importers Imports', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/margins-importers-import/index.php b/backend/views/margins-importers-import/index.php index e42c4e2..90c05f3 100755 --- a/backend/views/margins-importers-import/index.php +++ b/backend/views/margins-importers-import/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'koef')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/margins-importers/create.php b/backend/views/margins-importers/create.php index 00c2d2e..cc69dd5 100755 --- a/backend/views/margins-importers/create.php +++ b/backend/views/margins-importers/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\MarginsImporters */ -$this->title = 'Create Margins Importers'; +$this->title = 'Добавить Margins Importers'; $this->params['breadcrumbs'][] = ['label' => 'Margins Importers', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/margins-importers/index.php b/backend/views/margins-importers/index.php index 135a475..ec67f1e 100755 --- a/backend/views/margins-importers/index.php +++ b/backend/views/margins-importers/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

field($model, 'koef')->textInput() ?>
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> + isNewRecord ? 'Добавить' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
diff --git a/backend/views/margins/create.php b/backend/views/margins/create.php index 17286cd..17a6a6e 100755 --- a/backend/views/margins/create.php +++ b/backend/views/margins/create.php @@ -6,7 +6,7 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Margins */ -$this->title = 'Create Margins'; +$this->title = 'Добавить Margins'; $this->params['breadcrumbs'][] = ['label' => 'Margins', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/backend/views/margins/index.php b/backend/views/margins/index.php index 5936dbc..daf8f43 100755 --- a/backend/views/margins/index.php +++ b/backend/views/margins/index.php @@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

ElFinder::ckeditorOptions('elfinder',[ 'preset' => 'full', //разработанны стандартные настройки basic, standard, full данную возможность не обязательно использовать 'inline' => false, //по умолчанию false]), + 'allowedContent' => true, 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('page/images-upload') ] ) diff --git a/backend/views/page/_search.php b/backend/views/page/_search.php index 3dce25d..3aaa7ce 100755 --- a/backend/views/page/_search.php +++ b/backend/views/page/_search.php @@ -34,8 +34,8 @@ use yii\widgets\ActiveForm; field($model, 'is_active') ?>
- 'btn btn-primary']) ?> - 'btn btn-default']) ?> + 'btn btn-primary']) ?> + 'btn btn-default']) ?>
diff --git a/backend/views/page/create.php b/backend/views/page/create.php index d47a8ad..34eb3b0 100755 --- a/backend/views/page/create.php +++ b/backend/views/page/create.php @@ -6,8 +6,8 @@ use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Page */ -$this->title = 'Create Page'; -$this->params['breadcrumbs'][] = ['label' => 'Pages', 'url' => ['index']]; +$this->title = 'Создать'; +$this->params['breadcrumbs'][] = ['label' => 'Текстовые страницы', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?>
diff --git a/backend/views/page/index.php b/backend/views/page/index.php index 926d20c..7b1c954 100755 --- a/backend/views/page/index.php +++ b/backend/views/page/index.php @@ -7,7 +7,7 @@ use yii\grid\GridView; /* @var $searchModel common\models\PageSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ -$this->title = 'Pages'; +$this->title = 'Текстовые страницы'; $this->params['breadcrumbs'][] = $this->title; ?>
@@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; render('_search', ['model' => $searchModel]); ?>

- 'btn btn-success']) ?> + 'btn btn-success']) ?>

title = 'Update Page: ' . ' ' . $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Pages', 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => 'Текстовые страницы', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; -$this->params['breadcrumbs'][] = 'Update'; +$this->params['breadcrumbs'][] = 'Обновить'; ?>
diff --git a/backend/views/page/view.php b/backend/views/page/view.php index 06584f1..3a7a512 100755 --- a/backend/views/page/view.php +++ b/backend/views/page/view.php @@ -7,7 +7,7 @@ use yii\widgets\DetailView; /* @var $model common\models\Page */ $this->title = $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Pages', 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => 'Текстовые страницы', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?>
@@ -15,11 +15,11 @@ $this->params['breadcrumbs'][] = $this->title;

title) ?>

- $model->id], ['class' => 'btn btn-primary']) ?> - $model->id], [ + $model->id], ['class' => 'btn btn-primary']) ?> + $model->id], [ 'class' => 'btn btn-danger', 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', + 'confirm' => 'Вы увереннны что хотите удалить этот элемент?', 'method' => 'post', ], ]) ?> diff --git a/common/models/News.php b/common/models/News.php index d8391a0..e416962 100755 --- a/common/models/News.php +++ b/common/models/News.php @@ -107,4 +107,9 @@ class News extends \yii\db\ActiveRecord 'price_list' => 'Прайс лист', ]; } + + public function pregStr($str){ + $vowels = array("", ""); + return str_replace($vowels, "", $str); + } } diff --git a/common/models/Page.php b/common/models/Page.php index 7d55a80..3f9e709 100755 --- a/common/models/Page.php +++ b/common/models/Page.php @@ -33,7 +33,7 @@ class Page extends \yii\db\ActiveRecord public function rules() { return [ - [['name', 'code', 'content', 'title', 'kwords', 'descr'], 'required'], + [['name', 'code', 'content'], 'required'], [['content'], 'string'], [['sort', 'is_active'], 'integer'], [['name'], 'string', 'max' => 100], diff --git a/frontend/config/main.php b/frontend/config/main.php index c9919ff..aaef635 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -41,9 +41,10 @@ return [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ - 'news/' => 'news/view', + 'news/' => 'news/view', 'news' => 'news/index', 'page/'=>'page/view', + 'company/'=>'page/about', 'goods/one-item/'=>'goods/one-item', 'goods/view/'=>'goods/view', 'stone/view/'=>'stone/view', diff --git a/frontend/controllers/NewsController.php b/frontend/controllers/NewsController.php index 7d83fec..f2d61d7 100755 --- a/frontend/controllers/NewsController.php +++ b/frontend/controllers/NewsController.php @@ -32,10 +32,15 @@ class NewsController extends Controller public function actionView($translit) { - $news_list = News::find()->where(['is_active'=>1])->limit(3)->all(); + + $activeNews = $this->findModel($translit); + $next_news = News::find()->where(['is_active'=>1])->andWhere('id > :id',[':id' => $activeNews->id])->one(); + $prev_news = News::find()->where(['is_active'=>1])->andWhere('id < :id',[':id' => $activeNews->id])->one(); + return $this->render('view', [ - 'model' => $this->findModel($translit), - 'news_list' => $news_list + 'model' => $activeNews, + 'next_news' => $next_news instanceof News ? $next_news : '', + 'prev_news' => $prev_news instanceof News ? $prev_news : '' ]); } @@ -79,4 +84,6 @@ class NewsController extends Controller "descr"=> "Отказ от рассылки ИталАвто" ); } + + } diff --git a/frontend/controllers/PageController.php b/frontend/controllers/PageController.php index d0e52d4..3f8b1ae 100644 --- a/frontend/controllers/PageController.php +++ b/frontend/controllers/PageController.php @@ -38,6 +38,15 @@ class PageController extends Controller ]); } + + public function actionAbout($translit) + { + + return $this->render('about_view', [ + 'model' => $this->findModel($translit), + ]); + } + protected function findModel($translit) { diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 896821e..13634a6 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -4,6 +4,7 @@ namespace frontend\controllers; use common\models\Accounts; use common\models\AccountsForm; use common\models\News; +use common\models\Slider; use common\models\Team; use common\models\TeamGroup; use Yii; @@ -53,7 +54,7 @@ class SiteController extends Controller $this->layout = '/outer'; $news_list = News::find()->where(['is_active'=>1])->limit(3)->all(); - + $slider_list = Slider::find()->where(['is_active'=>1])->all(); if (Yii::$app->request->post()) { $post = Yii::$app->request->post(); @@ -68,6 +69,7 @@ class SiteController extends Controller } return $this->render('index',[ + 'slider_list' => $slider_list, 'news_list' => $news_list ]); } @@ -84,10 +86,15 @@ class SiteController extends Controller } - public function actionArticle() + public function actionTeam() { + $teamGroups = TeamGroup::find()->all(); + $this->layout = '/internal'; - return $this->render('article'); + return $this->render('team',[ + 'teamGroups' => $teamGroups, + ]); + } public function actionBc2Catalog() diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index 7a59540..a198cf3 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -40,7 +40,7 @@ use yii\captcha\Captcha; [ - ['label' => 'О компании', 'url'=>Url::toRoute('/site/about')], + ['label' => 'О компании', 'url'=>Url::toRoute(['/page/about','translit'=>'about'])], ['label' => 'Каталоги', 'url'=>'#'],//Url::toRoute('/page/FAQ')], ['label' => 'Оптовикам','url'=>Url::toRoute(['/page/view','translit'=>'optovikam'])], ['label' => 'Поставщикам','url'=>Url::toRoute(['/page/view','translit'=>'suppliers'])], @@ -100,7 +100,7 @@ use yii\captcha\Captcha;

- +
'main_link_news'])?> - + - - - - - -img)); ?> -".$one_news->name."

",['news/view', 'translit' =>$one_news->code ]) ?> - - -