@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use app\models\TemplateBackground; |
| 10 | 10 | use yii\data\ActiveDataProvider; |
| 11 | 11 | use yii\helpers\Url; |
| 12 | -use yii\web\Controller; |
|
| 13 | 12 | use yii\web\NotFoundHttpException; |
| 14 | 13 | use yii\filters\VerbFilter; |
| 15 | 14 | use yii\filters\AccessControl; |
@@ -223,7 +223,7 @@ |
||
| 223 | 223 | if (!is_array($newTypeIds)) { |
| 224 | 224 | $newTypeIds = []; |
| 225 | 225 | } |
| 226 | - $oldTypeIds = array_map(function ($c) { |
|
| 226 | + $oldTypeIds = array_map(function($c) { |
|
| 227 | 227 | return $c->id; |
| 228 | 228 | }, $field->contentTypes); |
| 229 | 229 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace app\models\types; |
| 4 | 4 | |
| 5 | 5 | use Yii; |
| 6 | -use app\models\Content; |
|
| 7 | 6 | use yii\web\UploadedFile; |
| 8 | 7 | use yii\helpers\FileHelper; |
| 9 | 8 | use YoutubeDl\YoutubeDl; |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Yii; |
| 6 | 6 | use app\models\Content; |
| 7 | -use yii\helpers\Url; |
|
| 8 | 7 | |
| 9 | 8 | /** |
| 10 | 9 | * This is the model class for Weather content type. |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $types = self::find()->all(); |
| 115 | 115 | |
| 116 | - return array_filter($types, function ($t) use ($selfUpdate, $usableOnly) { |
|
| 116 | + return array_filter($types, function($t) use ($selfUpdate, $usableOnly) { |
|
| 117 | 117 | return ($selfUpdate === null || $t->selfUpdate == $selfUpdate) && (!$usableOnly || $t->usable); |
| 118 | 118 | }); |
| 119 | 119 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | $types = self::find()->all(); |
| 150 | 150 | |
| 151 | - return array_filter(array_map(function ($t) { |
|
| 151 | + return array_filter(array_map(function($t) { |
|
| 152 | 152 | return $t->input == self::KINDS['FILE'] ? $t->id : null; |
| 153 | 153 | }, $types)); |
| 154 | 154 | } |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | // exit(var_dump($blocks)); |
| 164 | 164 | |
| 165 | 165 | // Sort blocks by day and group |
| 166 | - usort($blocks, function ($a, $b) { |
|
| 166 | + usort($blocks, function($a, $b) { |
|
| 167 | 167 | if ($a['day'] != $b['day']) { |
| 168 | 168 | return $a['day'] - $b['day']; |
| 169 | 169 | } |
@@ -175,12 +175,12 @@ discard block |
||
| 175 | 175 | $flows = $screen->allFlows(); |
| 176 | 176 | |
| 177 | 177 | // Get all flow ids |
| 178 | - $flowIds = array_map(function ($e) { |
|
| 178 | + $flowIds = array_map(function($e) { |
|
| 179 | 179 | return $e->id; |
| 180 | 180 | }, $flows); |
| 181 | 181 | |
| 182 | 182 | // Get all content type ids |
| 183 | - $contentTypes = array_map(function ($e) { |
|
| 183 | + $contentTypes = array_map(function($e) { |
|
| 184 | 184 | return $e->id; |
| 185 | 185 | }, $field->contentTypes); |
| 186 | 186 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | ->andWhere(['or', ['end_ts' => null], ['>', 'end_ts', new Expression('NOW()')]]) |
| 195 | 195 | ->all(); |
| 196 | 196 | |
| 197 | - $next = array_map(function ($c) use ($field) { |
|
| 197 | + $next = array_map(function($c) use ($field) { |
|
| 198 | 198 | return [ |
| 199 | 199 | 'id' => $c->id, |
| 200 | 200 | 'data' => $field->mergeData($c->getData()), |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | 'only' => ['index', 'view', 'create', 'import', 'delete', 'set-roles'], |
| 36 | 36 | 'rules' => [ |
| 37 | 37 | ['allow' => true, 'actions' => ['index', 'view', 'create', 'delete', 'set-roles'], 'roles' => ['admin']], |
| 38 | - ['allow' => true, 'actions' => ['import'], 'matchCallback' => function ($rule, $action) { |
|
| 38 | + ['allow' => true, 'actions' => ['import'], 'matchCallback' => function($rule, $action) { |
|
| 39 | 39 | return Yii::$app->params['useLdap']; |
| 40 | 40 | }], |
| 41 | 41 | ], |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | return $this->redirect(['view', 'id' => $model->id]); |
| 99 | 99 | } else { |
| 100 | 100 | $templates = ScreenTemplate::find()->all(); |
| 101 | - $templatesArray = array_reduce($templates, function ($a, $t) { |
|
| 101 | + $templatesArray = array_reduce($templates, function($a, $t) { |
|
| 102 | 102 | $a[$t->id] = $t->name; |
| 103 | 103 | |
| 104 | 104 | return $a; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | return $this->redirect(['view', 'id' => $model->id]); |
| 128 | 128 | } else { |
| 129 | 129 | $templates = ScreenTemplate::find()->all(); |
| 130 | - $templatesArray = array_reduce($templates, function ($a, $t) { |
|
| 130 | + $templatesArray = array_reduce($templates, function($a, $t) { |
|
| 131 | 131 | $a[$t->id] = $t->name; |
| 132 | 132 | |
| 133 | 133 | return $a; |
@@ -44,11 +44,11 @@ |
||
| 44 | 44 | $js[] = $field->js; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $contentTypes = array_map(function ($ct) { |
|
| 47 | + $contentTypes = array_map(function($ct) { |
|
| 48 | 48 | return $ct->id; |
| 49 | 49 | }, $field->contentTypes); |
| 50 | 50 | |
| 51 | - $classes = array_map(function ($ct) { |
|
| 51 | + $classes = array_map(function($ct) { |
|
| 52 | 52 | return 'field_'.$ct; |
| 53 | 53 | }, $contentTypes); |
| 54 | 54 | |