@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | $languages = explode(',', getenv('APP_LANGUAGES')); |
| 17 | 17 | |
| 18 | 18 | // prepare asset bundle config |
| 19 | -$bundles = []; |
|
| 19 | +$bundles = [ ]; |
|
| 20 | 20 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
| 21 | 21 | // include generated asset-bundle configuration |
| 22 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
| 22 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
| 23 | 23 | // disable loading of bundles skin file, when using bundled assets |
| 24 | 24 | Yii::$container->set( |
| 25 | 25 | AdminLteAsset::className(), |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return [ |
| 62 | 62 | 'id' => 'app', |
| 63 | 63 | 'name' => getenv('APP_TITLE'), |
| 64 | - 'language' => $languages[0], |
|
| 64 | + 'language' => $languages[ 0 ], |
|
| 65 | 65 | 'basePath' => dirname(__DIR__), |
| 66 | 66 | 'vendorPath' => '@app/../vendor', |
| 67 | 67 | 'runtimePath' => '@app/../runtime', |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ], |
| 80 | 80 | 'params' => [ |
| 81 | 81 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
| 82 | - 'context.menuItems' => [], |
|
| 82 | + 'context.menuItems' => [ ], |
|
| 83 | 83 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
| 84 | 84 | ], |
| 85 | 85 | 'components' => [ |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ], |
| 93 | 93 | 'authManager' => [ |
| 94 | 94 | 'class' => \yii\rbac\DbManager::class, |
| 95 | - 'defaultRoles' => ['Default'], |
|
| 95 | + 'defaultRoles' => [ 'Default' ], |
|
| 96 | 96 | 'cache' => 'cache' |
| 97 | 97 | ], |
| 98 | 98 | 'cache' => |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
| 119 | 119 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
| 120 | 120 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
| 121 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
| 121 | + 'prefix' => getenv('APP_NAME').'/public', |
|
| 122 | 122 | 'region' => getenv('AMAZON_S3_BUCKET_REGION'), |
| 123 | 123 | ], |
| 124 | 124 | 'fsRuntime' => [ |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | 'common' => [ |
| 145 | 145 | 'class' => \codemix\streamlog\Target::class, |
| 146 | 146 | 'url' => 'php://stderr', |
| 147 | - 'levels' => ['error', 'warning'], |
|
| 148 | - 'logVars' => [], |
|
| 147 | + 'levels' => [ 'error', 'warning' ], |
|
| 148 | + 'logVars' => [ ], |
|
| 149 | 149 | 'replaceNewline' => (APP_TYPE == 'console') ? null : '', |
| 150 | 150 | ], |
| 151 | 151 | ], |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | 'user' => [ |
| 181 | 181 | 'class' => \dmstr\web\User::class, |
| 182 | 182 | 'enableAutoLogin' => true, |
| 183 | - 'loginUrl' => ['/user/security/login'], |
|
| 183 | + 'loginUrl' => [ '/user/security/login' ], |
|
| 184 | 184 | 'identityClass' => Da\User\Model\User::class, |
| 185 | - 'rootUsers' => ['admin'], |
|
| 185 | + 'rootUsers' => [ 'admin' ], |
|
| 186 | 186 | ], |
| 187 | 187 | 'urlManager' => [ |
| 188 | 188 | 'class' => \codemix\localeurls\UrlManager::class, |
@@ -213,25 +213,25 @@ discard block |
||
| 213 | 213 | 'auto_reload' => true, |
| 214 | 214 | ], |
| 215 | 215 | 'globals' => [ |
| 216 | - 'Html' => ['class' => \yii\helpers\Html::class], |
|
| 217 | - 'Json' => ['class' => \yii\helpers\Json::class], |
|
| 218 | - 'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class], |
|
| 219 | - 'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class], |
|
| 220 | - 'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class], |
|
| 221 | - 'Url' => ['class' => \yii\helpers\Url::class], |
|
| 222 | - 'Markdown' => ['class' => \yii\helpers\Markdown::class], |
|
| 216 | + 'Html' => [ 'class' => \yii\helpers\Html::class ], |
|
| 217 | + 'Json' => [ 'class' => \yii\helpers\Json::class ], |
|
| 218 | + 'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ], |
|
| 219 | + 'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ], |
|
| 220 | + 'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ], |
|
| 221 | + 'Url' => [ 'class' => \yii\helpers\Url::class ], |
|
| 222 | + 'Markdown' => [ 'class' => \yii\helpers\Markdown::class ], |
|
| 223 | 223 | ], |
| 224 | 224 | 'functions' => [ |
| 225 | - 'image' => function ($imageSource, $preset = null) { |
|
| 225 | + 'image' => function($imageSource, $preset = null) { |
|
| 226 | 226 | // preset example, when using imageproxy, https://github.com/willnorris/imageproxy#examples |
| 227 | 227 | if (getenv('IMAGEPROXY_SIGNATURE_KEY')) { |
| 228 | 228 | $key = getenv('IMAGEPROXY_SIGNATURE_KEY'); |
| 229 | - $preset .= ',s' . strtr(base64_encode(hash_hmac('sha256', $imageSource, $key, 1)), '/+', '_-'); |
|
| 229 | + $preset .= ',s'.strtr(base64_encode(hash_hmac('sha256', $imageSource, $key, 1)), '/+', '_-'); |
|
| 230 | 230 | } |
| 231 | - return Yii::$app->settings->get('imgBaseUrl', 'app.frontend') . |
|
| 232 | - $preset . |
|
| 233 | - Yii::$app->settings->get('imgHostPrefix', 'app.frontend') . |
|
| 234 | - $imageSource . |
|
| 231 | + return Yii::$app->settings->get('imgBaseUrl', 'app.frontend'). |
|
| 232 | + $preset. |
|
| 233 | + Yii::$app->settings->get('imgHostPrefix', 'app.frontend'). |
|
| 234 | + $imageSource. |
|
| 235 | 235 | Yii::$app->settings->get('imgHostSuffix', 'app.frontend'); |
| 236 | 236 | }, |
| 237 | 237 | ], |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | 'modules' => [ |
| 246 | 246 | 'audit' => [ |
| 247 | 247 | 'class' => \bedezign\yii2\audit\Audit::class, |
| 248 | - 'accessRoles' => ['audit-module'], |
|
| 248 | + 'accessRoles' => [ 'audit-module' ], |
|
| 249 | 249 | 'layout' => $boxLayout, |
| 250 | 250 | 'panels' => [ |
| 251 | 251 | 'audit/trail' => [ |
@@ -327,14 +327,14 @@ discard block |
||
| 327 | 327 | 'class' => \lajax\translatemanager\Module::class, |
| 328 | 328 | 'root' => '@app/views', |
| 329 | 329 | 'layout' => $boxLayout, |
| 330 | - 'allowedIPs' => ['*'], |
|
| 331 | - 'roles' => ['translate-module'], |
|
| 330 | + 'allowedIPs' => [ '*' ], |
|
| 331 | + 'roles' => [ 'translate-module' ], |
|
| 332 | 332 | ], |
| 333 | 333 | 'user' => [ |
| 334 | 334 | 'class' => Da\User\Module::class, |
| 335 | 335 | 'layout' => '@app/views/layouts/container', |
| 336 | 336 | 'defaultRoute' => 'admin', |
| 337 | - 'administrators' => ['admin'], |
|
| 337 | + 'administrators' => [ 'admin' ], |
|
| 338 | 338 | 'enableFlashMessages' => false, |
| 339 | 339 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
| 340 | 340 | ], |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | \yii\base\Event::on( |
| 33 | 33 | \yii\web\View::className(), |
| 34 | 34 | \yii\web\View::EVENT_AFTER_RENDER, |
| 35 | - function ($e) { |
|
| 35 | + function($e) { |
|
| 36 | 36 | // disable unbundled asset |
| 37 | - $e->sender->assetBundles['yii\\bootstrap\\BootstrapAsset'] = null; |
|
| 37 | + $e->sender->assetBundles[ 'yii\\bootstrap\\BootstrapAsset' ] = null; |
|
| 38 | 38 | // disable bundled asset |
| 39 | - $e->sender->assetBundles['bootstrap'] = null; |
|
| 39 | + $e->sender->assetBundles[ 'bootstrap' ] = null; |
|
| 40 | 40 | } |
| 41 | 41 | ); |
| 42 | 42 | } |
@@ -44,16 +44,16 @@ discard block |
||
| 44 | 44 | // SEO |
| 45 | 45 | $route = Url::toRoute(Yii::$app->controller->action->uniqueId); |
| 46 | 46 | if ($keywords = \Yii::$app->settings->get($route, 'app.seo.keywords', null)) { |
| 47 | - $this->registerMetaTag(['name' => 'keywords', 'content' => $keywords]); |
|
| 47 | + $this->registerMetaTag([ 'name' => 'keywords', 'content' => $keywords ]); |
|
| 48 | 48 | } |
| 49 | 49 | if ($description = \Yii::$app->settings->get($route, 'app.seo.descriptions', null)) { |
| 50 | - $this->registerMetaTag(['name' => 'description', 'content' => $description]); |
|
| 50 | + $this->registerMetaTag([ 'name' => 'description', 'content' => $description ]); |
|
| 51 | 51 | } |
| 52 | 52 | if ($title = \Yii::$app->settings->get($route, 'app.seo.titles', null)) { |
| 53 | 53 | $this->title = $title; |
| 54 | 54 | } |
| 55 | 55 | if ($favicon = \Yii::$app->settings->get('faviconPng', 'app.assets', null)) { |
| 56 | - $this->registerLinkTag(['rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon]); |
|
| 56 | + $this->registerLinkTag([ 'rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon ]); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | ?> |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | 'linkSelector' => '.frontend-reload', |
| 81 | 81 | ]) ?> |
| 82 | 82 | |
| 83 | -<?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?> |
|
| 83 | +<?= TwigWidget::widget([ 'key' => '_beginBody', 'renderEmpty' => false ]) ?> |
|
| 84 | 84 | |
| 85 | 85 | <!-- Navbar --> |
| 86 | 86 | <?php |
| 87 | 87 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
| 88 | - echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
| 88 | + echo \dmstr\modules\prototype\widgets\TwigWidget::widget([ 'key' => '_navbar' ]); |
|
| 89 | 89 | } else { |
| 90 | 90 | echo $this->render('_navbar'); |
| 91 | 91 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | <!-- Footer --> |
| 103 | 103 | <footer class="footer"> |
| 104 | - <?= Cell::widget(['id' => '_footer', 'requestParam' => '_global']) ?> |
|
| 104 | + <?= Cell::widget([ 'id' => '_footer', 'requestParam' => '_global' ]) ?> |
|
| 105 | 105 | </footer> |
| 106 | 106 | |
| 107 | 107 | <?php Pjax::end() ?> |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | ], |
| 117 | 117 | ]) ?> |
| 118 | 118 | |
| 119 | -<?= TwigWidget::widget(['key' => '_endBody', 'renderEmpty' => false]) ?> |
|
| 119 | +<?= TwigWidget::widget([ 'key' => '_endBody', 'renderEmpty' => false ]) ?> |
|
| 120 | 120 | |
| 121 | 121 | <?php if (Yii::$app->user->can('backend_default_index') && Yii::$app->settings->get('backendWidget', 'frontend') === 'toolbar'): ?> |
| 122 | 122 | <?= Toolbar::widget([ |