@@ -6,13 +6,13 @@ |
||
| 6 | 6 | /* @var $albums Itstructure\MFUploader\models\album\Album[] */ |
| 7 | 7 | |
| 8 | 8 | $this->title = Yii::t('products', 'Create product'); |
| 9 | -$this->params['breadcrumbs'][] = [ |
|
| 9 | +$this->params[ 'breadcrumbs' ][ ] = [ |
|
| 10 | 10 | 'label' => Yii::t('products', 'Products'), |
| 11 | 11 | 'url' => [ |
| 12 | - $this->params['urlPrefix'].'index' |
|
| 12 | + $this->params[ 'urlPrefix' ].'index' |
|
| 13 | 13 | ] |
| 14 | 14 | ]; |
| 15 | -$this->params['breadcrumbs'][] = Yii::t('app', 'Create'); |
|
| 15 | +$this->params[ 'breadcrumbs' ][ ] = Yii::t('app', 'Create'); |
|
| 16 | 16 | ?> |
| 17 | 17 | <div class="product-create"> |
| 18 | 18 | |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | </style> |
| 29 | 29 | |
| 30 | 30 | <div class="row"> |
| 31 | - <?php $i=0; ?> |
|
| 31 | + <?php $i = 0; ?> |
|
| 32 | 32 | <?php foreach ($mediafiles as $mediafile): ?> |
| 33 | 33 | <div class="col-md-6 file-item"> |
| 34 | - <?php $i+=1; ?> |
|
| 34 | + <?php $i += 1; ?> |
|
| 35 | 35 | <div class="media"> |
| 36 | 36 | <div class="media-left" id="mediafile-container-<?php echo $i; ?>"> |
| 37 | 37 | <?php echo $mediafile->getPreview($baseUrl, 'existing', $mediafile->isImage() ? [ |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | 'target' => '_blank' |
| 43 | 43 | ] |
| 44 | 44 | ] |
| 45 | - ] : []); ?> |
|
| 45 | + ] : [ ]); ?> |
|
| 46 | 46 | </div> |
| 47 | 47 | <div class="media-body"> |
| 48 | 48 | <h4 id="title-container-<?php echo $i; ?>" class="media-heading"> |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | 'buttonName' => Module::t('main', 'Set '.$fileType), |
| 61 | 61 | 'resetButtonName' => Module::t('main', 'Clear'), |
| 62 | 62 | 'options' => [ |
| 63 | - 'id' => Html::getInputId($model, $fileType) . '-' . $i, |
|
| 63 | + 'id' => Html::getInputId($model, $fileType).'-'.$i, |
|
| 64 | 64 | 'value' => $mediafile->{FileSetter::INSERTED_DATA_ID}, |
| 65 | 65 | ], |
| 66 | 66 | 'deleteBoxDisplay' => true, |
@@ -68,16 +68,16 @@ discard block |
||
| 68 | 68 | 'deleteBoxOptions' => [ |
| 69 | 69 | 'value' => $mediafile->id |
| 70 | 70 | ], |
| 71 | - 'mediafileContainer' => '#mediafile-container-' . $i, |
|
| 72 | - 'titleContainer' => '#title-container-' . $i, |
|
| 73 | - 'descriptionContainer' => '#description-container-' . $i, |
|
| 71 | + 'mediafileContainer' => '#mediafile-container-'.$i, |
|
| 72 | + 'titleContainer' => '#title-container-'.$i, |
|
| 73 | + 'descriptionContainer' => '#description-container-'.$i, |
|
| 74 | 74 | 'subDir' => $model->mainModel->tableName() |
| 75 | 75 | ], isset($ownerParams) && is_array($ownerParams) ? ArrayHelper::merge([ |
| 76 | 76 | 'ownerAttribute' => $fileType |
| 77 | - ], $ownerParams) : []) |
|
| 77 | + ], $ownerParams) : [ ]) |
|
| 78 | 78 | ); ?> |
| 79 | 79 | </div> |
| 80 | 80 | <?php endforeach; ?> |
| 81 | 81 | </div> |
| 82 | 82 | |
| 83 | -<?php echo LinkPager::widget(['pagination' => $pages]) ?> |
|
| 83 | +<?php echo LinkPager::widget([ 'pagination' => $pages ]) ?> |
|
@@ -28,5 +28,5 @@ |
||
| 28 | 28 | 'subDir' => $model->mainModel->tableName() |
| 29 | 29 | ], isset($ownerParams) && is_array($ownerParams) ? ArrayHelper::merge([ |
| 30 | 30 | 'ownerAttribute' => UploadModelInterface::FILE_TYPE_THUMB |
| 31 | - ], $ownerParams) : []) |
|
| 31 | + ], $ownerParams) : [ ]) |
|
| 32 | 32 | ); ?> |
@@ -28,13 +28,13 @@ |
||
| 28 | 28 | 'buttonName' => Module::t('main', 'Set '.$fileType), |
| 29 | 29 | 'resetButtonName' => Module::t('main', 'Clear'), |
| 30 | 30 | 'options' => [ |
| 31 | - 'id' => Html::getInputId($model, $fileType) . (isset($number) ? '-new-' . $number : '') |
|
| 31 | + 'id' => Html::getInputId($model, $fileType).(isset($number) ? '-new-'.$number : '') |
|
| 32 | 32 | ], |
| 33 | - 'mediafileContainer' => '#mediafile-container-new' . (isset($number) ? '-' . $number : ''), |
|
| 34 | - 'titleContainer' => '#title-container-new' . (isset($number) ? '-' . $number : ''), |
|
| 35 | - 'descriptionContainer' => '#description-container-new' . (isset($number) ? '-' . $number : ''), |
|
| 33 | + 'mediafileContainer' => '#mediafile-container-new'.(isset($number) ? '-'.$number : ''), |
|
| 34 | + 'titleContainer' => '#title-container-new'.(isset($number) ? '-'.$number : ''), |
|
| 35 | + 'descriptionContainer' => '#description-container-new'.(isset($number) ? '-'.$number : ''), |
|
| 36 | 36 | 'subDir' => $model->mainModel->tableName() |
| 37 | 37 | ], isset($ownerParams) && is_array($ownerParams) ? ArrayHelper::merge([ |
| 38 | 38 | 'ownerAttribute' => $fileType |
| 39 | - ], $ownerParams) : []) |
|
| 39 | + ], $ownerParams) : [ ]) |
|
| 40 | 40 | ); ?> |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | 'home' => HomeController::class, |
| 61 | 61 | 'sitemap' => SitemapController::class |
| 62 | 62 | ], |
| 63 | - 'accessRoles' => ['admin', 'manager'], |
|
| 63 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
| 64 | 64 | 'components' => [ |
| 65 | - 'view' => require __DIR__ . '/view-component.php', |
|
| 66 | - 'multilanguage-validate-component' => require __DIR__ .'/multilanguage-validate-component.php', |
|
| 65 | + 'view' => require __DIR__.'/view-component.php', |
|
| 66 | + 'multilanguage-validate-component' => require __DIR__.'/multilanguage-validate-component.php', |
|
| 67 | 67 | ], |
| 68 | 68 | 'isMultilanguage' => true, |
| 69 | 69 | ], |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | 'permissions' => PermissionController::class, |
| 76 | 76 | 'profiles' => ProfileController::class |
| 77 | 77 | ], |
| 78 | - 'accessRoles' => ['admin', 'manager'], |
|
| 78 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
| 79 | 79 | 'components' => [ |
| 80 | - 'view' => require __DIR__ . '/view-component.php', |
|
| 80 | + 'view' => require __DIR__.'/view-component.php', |
|
| 81 | 81 | ], |
| 82 | 82 | ], |
| 83 | 83 | 'mfuploader' => [ |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | 'text-album' => TextAlbumController::class, |
| 95 | 95 | 'other-album' => OtherAlbumController::class, |
| 96 | 96 | ], |
| 97 | - 'accessRoles' => ['admin', 'manager'], |
|
| 97 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
| 98 | 98 | 'defaultStorageType' => MFUModule::STORAGE_TYPE_LOCAL, |
| 99 | - 'previewOptions' => require __DIR__ . '/../preview-options.php', |
|
| 99 | + 'previewOptions' => require __DIR__.'/../preview-options.php', |
|
| 100 | 100 | 'components' => [ |
| 101 | 101 | 'local-upload-component' => [ |
| 102 | 102 | 'class' => LocalUploadComponent::class, |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | 's3-upload-component' => [ |
| 106 | 106 | 'class' => S3UploadComponent::class, |
| 107 | 107 | 'checkExtensionByMimeType' => false, |
| 108 | - 'credentials' => require __DIR__ . '/../aws-credentials.php', |
|
| 108 | + 'credentials' => require __DIR__.'/../aws-credentials.php', |
|
| 109 | 109 | 'region' => 'us-west-2', |
| 110 | 110 | 's3DefaultBucket' => 'filesmodule2', |
| 111 | 111 | ], |
| 112 | - 'view' => require __DIR__ . '/view-component.php', |
|
| 112 | + 'view' => require __DIR__.'/view-component.php', |
|
| 113 | 113 | ], |
| 114 | 114 | ] |
| 115 | 115 | ], |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | use Itstructure\AdminModule\Module as AdminModule; |
| 4 | 4 | use Itstructure\RbacModule\Module as RbacModule; |
| 5 | 5 | |
| 6 | -$shortLanguage = $this->view->params['shortLanguage']; |
|
| 6 | +$shortLanguage = $this->view->params[ 'shortLanguage' ]; |
|
| 7 | 7 | $controllerId = Yii::$app->controller->id; |
| 8 | 8 | |
| 9 | 9 | return [ |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'active' => $controllerId == 'profiles' ? true : false |
| 51 | 51 | ], |
| 52 | 52 | ], |
| 53 | - 'active' => in_array($controllerId, ['roles', 'permissions', 'profiles']) ? true : false |
|
| 53 | + 'active' => in_array($controllerId, [ 'roles', 'permissions', 'profiles' ]) ? true : false |
|
| 54 | 54 | ], |
| 55 | 55 | 'positions' => [ |
| 56 | 56 | 'title' => Yii::t('positions', 'Positions'), |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'active' => $controllerId == 'qualities' ? true : false |
| 101 | 101 | ], |
| 102 | 102 | ], |
| 103 | - 'active' => in_array($controllerId, ['about', 'technologies', 'qualities']) ? true : false |
|
| 103 | + 'active' => in_array($controllerId, [ 'about', 'technologies', 'qualities' ]) ? true : false |
|
| 104 | 104 | ], |
| 105 | 105 | 'contacts' => [ |
| 106 | 106 | 'title' => Yii::t('contacts', 'Contacts'), |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | 'active' => $controllerId == 'social' ? true : false |
| 121 | 121 | ], |
| 122 | 122 | ], |
| 123 | - 'active' => in_array($controllerId, ['contacts', 'social']) ? true : false |
|
| 123 | + 'active' => in_array($controllerId, [ 'contacts', 'social' ]) ? true : false |
|
| 124 | 124 | ], |
| 125 | 125 | 'home' => [ |
| 126 | 126 | 'title' => Yii::t('home', 'Home page'), |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | 'active' => $controllerId == 'other-album' ? true : false |
| 171 | 171 | ], |
| 172 | 172 | ], |
| 173 | - 'active' => in_array($controllerId, ['image-album', 'audio-album', 'video-album', 'application-album', 'text-album', 'other-album']) ? true : false |
|
| 173 | + 'active' => in_array($controllerId, [ 'image-album', 'audio-album', 'video-album', 'application-album', 'text-album', 'other-album' ]) ? true : false |
|
| 174 | 174 | ], |
| 175 | 175 | 'sitemap' => [ |
| 176 | 176 | 'title' => Yii::t('app', 'Sitemap'), |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | return [ |
| 7 | 7 | UploadModelInterface::FILE_TYPE_APP => [ |
| 8 | - 'existing' => function (Mediafile $mediafile) { |
|
| 8 | + 'existing' => function(Mediafile $mediafile) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'externalTag' => [ |
| 11 | 11 | 'name' => 'a', |
@@ -1,14 +1,14 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$params = require __DIR__ . '/params.php'; |
|
| 4 | -$db = require __DIR__ . '/db.php'; |
|
| 3 | +$params = require __DIR__.'/params.php'; |
|
| 4 | +$db = require __DIR__.'/db.php'; |
|
| 5 | 5 | |
| 6 | 6 | $config = [ |
| 7 | 7 | 'id' => 'yii2_template_multilanguage', |
| 8 | 8 | 'version' => '1.1.0', |
| 9 | 9 | 'basePath' => dirname(__DIR__), |
| 10 | 10 | 'homeUrl' => YII_DEBUG ? 'http://yii2-template-multilanguage' : 'http://yii2-template-multilanguage', |
| 11 | - 'bootstrap' => ['log'], |
|
| 11 | + 'bootstrap' => [ 'log' ], |
|
| 12 | 12 | 'language' => 'en-US', |
| 13 | 13 | 'aliases' => [ |
| 14 | 14 | '@bower' => '@vendor/bower-asset', |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'targets' => [ |
| 51 | 51 | [ |
| 52 | 52 | 'class' => 'yii\log\FileTarget', |
| 53 | - 'levels' => ['error', 'warning'], |
|
| 53 | + 'levels' => [ 'error', 'warning' ], |
|
| 54 | 54 | ], |
| 55 | 55 | ], |
| 56 | 56 | ], |
@@ -209,18 +209,18 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | if (YII_ENV_DEV) { |
| 211 | 211 | // configuration adjustments for 'dev' environment |
| 212 | - $config['bootstrap'][] = 'debug'; |
|
| 213 | - $config['modules']['debug'] = [ |
|
| 212 | + $config[ 'bootstrap' ][ ] = 'debug'; |
|
| 213 | + $config[ 'modules' ][ 'debug' ] = [ |
|
| 214 | 214 | 'class' => 'yii\debug\Module', |
| 215 | 215 | // uncomment the following to add your IP if you are not connecting from localhost. |
| 216 | - 'allowedIPs' => ['127.0.0.1', '::1', '*'], |
|
| 216 | + 'allowedIPs' => [ '127.0.0.1', '::1', '*' ], |
|
| 217 | 217 | ]; |
| 218 | 218 | |
| 219 | - $config['bootstrap'][] = 'gii'; |
|
| 220 | - $config['modules']['gii'] = [ |
|
| 219 | + $config[ 'bootstrap' ][ ] = 'gii'; |
|
| 220 | + $config[ 'modules' ][ 'gii' ] = [ |
|
| 221 | 221 | 'class' => 'yii\gii\Module', |
| 222 | 222 | // uncomment the following to add your IP if you are not connecting from localhost. |
| 223 | - 'allowedIPs' => ['127.0.0.1', '::1', '*'], |
|
| 223 | + 'allowedIPs' => [ '127.0.0.1', '::1', '*' ], |
|
| 224 | 224 | ]; |
| 225 | 225 | } |
| 226 | 226 | |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | protected function getAdditionFields(): array |
| 100 | 100 | { |
| 101 | 101 | if ($this->action->id == 'create' || $this->action->id == 'update') { |
| 102 | - $fields = []; |
|
| 102 | + $fields = [ ]; |
|
| 103 | 103 | |
| 104 | - $fields['pages'] = Page::getMenu(); |
|
| 105 | - $fields['albums'] = Album::find()->select([ |
|
| 104 | + $fields[ 'pages' ] = Page::getMenu(); |
|
| 105 | + $fields[ 'albums' ] = Album::find()->select([ |
|
| 106 | 106 | 'id', 'title' |
| 107 | 107 | ])->all(); |
| 108 | 108 | |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | 'defaultPageSize' => 6, |
| 117 | 117 | 'totalCount' => $mediafilesQuery->count() |
| 118 | 118 | ]); |
| 119 | - $fields['images'] = $mediafilesQuery->offset($media_pages->offset) |
|
| 119 | + $fields[ 'images' ] = $mediafilesQuery->offset($media_pages->offset) |
|
| 120 | 120 | ->limit($media_pages->limit) |
| 121 | 121 | ->all(); |
| 122 | - $fields['media_pages'] = $media_pages; |
|
| 122 | + $fields[ 'media_pages' ] = $media_pages; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | return $fields; |