@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | class m161018_154331__dds_add_definition_to_class extends Migration |
6 | 6 | { |
7 | - public function safeUp() |
|
8 | - { |
|
9 | - $this->addColumn('dds_class', 'definition', $this->text(10000) . " DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
10 | - } |
|
7 | + public function safeUp() |
|
8 | + { |
|
9 | + $this->addColumn('dds_class', 'definition', $this->text(10000) . " DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
10 | + } |
|
11 | 11 | |
12 | - public function safeDown() |
|
13 | - { |
|
14 | - $this->dropColumn('dds_class', 'definition'); |
|
15 | - } |
|
12 | + public function safeDown() |
|
13 | + { |
|
14 | + $this->dropColumn('dds_class', 'definition'); |
|
15 | + } |
|
16 | 16 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public function safeUp() |
8 | 8 | { |
9 | - $this->addColumn('dds_class', 'definition', $this->text(10000) . " DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
9 | + $this->addColumn('dds_class', 'definition', $this->text(10000)." DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | public function safeDown() |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class m170724_112209_dds_link_table_creation extends Migration |
11 | 11 | { |
12 | - public function safeUp() |
|
13 | - { |
|
12 | + public function safeUp() |
|
13 | + { |
|
14 | 14 | // create a linking table for links |
15 | 15 | $tableOptions = null; |
16 | 16 | if ($this->db->driverName === 'mysql') { |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | |
41 | 41 | } |
42 | 42 | |
43 | - public function safeDown() |
|
44 | - { |
|
43 | + public function safeDown() |
|
44 | + { |
|
45 | 45 | $this->dropTable('dds_link'); |
46 | 46 | $connection = neon()->db; |
47 | 47 | $sql =<<<EOQ |
@@ -52,5 +52,5 @@ discard block |
||
52 | 52 | $this->execute($sql); |
53 | 53 | $this->dropColumn('dds_member', 'link_class'); |
54 | 54 | |
55 | - } |
|
55 | + } |
|
56 | 56 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | ], $tableOptions); |
27 | 27 | |
28 | 28 | // create the new link and link datatypes |
29 | - $sql =<<<EOQ |
|
29 | + $sql = <<<EOQ |
|
30 | 30 | SET foreign_key_checks = 0; |
31 | 31 | REPLACE INTO `dds_data_type` (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`) |
32 | 32 | VALUES |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $this->dropTable('dds_link'); |
46 | 46 | $connection = neon()->db; |
47 | - $sql =<<<EOQ |
|
47 | + $sql = <<<EOQ |
|
48 | 48 | SET foreign_key_checks=0; |
49 | 49 | DELETE FROM `dds_data_type` WHERE `data_type_ref`='link'; |
50 | 50 | SET foreign_key_checks=1; |
@@ -5,14 +5,14 @@ |
||
5 | 5 | class m161201_170340_dds_add_map_field_to_members extends Migration |
6 | 6 | { |
7 | 7 | |
8 | - public function safeUp() |
|
9 | - { |
|
8 | + public function safeUp() |
|
9 | + { |
|
10 | 10 | $this->addColumn('dds_member', 'map_field', "TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'If true, then this is field data used in defining maps' AFTER `definition`"); |
11 | - } |
|
11 | + } |
|
12 | 12 | |
13 | - public function safeDown() |
|
14 | - { |
|
13 | + public function safeDown() |
|
14 | + { |
|
15 | 15 | $this->dropColumn('dds_member', 'map_field'); |
16 | - } |
|
16 | + } |
|
17 | 17 | |
18 | 18 | } |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | class m161130_132511_dds_uuid_change_to_22_chars extends Migration |
6 | 6 | { |
7 | - public function safeUp() |
|
8 | - { |
|
7 | + public function safeUp() |
|
8 | + { |
|
9 | 9 | $this->alterColumn('dds_object', '_uuid', "CHAR(22) NOT NULL COMMENT 'A universally unique identifier for this object'"); |
10 | - } |
|
10 | + } |
|
11 | 11 | |
12 | - public function safeDown() |
|
13 | - { |
|
12 | + public function safeDown() |
|
13 | + { |
|
14 | 14 | $this->alterColumn('dds_object', '_uuid', "CHAR(36) NOT NULL"); |
15 | - } |
|
15 | + } |
|
16 | 16 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $connection = \Yii::$app->getDb(); |
16 | 16 | |
17 | 17 | // create the various tables for dds |
18 | - $sql=<<<EOQ |
|
18 | + $sql = <<<EOQ |
|
19 | 19 | -- -------------------------------------------------------- |
20 | 20 | |
21 | 21 | -- |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $command = $connection->createCommand($sql); |
143 | 143 | $command->execute(); |
144 | 144 | |
145 | - $sql=<<<EOQ |
|
145 | + $sql = <<<EOQ |
|
146 | 146 | -- |
147 | 147 | -- Dumping data for table `dds_storage` |
148 | 148 | -- |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $connection = \Yii::$app->getDb(); |
16 | 16 | |
17 | 17 | // create the various tables for dds |
18 | - $sql=<<<EOQ |
|
18 | + $sql = <<<EOQ |
|
19 | 19 | -- -------------------------------------------------------- |
20 | 20 | |
21 | 21 | -- |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $command = $connection->createCommand($sql); |
143 | 143 | $command->execute(); |
144 | 144 | |
145 | - $sql=<<<EOQ |
|
145 | + $sql = <<<EOQ |
|
146 | 146 | -- |
147 | 147 | -- Dumping data for table `dds_storage` |
148 | 148 | -- |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | $this->alterColumn('dds_storage', 'type', "enum('INTEGER_TINY','INTEGER_SHORT','INTEGER','INTEGER_LONG','FLOAT','DOUBLE','DATE','DATETIME','TEXT_SHORT','TEXT','TEXT_LONG','BINARY_SHORT','BINARY','BINARY_LONG','CHAR','TIME') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the storage type'"); |
12 | 12 | |
13 | - $sql =<<<EOQ |
|
13 | + $sql = <<<EOQ |
|
14 | 14 | SET foreign_key_checks = 0; |
15 | 15 | REPLACE INTO {{%dds_storage}} (`storage_ref`, `label`, `type`, `description`) |
16 | 16 | VALUES |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $connection->createCommand($sql)->execute(); |
22 | 22 | |
23 | 23 | |
24 | - $sql =<<<EOQ |
|
24 | + $sql = <<<EOQ |
|
25 | 25 | SET foreign_key_checks = 0; |
26 | 26 | REPLACE INTO {{%dds_data_type}} (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`) |
27 | 27 | VALUES |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | $exclude = ['neon\core\form\fields\filters\File']; |
99 | 99 | $appClasses = neon()->getAppClasses('', \neon\core\interfaces\IComponent::class); |
100 | 100 | $out = []; |
101 | - foreach($appClasses as $app => $classes) { |
|
102 | - foreach($classes as $class) { |
|
101 | + foreach ($appClasses as $app => $classes) { |
|
102 | + foreach ($classes as $class) { |
|
103 | 103 | /** @var \neon\core\form\fields\Field $f */ |
104 | 104 | $f = new $class(uuid(), []); |
105 | 105 | // register all form field js scripts |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | } |
188 | 188 | return $this->render('create-table-raw.tpl', [ |
189 | - 'class' => [ 'label' => 'Create Table'], |
|
189 | + 'class' => ['label' => 'Create Table'], |
|
190 | 190 | 'form'=>$form |
191 | 191 | ]); |
192 | 192 | } |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | 'label' => $data['label'], |
205 | 205 | 'fields' => [] |
206 | 206 | ]; |
207 | - $fields = json_decode($data['fields'],true); |
|
207 | + $fields = json_decode($data['fields'], true); |
|
208 | 208 | if (is_array($fields)) { |
209 | 209 | foreach ($fields as $field) { |
210 | 210 | $field['classLabel'] = isset($field['classLabel']) ? $field['classLabel'] : ucwords($field['class']); |
211 | - $field['label'] = isset($field['label']) ? $field['label'] : ucwords(str_replace(['_','-'],' ',$field['name'])); |
|
211 | + $field['label'] = isset($field['label']) ? $field['label'] : ucwords(str_replace(['_', '-'], ' ', $field['name'])); |
|
212 | 212 | $definition['fields'][] = $field; |
213 | 213 | } |
214 | 214 | return $definition; |
@@ -54,8 +54,9 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function actionEdit($type = null) |
56 | 56 | { |
57 | - if (!$this->canDevelop()) |
|
58 | - throw new HttpException(403, 'This operation is not permitted here'); |
|
57 | + if (!$this->canDevelop()) { |
|
58 | + throw new HttpException(403, 'This operation is not permitted here'); |
|
59 | + } |
|
59 | 60 | |
60 | 61 | $form = $this->getPhoebeForm($type, $isNewForm, false, true); |
61 | 62 | return $this->render('edit-fields', [ |
@@ -95,9 +96,13 @@ discard block |
||
95 | 96 | // register all form field js scripts |
96 | 97 | $f->registerScripts(neon()->view); |
97 | 98 | $class = substr($class, 1); |
98 | - if (in_array($class, $exclude)) continue; |
|
99 | + if (in_array($class, $exclude)) { |
|
100 | + continue; |
|
101 | + } |
|
99 | 102 | $details = $f->getComponentDetails(); |
100 | - if ($details === false) continue; |
|
103 | + if ($details === false) { |
|
104 | + continue; |
|
105 | + } |
|
101 | 106 | $defaultField = Arr::except($f->toArray(), ['dataKey']); |
102 | 107 | $cmp = Arr::merge($defaultField, [ |
103 | 108 | 'class' => $class, |
@@ -162,8 +167,9 @@ discard block |
||
162 | 167 | ] |
163 | 168 | ]; |
164 | 169 | $form = new \neon\core\form\Form($formDefinition); |
165 | - if (neon()->request->isAjax) |
|
166 | - return $form->ajaxValidation(); |
|
170 | + if (neon()->request->isAjax) { |
|
171 | + return $form->ajaxValidation(); |
|
172 | + } |
|
167 | 173 | if ($form->processRequest()) { |
168 | 174 | $data = $form->getData(); |
169 | 175 | $definition = $this->canonicaliseDefinition($data); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $cmp = neon()->getApp($app)->get($component); |
34 | 34 | if ($cmp !== null && $cmp instanceof CacheInterface) { |
35 | 35 | if ($cmp->flush()) { |
36 | - neon()->session->setFlash('success', $component . ' cache successfully flushed'); |
|
36 | + neon()->session->setFlash('success', $component.' cache successfully flushed'); |
|
37 | 37 | return $this->redirect(['/utilities/clear-cache/index']); |
38 | 38 | } |
39 | 39 | } |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | public function actionClearAll() |
66 | 66 | { |
67 | 67 | $caches = $this->getCaches(); |
68 | - foreach($caches as $app => $caches) { |
|
68 | + foreach ($caches as $app => $caches) { |
|
69 | 69 | $a = neon()->getApp($app); |
70 | 70 | if ($a === null) return; |
71 | - foreach($caches as $name => $component) { |
|
71 | + foreach ($caches as $name => $component) { |
|
72 | 72 | $cmp = $a->get($name); |
73 | 73 | if ($cmp !== null && $cmp instanceof CacheInterface) { |
74 | 74 | $cmp->flush(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $r = new Renderer(); |
93 | 93 | $r->smarty->clearCompiledTemplate(); |
94 | 94 | $r->smarty->clearAllCache(); |
95 | - foreach(neon()->view->renderers as $ext => $config) { |
|
95 | + foreach (neon()->view->renderers as $ext => $config) { |
|
96 | 96 | $renderer = neon()->view->getRendererByExtension($ext); |
97 | 97 | if ($renderer instanceof ICanFlushTemplates) { |
98 | 98 | $renderer->flushTemplates(); |
@@ -67,7 +67,9 @@ discard block |
||
67 | 67 | $caches = $this->getCaches(); |
68 | 68 | foreach($caches as $app => $caches) { |
69 | 69 | $a = neon()->getApp($app); |
70 | - if ($a === null) return; |
|
70 | + if ($a === null) { |
|
71 | + return; |
|
72 | + } |
|
71 | 73 | foreach($caches as $name => $component) { |
72 | 74 | $cmp = $a->get($name); |
73 | 75 | if ($cmp !== null && $cmp instanceof CacheInterface) { |
@@ -132,7 +134,9 @@ discard block |
||
132 | 134 | public function getCaches() |
133 | 135 | { |
134 | 136 | return collect(neon()->getAllApps())->map(function($config, $app) { |
135 | - $a = neon()->getApp($app); if ($a === null) return; |
|
137 | + $a = neon()->getApp($app); if ($a === null) { |
|
138 | + return; |
|
139 | + } |
|
136 | 140 | return $this->getCacheComponents($a->getComponents()); |
137 | 141 | }) |
138 | 142 | ->put('neon', $this->getCacheComponents(neon()->getComponents())) |