Passed
Push — master ( 8c639f...f61691 )
by Jens
05:01
created
src/templates/documents/document-form-form.php 3 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 				<div class="form-element">
23 23
 					<label for="<?=$field->slug?>"><?=$field->title?></label>
24 24
 					<? if (isset($document)) :
25
-						$fieldSlug = $field->slug;
26
-						$value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : '';
27
-					else :
28
-						$value = '';
29
-					endif ?>
25
+                        $fieldSlug = $field->slug;
26
+                        $value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : '';
27
+                    else :
28
+                        $value = '';
29
+                    endif ?>
30 30
 					<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
31 31
 					<ul class="grid-wrapper sortable">
32 32
 						<li class="grid-container">
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 							</div>
55 55
 						</li>
56 56
 						<? if (isset($document)) :
57
-							$fieldSlug = $field->slug;
58
-							$iterable = isset($document->fields->$fieldSlug) ? $document->fields->$fieldSlug : array();
59
-							array_shift($iterable);
60
-							?>
57
+                            $fieldSlug = $field->slug;
58
+                            $iterable = isset($document->fields->$fieldSlug) ? $document->fields->$fieldSlug : array();
59
+                            array_shift($iterable);
60
+                            ?>
61 61
 							<? foreach ($iterable as $value) : ?>
62 62
 
63 63
 							<li class="grid-container">
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 					<a class="btn js-addmultiple">+</a>
81 81
 					<? elseif ($field->multiple == true) : ?>
82 82
 						<? if (isset($document)) :
83
-							$fieldSlug = $field->slug;
84
-							$iterable = isset($document->fields->$fieldSlug) ? $document->fields->$fieldSlug : array();
85
-							array_shift($iterable);
86
-							?>
83
+                            $fieldSlug = $field->slug;
84
+                            $iterable = isset($document->fields->$fieldSlug) ? $document->fields->$fieldSlug : array();
85
+                            array_shift($iterable);
86
+                            ?>
87 87
 							<? foreach ($iterable as $value) : ?>
88 88
 
89 89
 							<li>
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 							<? foreach ($document->bricks as $currentBrickSlug => $brickArray) : ?>
119 119
 								<? foreach ($brickArray as $dynamicBrick) : ?>
120 120
 									<? foreach ($bricks as $brick) :
121
-										if (is_object($dynamicBrick) && isset($dynamicBrick->type) && $brick->slug === $dynamicBrick->type && $currentBrickSlug === $myBrickSlug) {
122
-											break;
123
-										}
124
-									endforeach ?>
121
+                                        if (is_object($dynamicBrick) && isset($dynamicBrick->type) && $brick->slug === $dynamicBrick->type && $currentBrickSlug === $myBrickSlug) {
122
+                                            break;
123
+                                        }
124
+                                    endforeach ?>
125 125
 									<? if (is_object($dynamicBrick) && isset($dynamicBrick->type) && $brick->slug === $dynamicBrick->type && $currentBrickSlug === $myBrickSlug) : ?>
126 126
 									<li class="brick form-element">
127 127
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 						<div class="form-element">
143 143
 						<label for="<?=$field->slug?>"><?=$field->title?></label>
144 144
 						<? if (isset($document)) :
145
-							$brickSlug = $brick->slug;
146
-							$fieldSlug = $field->slug;
147
-							$value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : '';
148
-						else :
149
-							$value = '';
150
-						endif ?>
145
+                            $brickSlug = $brick->slug;
146
+                            $fieldSlug = $field->slug;
147
+                            $value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : '';
148
+                        else :
149
+                            $value = '';
150
+                        endif ?>
151 151
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
152 152
 						<ul class="grid-wrapper sortable">
153 153
 							<li class="grid-container">
@@ -175,11 +175,11 @@  discard block
 block discarded – undo
175 175
 								</div>
176 176
 							</li>
177 177
 							<? if (isset($document)) :
178
-								$brickSlug = $brick->slug;
179
-								$fieldSlug = $field->slug;
180
-								$iterable = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? $document->bricks->$brickSlug->fields->$fieldSlug : array();
181
-								array_shift($iterable);
182
-								?>
178
+                                $brickSlug = $brick->slug;
179
+                                $fieldSlug = $field->slug;
180
+                                $iterable = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? $document->bricks->$brickSlug->fields->$fieldSlug : array();
181
+                                array_shift($iterable);
182
+                                ?>
183 183
 								<? foreach ($iterable as $value) : ?>
184 184
 
185 185
 								<li class="grid-container">
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
 						<a class="btn js-addmultiple">+</a>
203 203
 						<? elseif ($field->multiple == true) : ?>
204 204
 							<? if (isset($document)) :
205
-								$brickSlug = $brick->slug;
206
-								$fieldSlug = $field->slug;
207
-								$iterable = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? $document->bricks->$brickSlug->fields->$fieldSlug : array();
208
-								array_shift($iterable);
209
-								?>
205
+                                $brickSlug = $brick->slug;
206
+                                $fieldSlug = $field->slug;
207
+                                $iterable = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? $document->bricks->$brickSlug->fields->$fieldSlug : array();
208
+                                array_shift($iterable);
209
+                                ?>
210 210
 								<? foreach ($iterable as $value) : ?>
211 211
 
212 212
 								<li>
@@ -246,10 +246,10 @@  discard block
 block discarded – undo
246 246
 				<? if (isset($document)) : ?>
247 247
 					<? foreach ($document->dynamicBricks as $dynamicBrick) : ?>
248 248
 						<? foreach ($bricks as $brick) :
249
-						if ($brick->slug == $dynamicBrick->type) {
250
-							break;
251
-						}
252
-						endforeach ?>
249
+                        if ($brick->slug == $dynamicBrick->type) {
250
+                            break;
251
+                        }
252
+                        endforeach ?>
253 253
 						<li class="brick form-element">
254 254
 							<label><?=$brick->title?></label>
255 255
 							<?$static = false; ?>
Please login to merge, or discard this patch.
Braces   +16 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?= isset($formId) ? '#' . $formId : '' ?>">
2 2
     <? if (!isset($hideTitleAndState)) : ?>
3 3
       <input type="hidden" name="path" value="<?= $request::$get['path'] ?>"/>
4
-    <? else : ?>
4
+    <? else {
5
+    : ?>
5 6
       <input type="hidden" name="formId" value="<?= $formId ?>"/>
6 7
       <a name="<?= $formId ?>"></a>
7 8
     <? endif ?>
@@ -17,15 +18,19 @@  discard block
 block discarded – undo
17 18
                     <input required="required" value="<?=isset($document) ? $document->title : '' ?>" type="text" id="title" name="title" placeholder="Title" />
18 19
                 </div>
19 20
 			<? endif ?>
20
-			<?$fieldPrefix='fields';?>
21
+			<?$fieldPrefix='fields';
22
+}
23
+?>
21 24
 			<? foreach ($documentType->fields as $field) : ?>
22 25
 				<div class="form-element">
23 26
 					<label for="<?=$field->slug?>"><?=$field->title?></label>
24 27
 					<? if (isset($document)) :
25 28
 						$fieldSlug = $field->slug;
26 29
 						$value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : '';
27
-					else :
30
+					else {
31
+					    :
28 32
 						$value = '';
33
+					}
29 34
 					endif ?>
30 35
 					<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
31 36
 					<ul class="grid-wrapper sortable">
@@ -135,8 +140,11 @@  discard block
 block discarded – undo
135 140
 					</ul>
136 141
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a>
137 142
 					<?$static_brick_nr += 1?>
138
-				<? else : ?>
139
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
143
+				<? else {
144
+    : ?>
145
+					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';
146
+}
147
+?>
140 148
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
141 149
 					<? foreach ($brick->structure->fields as $field) : ?>
142 150
 						<div class="form-element">
@@ -145,8 +153,10 @@  discard block
 block discarded – undo
145 153
 							$brickSlug = $brick->slug;
146 154
 							$fieldSlug = $field->slug;
147 155
 							$value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : '';
148
-						else :
156
+						else {
157
+						    :
149 158
 							$value = '';
159
+						}
150 160
 						endif ?>
151 161
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
152 162
 						<ul class="grid-wrapper sortable">
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
                     <input required="required" value="<?=isset($document) ? $document->title : '' ?>" type="text" id="title" name="title" placeholder="Title" />
18 18
                 </div>
19 19
 			<? endif ?>
20
-			<?$fieldPrefix='fields';?>
20
+			<?$fieldPrefix = 'fields'; ?>
21 21
 			<? foreach ($documentType->fields as $field) : ?>
22 22
 				<div class="form-element">
23 23
 					<label for="<?=$field->slug?>"><?=$field->title?></label>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 									</div>
74 74
 								</div>
75 75
 							</li>
76
-							<?$value='';?>
76
+							<?$value = ''; ?>
77 77
 							<? endforeach ?>
78 78
 						<? endif ?>
79 79
 					</ul>
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 								<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
94 94
 								</div>
95 95
 							</li>
96
-							<?$value='';?>
96
+							<?$value = ''; ?>
97 97
 						<? endforeach ?>
98 98
 						<? endif ?>
99 99
 						</div>
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 					<a class="btn js-addrtemultiple">+</a>
103 103
 					<? endif ?>
104 104
 				</div>
105
-				<?$value='';?>
105
+				<?$value = ''; ?>
106 106
 			<? endforeach ?>
107 107
 			<hr />
108
-			<? $static_brick_nr = 0;?>
108
+			<? $static_brick_nr = 0; ?>
109 109
 			<? foreach ($documentType->bricks as $brick) : ?>
110 110
 			<div class="brick">
111 111
 				<label><?=$brick->title?></label>
112 112
 				<? if ($brick->multiple == 'true') : ?>
113 113
 					<input type="hidden" value="<?=$brick->brickSlug?>"/>
114 114
 					<input type="hidden" value="<?=$brick->slug?>"/>
115
-					<?$myBrickSlug=$brick->slug;?>
115
+					<?$myBrickSlug = $brick->slug; ?>
116 116
 					<ul id="newBrickDropzone_<?=$static_brick_nr?>" class="dynamicBricks sortable">
117 117
 						<? if (isset($document)) : ?>
118 118
 							<? foreach ($document->bricks as $currentBrickSlug => $brickArray) : ?>
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a>
137 137
 					<?$static_brick_nr += 1?>
138 138
 				<? else : ?>
139
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
139
+					<?$fieldPrefix = 'bricks[' . $brick->slug . '][fields]'; ?>
140 140
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
141 141
 					<? foreach ($brick->structure->fields as $field) : ?>
142 142
 						<div class="form-element">
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 										</div>
196 196
 									</div>
197 197
 								</li>
198
-								<?$value='';?>
198
+								<?$value = ''; ?>
199 199
 								<? endforeach ?>
200 200
 							<? endif ?>
201 201
 						</ul>
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
217 217
 									</div>
218 218
 								</li>
219
-								<?$value='';?>
219
+								<?$value = ''; ?>
220 220
 							<? endforeach ?>
221 221
 							<? endif ?>
222 222
 							</div>
@@ -225,12 +225,12 @@  discard block
 block discarded – undo
225 225
 						<a class="btn js-addrtemultiple">+</a>
226 226
 						<? endif ?>
227 227
 					</div>
228
-					<?$value='';?>
228
+					<?$value = ''; ?>
229 229
 				<? endforeach ?>
230 230
 				<? endif ?>
231 231
 				</div>
232 232
 				<hr />
233
-			<? endforeach;?>
233
+			<? endforeach; ?>
234 234
 
235 235
 
236 236
 
Please login to merge, or discard this patch.
src/cc/Request.php 2 patches
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -5,79 +5,79 @@
 block discarded – undo
5 5
      * Class Request
6 6
      * @package CloudControl\Cms\cc
7 7
      */
8
-	class Request {
8
+    class Request {
9 9
 
10
-		/**
11
-		 * @var string
12
-		 */
13
-		public static $subfolders;
14
-		/**
15
-		 * @var string
16
-		 */
17
-		public static $requestUri;
18
-		/**
19
-		 * @var string
20
-		 */
21
-		public static $relativeUri;
22
-		/**
23
-		 * @var string
24
-		 */
25
-		public static $queryString;
26
-		/**
27
-		 * @var array
28
-		 */
29
-		public static $requestParameters;
30
-		/**
31
-		 * @var array
32
-		 */
33
-		public static $post = array();
34
-		/**
35
-		 * @var array
36
-		 */
37
-		public static $get = array();
38
-		/**
39
-		 * @var array
40
-		 */
41
-		private $statics = array();
10
+        /**
11
+         * @var string
12
+         */
13
+        public static $subfolders;
14
+        /**
15
+         * @var string
16
+         */
17
+        public static $requestUri;
18
+        /**
19
+         * @var string
20
+         */
21
+        public static $relativeUri;
22
+        /**
23
+         * @var string
24
+         */
25
+        public static $queryString;
26
+        /**
27
+         * @var array
28
+         */
29
+        public static $requestParameters;
30
+        /**
31
+         * @var array
32
+         */
33
+        public static $post = array();
34
+        /**
35
+         * @var array
36
+         */
37
+        public static $get = array();
38
+        /**
39
+         * @var array
40
+         */
41
+        private $statics = array();
42 42
 
43
-		/**
44
-		 * Request constructor.
45
-		 */
46
-		public function __construct() 
47
-		{
43
+        /**
44
+         * Request constructor.
45
+         */
46
+        public function __construct() 
47
+        {
48 48
             $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/');
49 49
 			
50
-			self::$subfolders = '/' . str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath));
51
-			self::$subfolders = str_replace('//', '/', self::$subfolders);
52
-			if (PHP_SAPI === 'cli') {
53
-				global $argv;
54
-				array_shift($argv);
55
-				self::$queryString = '';
56
-				self::$requestUri = self::$subfolders . implode('/', $argv);
57
-			} else {
58
-				self::$requestUri = $_SERVER['REQUEST_URI'];
59
-				self::$queryString = $_SERVER['QUERY_STRING'];
60
-			}
61
-			if (self::$subfolders === '/') {
62
-				self::$relativeUri = str_replace('?' . self::$queryString, '', substr(self::$requestUri,1));
63
-			} else {
64
-				self::$relativeUri = str_replace('?' . self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri));
65
-			}
50
+            self::$subfolders = '/' . str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath));
51
+            self::$subfolders = str_replace('//', '/', self::$subfolders);
52
+            if (PHP_SAPI === 'cli') {
53
+                global $argv;
54
+                array_shift($argv);
55
+                self::$queryString = '';
56
+                self::$requestUri = self::$subfolders . implode('/', $argv);
57
+            } else {
58
+                self::$requestUri = $_SERVER['REQUEST_URI'];
59
+                self::$queryString = $_SERVER['QUERY_STRING'];
60
+            }
61
+            if (self::$subfolders === '/') {
62
+                self::$relativeUri = str_replace('?' . self::$queryString, '', substr(self::$requestUri,1));
63
+            } else {
64
+                self::$relativeUri = str_replace('?' . self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri));
65
+            }
66 66
 
67
-			self::$requestParameters = explode('/', self::$relativeUri);
67
+            self::$requestParameters = explode('/', self::$relativeUri);
68 68
 			
69
-			self::$get = $_GET;
70
-			self::$post = $_POST;
69
+            self::$get = $_GET;
70
+            self::$post = $_POST;
71 71
 			
72
-			$this->statics = array(
73
-				'subfolders' => self::$subfolders,
74
-				'requestUri' => self::$requestUri,
75
-				'relativeUri' => self::$relativeUri,
76
-				'queryString' => self::$queryString,
77
-				'requestParameters' => self::$requestParameters,
78
-				'post' => self::$post,
79
-				'get' => self::$get
80
-			);
81
-		}
82
-	}
72
+            $this->statics = array(
73
+                'subfolders' => self::$subfolders,
74
+                'requestUri' => self::$requestUri,
75
+                'relativeUri' => self::$relativeUri,
76
+                'queryString' => self::$queryString,
77
+                'requestParameters' => self::$requestParameters,
78
+                'post' => self::$post,
79
+                'get' => self::$get
80
+            );
81
+        }
82
+    }
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 				self::$queryString = $_SERVER['QUERY_STRING'];
60 60
 			}
61 61
 			if (self::$subfolders === '/') {
62
-				self::$relativeUri = str_replace('?' . self::$queryString, '', substr(self::$requestUri,1));
62
+				self::$relativeUri = str_replace('?' . self::$queryString, '', substr(self::$requestUri, 1));
63 63
 			} else {
64 64
 				self::$relativeUri = str_replace('?' . self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri));
65 65
 			}
Please login to merge, or discard this patch.
src/cc/errortemplates/errorviewcli.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 <?php
18 18
 foreach($lines as $nr => $currentLine) {
19
-	echo ($nr == $line ? '* ' : '  ' ) . str_pad($nr, 3, "0", STR_PAD_LEFT) . ' ' . $currentLine;
19
+    echo ($nr == $line ? '* ' : '  ' ) . str_pad($nr, 3, "0", STR_PAD_LEFT) . ' ' . $currentLine;
20 20
 }
21 21
 ?>
22 22
 
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 
27 27
 <?php
28 28
 foreach($trace as $row) {
29
-	echo (isset($row['file']) ? basename($row['file']) : '') . ':'
30
-		. (isset($row['line']) ? $row['line'] : '') . "\t\t\t"
31
-		. (isset($row['class']) ? $row['class'] : ' ') . "\t\t\t"
32
-		. (isset($row['type']) ? $row['type'] : ' ') . "\t\t\t"
33
-		. (isset($row['function']) ? $row['function'] : ' ') . PHP_EOL;
29
+    echo (isset($row['file']) ? basename($row['file']) : '') . ':'
30
+        . (isset($row['line']) ? $row['line'] : '') . "\t\t\t"
31
+        . (isset($row['class']) ? $row['class'] : ' ') . "\t\t\t"
32
+        . (isset($row['type']) ? $row['type'] : ' ') . "\t\t\t"
33
+        . (isset($row['function']) ? $row['function'] : ' ') . PHP_EOL;
34 34
 }
35 35
 ?>
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 ------------------------------------------------------------------------------------------------------------------------------------------------
16 16
 
17 17
 <?php
18
-foreach($lines as $nr => $currentLine) {
19
-	echo ($nr == $line ? '* ' : '  ' ) . str_pad($nr, 3, "0", STR_PAD_LEFT) . ' ' . $currentLine;
18
+foreach ($lines as $nr => $currentLine) {
19
+	echo ($nr == $line ? '* ' : '  ') . str_pad($nr, 3, "0", STR_PAD_LEFT) . ' ' . $currentLine;
20 20
 }
21 21
 ?>
22 22
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 ------------------------------------------------------------------------------------------------------------------------------------------------
26 26
 
27 27
 <?php
28
-foreach($trace as $row) {
28
+foreach ($trace as $row) {
29 29
 	echo (isset($row['file']) ? basename($row['file']) : '') . ':'
30 30
 		. (isset($row['line']) ? $row['line'] : '') . "\t\t\t"
31 31
 		. (isset($row['class']) ? $row['class'] : ' ') . "\t\t\t"
Please login to merge, or discard this patch.
src/components/SearchComponent.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -14,41 +14,41 @@
 block discarded – undo
14 14
 
15 15
 class SearchComponent extends BaseComponent
16 16
 {
17
-	protected $searchParameterName = 'q';
18
-	protected $searchResultsParameterName = 'searchResults';
19
-
20
-	/**
21
-	 * @param \CloudControl\Cms\storage\Storage $storage
22
-	 */
23
-	public function run(Storage $storage)
24
-	{
25
-		parent::run($storage);
26
-
27
-		$this->checkParameters();
28
-
29
-		$request = $this->request;
30
-		if (isset($request::$get[$this->searchParameterName])) {
31
-			$query = $request::$get[$this->searchParameterName];
32
-			$filteredQuery = new CharacterFilter($query);
33
-			$tokenizer = new Tokenizer($filteredQuery);
34
-			$search = new Search($storage);
35
-			$results = $search->getDocumentsForTokenizer($tokenizer);
36
-			$this->parameters[$this->searchResultsParameterName] = $results;
37
-		}
38
-	}
39
-
40
-	/**
41
-	 * Checks to see if any parameters were defined in the cms and acts according
42
-	 */
43
-	private function checkParameters()
44
-	{
45
-		if (isset($this->parameters['searchParameterName'])) {
46
-			$this->searchParameterName = $this->parameters['searchParameterName'];
47
-		}
48
-
49
-		if (isset($this->parameters['searchResultsParameterName'])) {
50
-			$this->searchParameterName = $this->parameters['searchResultsParameterName'];
51
-		}
52
-	}
17
+    protected $searchParameterName = 'q';
18
+    protected $searchResultsParameterName = 'searchResults';
19
+
20
+    /**
21
+     * @param \CloudControl\Cms\storage\Storage $storage
22
+     */
23
+    public function run(Storage $storage)
24
+    {
25
+        parent::run($storage);
26
+
27
+        $this->checkParameters();
28
+
29
+        $request = $this->request;
30
+        if (isset($request::$get[$this->searchParameterName])) {
31
+            $query = $request::$get[$this->searchParameterName];
32
+            $filteredQuery = new CharacterFilter($query);
33
+            $tokenizer = new Tokenizer($filteredQuery);
34
+            $search = new Search($storage);
35
+            $results = $search->getDocumentsForTokenizer($tokenizer);
36
+            $this->parameters[$this->searchResultsParameterName] = $results;
37
+        }
38
+    }
39
+
40
+    /**
41
+     * Checks to see if any parameters were defined in the cms and acts according
42
+     */
43
+    private function checkParameters()
44
+    {
45
+        if (isset($this->parameters['searchParameterName'])) {
46
+            $this->searchParameterName = $this->parameters['searchParameterName'];
47
+        }
48
+
49
+        if (isset($this->parameters['searchResultsParameterName'])) {
50
+            $this->searchParameterName = $this->parameters['searchResultsParameterName'];
51
+        }
52
+    }
53 53
 
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/DocumentFolderComponent.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -10,39 +10,39 @@
 block discarded – undo
10 10
 
11 11
 class DocumentFolderComponent extends BaseComponent
12 12
 {
13
-	const PARAMETER_DOCUMENT_FOLDER_PATH = 'documentFolderPath';
14
-	const PARAMETER_DOCUMENT_FOLDER_PARAMETER_NAME = 'documentFolderParameter';
15
-
16
-	protected $documentFolderParameterName = 'folder';
17
-	protected $documentFolderPath;
18
-
19
-	/**
20
-	 * @param Storage $storage
21
-	 *
22
-	 * @return mixed|void
23
-	 * @throws \Exception
24
-	 */
25
-	public function run(Storage $storage)
26
-	{
27
-		parent::run($storage);
28
-
29
-		$this->checkParameters();
30
-
31
-		$this->parameters[$this->documentFolderParameterName] = $this->storage->getDocumentFolderBySlug($this->documentFolderPath);
32
-	}
33
-
34
-
35
-	/**
36
-	 * Checks to see if any parameters were defined in the cms and acts according
37
-	 */
38
-	private function checkParameters()
39
-	{
40
-		if (isset($this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PATH])) {
41
-			$this->documentFolderPath = $this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PATH];
42
-		}
43
-
44
-		if (isset($this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PARAMETER_NAME])) {
45
-			$this->documentFolderParameterName = $this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PARAMETER_NAME];
46
-		}
47
-	}
13
+    const PARAMETER_DOCUMENT_FOLDER_PATH = 'documentFolderPath';
14
+    const PARAMETER_DOCUMENT_FOLDER_PARAMETER_NAME = 'documentFolderParameter';
15
+
16
+    protected $documentFolderParameterName = 'folder';
17
+    protected $documentFolderPath;
18
+
19
+    /**
20
+     * @param Storage $storage
21
+     *
22
+     * @return mixed|void
23
+     * @throws \Exception
24
+     */
25
+    public function run(Storage $storage)
26
+    {
27
+        parent::run($storage);
28
+
29
+        $this->checkParameters();
30
+
31
+        $this->parameters[$this->documentFolderParameterName] = $this->storage->getDocumentFolderBySlug($this->documentFolderPath);
32
+    }
33
+
34
+
35
+    /**
36
+     * Checks to see if any parameters were defined in the cms and acts according
37
+     */
38
+    private function checkParameters()
39
+    {
40
+        if (isset($this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PATH])) {
41
+            $this->documentFolderPath = $this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PATH];
42
+        }
43
+
44
+        if (isset($this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PARAMETER_NAME])) {
45
+            $this->documentFolderParameterName = $this->parameters[self::PARAMETER_DOCUMENT_FOLDER_PARAMETER_NAME];
46
+        }
47
+    }
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/cms/CmsRouting.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
 
15 15
 interface CmsRouting
16 16
 {
17
-	/**
18
-	 * CmsRouting constructor.
19
-	 *
20
-	 * @param Request $request
21
-	 * @param string $relativeCmsUri
22
-	 * @param CmsComponent $cmsComponent
23
-	 */
24
-	public function __construct($request, $relativeCmsUri, $cmsComponent);
17
+    /**
18
+     * CmsRouting constructor.
19
+     *
20
+     * @param Request $request
21
+     * @param string $relativeCmsUri
22
+     * @param CmsComponent $cmsComponent
23
+     */
24
+    public function __construct($request, $relativeCmsUri, $cmsComponent);
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/cms/ConfigurationRouting.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -18,24 +18,24 @@
 block discarded – undo
18 18
 
19 19
 class ConfigurationRouting implements CmsRouting
20 20
 {
21
-	/**
22
-	 * ConfigurationRouting constructor.
23
-	 *
24
-	 * @param Request $request
25
-	 * @param String $relativeCmsUri
26
-	 * @param CmsComponent $cmsComponent
27
-	 */
28
-	public function __construct($request, $relativeCmsUri, $cmsComponent)
29
-	{
30
-		if ($relativeCmsUri == '/configuration') {
31
-			$cmsComponent->subTemplate = 'configuration';
32
-			$cmsComponent->setParameter(CmsCOmponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION);
33
-		}
21
+    /**
22
+     * ConfigurationRouting constructor.
23
+     *
24
+     * @param Request $request
25
+     * @param String $relativeCmsUri
26
+     * @param CmsComponent $cmsComponent
27
+     */
28
+    public function __construct($request, $relativeCmsUri, $cmsComponent)
29
+    {
30
+        if ($relativeCmsUri == '/configuration') {
31
+            $cmsComponent->subTemplate = 'configuration';
32
+            $cmsComponent->setParameter(CmsCOmponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION);
33
+        }
34 34
 
35
-		new UsersRouting($request, $relativeCmsUri, $cmsComponent);
36
-		new DocumentTypeRouting($request, $relativeCmsUri, $cmsComponent);
37
-		new BricksRouting($request, $relativeCmsUri, $cmsComponent);
38
-		new ImageSetRouting($request, $relativeCmsUri, $cmsComponent);
39
-		new ApplicationComponentRouting($request, $relativeCmsUri, $cmsComponent);
40
-	}
35
+        new UsersRouting($request, $relativeCmsUri, $cmsComponent);
36
+        new DocumentTypeRouting($request, $relativeCmsUri, $cmsComponent);
37
+        new BricksRouting($request, $relativeCmsUri, $cmsComponent);
38
+        new ImageSetRouting($request, $relativeCmsUri, $cmsComponent);
39
+        new ApplicationComponentRouting($request, $relativeCmsUri, $cmsComponent);
40
+    }
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/cms/DocumentRouting.php 2 patches
Indentation   +202 added lines, -202 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         }
28 28
         $this->documentRouting($request, $relativeCmsUri, $cmsComponent);
29 29
         $this->folderRouting($request, $relativeCmsUri, $cmsComponent);
30
-		$this->valuelistsRouting($request, $relativeCmsUri, $cmsComponent);
30
+        $this->valuelistsRouting($request, $relativeCmsUri, $cmsComponent);
31 31
     }
32 32
 
33 33
 
@@ -39,17 +39,17 @@  discard block
 block discarded – undo
39 39
      */
40 40
     private function documentRouting($request, $relativeCmsUri, $cmsComponent)
41 41
     {
42
-		if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) {
43
-			$this->documentNewRoute($request, $cmsComponent);
44
-		} elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])){
45
-			switch ($relativeCmsUri) {
46
-				case '/documents/edit-document': $this->editDocumentRoute($request, $cmsComponent); break;
47
-				case '/documents/get-brick': $this->getBrickRoute($request, $cmsComponent); break;
48
-				case '/documents/delete-document': $this->deleteDocumentRoute($request, $cmsComponent); break;
49
-				case '/documents/publish-document': $this->publishDocumentRoute($request, $cmsComponent); break;
50
-				case '/documents/unpublish-document': $this->unpublishDocumentRoute($request, $cmsComponent); break;
51
-			}
52
-		}
42
+        if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) {
43
+            $this->documentNewRoute($request, $cmsComponent);
44
+        } elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])){
45
+            switch ($relativeCmsUri) {
46
+                case '/documents/edit-document': $this->editDocumentRoute($request, $cmsComponent); break;
47
+                case '/documents/get-brick': $this->getBrickRoute($request, $cmsComponent); break;
48
+                case '/documents/delete-document': $this->deleteDocumentRoute($request, $cmsComponent); break;
49
+                case '/documents/publish-document': $this->publishDocumentRoute($request, $cmsComponent); break;
50
+                case '/documents/unpublish-document': $this->unpublishDocumentRoute($request, $cmsComponent); break;
51
+            }
52
+        }
53 53
     }
54 54
 
55 55
     /**
@@ -60,218 +60,218 @@  discard block
 block discarded – undo
60 60
     private function folderRouting($request, $relativeCmsUri, $cmsComponent)
61 61
     {
62 62
         if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) {
63
-			$this->newFolderRoute($request, $cmsComponent);
63
+            $this->newFolderRoute($request, $cmsComponent);
64 64
         } else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
65
-			$this->editFolderRoute($request, $cmsComponent);
65
+            $this->editFolderRoute($request, $cmsComponent);
66 66
         } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
67
-			$this->deleteFolderRoute($request, $cmsComponent);
67
+            $this->deleteFolderRoute($request, $cmsComponent);
68 68
         }
69 69
     }
70 70
 
71
-	private function valuelistsRouting($request, $relativeCmsUri, $cmsComponent)
72
-	{
73
-		if ($relativeCmsUri == '/documents/valuelists') {
74
-			$this->valuelistsRoute($cmsComponent);
75
-		} elseif ($relativeCmsUri == '/documents/valuelists/new') {
76
-			$this->newValuelistRoute($request, $cmsComponent);
77
-		} elseif ($relativeCmsUri == '/documents/valuelists/edit' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
78
-			$this->editValuelistRoute($request, $cmsComponent);
79
-		} elseif ($relativeCmsUri == '/documents/valuelists/delete' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
80
-			$this->deleteValuelistRoute($request, $cmsComponent);
81
-		}
82
-	}
71
+    private function valuelistsRouting($request, $relativeCmsUri, $cmsComponent)
72
+    {
73
+        if ($relativeCmsUri == '/documents/valuelists') {
74
+            $this->valuelistsRoute($cmsComponent);
75
+        } elseif ($relativeCmsUri == '/documents/valuelists/new') {
76
+            $this->newValuelistRoute($request, $cmsComponent);
77
+        } elseif ($relativeCmsUri == '/documents/valuelists/edit' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
78
+            $this->editValuelistRoute($request, $cmsComponent);
79
+        } elseif ($relativeCmsUri == '/documents/valuelists/delete' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
80
+            $this->deleteValuelistRoute($request, $cmsComponent);
81
+        }
82
+    }
83 83
 
84
-	/**
85
-	 * @param $request
86
-	 * @param CmsComponent $cmsComponent
87
-	 *
88
-	 * @throws \Exception
89
-	 */
90
-	private function documentNewRoute($request, $cmsComponent)
91
-	{
92
-		$cmsComponent->subTemplate = 'documents/document-form';
93
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
94
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug);
95
-		if (isset($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE])) {
96
-			if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], $request::$get[CmsComponent::GET_PARAMETER_PATH])) {
97
-				$cmsComponent->storage->getDocuments()->addDocument($request::$post);
98
-				header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
99
-				exit;
100
-			}
101
-			$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $cmsComponent->storage->getDocumentTypes()->getDocumentTypeBySlug($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], true));
102
-			$cmsComponent->setParameter(CmsComponent::PARAMETER_BRICKS, $cmsComponent->storage->getBricks()->getBricks());
103
-		} else {
104
-			$documentTypes = $cmsComponent->storage->getDocumentTypes()->getDocumentTypes();
105
-			if (count($documentTypes) < 1) {
106
-				throw new \Exception('No Document Types defined yet. <a href="' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types/new">Please do so first.</a>');
107
-			}
108
-			$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPES, $documentTypes);
109
-		}
110
-	}
84
+    /**
85
+     * @param $request
86
+     * @param CmsComponent $cmsComponent
87
+     *
88
+     * @throws \Exception
89
+     */
90
+    private function documentNewRoute($request, $cmsComponent)
91
+    {
92
+        $cmsComponent->subTemplate = 'documents/document-form';
93
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
94
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug);
95
+        if (isset($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE])) {
96
+            if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], $request::$get[CmsComponent::GET_PARAMETER_PATH])) {
97
+                $cmsComponent->storage->getDocuments()->addDocument($request::$post);
98
+                header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
99
+                exit;
100
+            }
101
+            $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $cmsComponent->storage->getDocumentTypes()->getDocumentTypeBySlug($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], true));
102
+            $cmsComponent->setParameter(CmsComponent::PARAMETER_BRICKS, $cmsComponent->storage->getBricks()->getBricks());
103
+        } else {
104
+            $documentTypes = $cmsComponent->storage->getDocumentTypes()->getDocumentTypes();
105
+            if (count($documentTypes) < 1) {
106
+                throw new \Exception('No Document Types defined yet. <a href="' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types/new">Please do so first.</a>');
107
+            }
108
+            $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPES, $documentTypes);
109
+        }
110
+    }
111 111
 
112
-	/**
113
-	 * @param $request
114
-	 * @param CmsComponent $cmsComponent
115
-	 */
116
-	private function editDocumentRoute($request, $cmsComponent)
117
-	{
118
-		$cmsComponent->subTemplate = 'documents/document-form';
119
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
120
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug);
121
-		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
122
-			$cmsComponent->storage->getDocuments()->saveDocument($request::$post);
123
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
124
-			exit;
125
-		}
126
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT, $cmsComponent->storage->getDocuments()->getDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG], 'unpublished'));
127
-		$request::$get[CmsComponent::GET_PARAMETER_PATH] = $request::$get[CmsComponent::GET_PARAMETER_SLUG];
128
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $cmsComponent->storage->getDocumentTypes()->getDocumentTypeBySlug($cmsComponent->getParameter(CmsComponent::PARAMETER_DOCUMENT)->documentTypeSlug, true));
129
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_BRICKS, $cmsComponent->storage->getBricks()->getBricks());
130
-	}
112
+    /**
113
+     * @param $request
114
+     * @param CmsComponent $cmsComponent
115
+     */
116
+    private function editDocumentRoute($request, $cmsComponent)
117
+    {
118
+        $cmsComponent->subTemplate = 'documents/document-form';
119
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
120
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug);
121
+        if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
122
+            $cmsComponent->storage->getDocuments()->saveDocument($request::$post);
123
+            header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
124
+            exit;
125
+        }
126
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT, $cmsComponent->storage->getDocuments()->getDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG], 'unpublished'));
127
+        $request::$get[CmsComponent::GET_PARAMETER_PATH] = $request::$get[CmsComponent::GET_PARAMETER_SLUG];
128
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $cmsComponent->storage->getDocumentTypes()->getDocumentTypeBySlug($cmsComponent->getParameter(CmsComponent::PARAMETER_DOCUMENT)->documentTypeSlug, true));
129
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_BRICKS, $cmsComponent->storage->getBricks()->getBricks());
130
+    }
131 131
 
132
-	/**
133
-	 * @param $request
134
-	 * @param CmsComponent $cmsComponent
135
-	 */
136
-	private function getBrickRoute($request, $cmsComponent)
137
-	{
138
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug);
139
-		$cmsComponent->subTemplate = 'documents/brick';
140
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_BRICK, $cmsComponent->storage->getBricks()->getBrickBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]));
141
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_STATIC, $request::$get[CmsComponent::PARAMETER_STATIC] === 'true');
142
-		if (isset($request::$get[CmsComponent::PARAMETER_MY_BRICK_SLUG])) {
143
-			$cmsComponent->setParameter(CmsComponent::PARAMETER_MY_BRICK_SLUG, $request::$get[CmsComponent::PARAMETER_MY_BRICK_SLUG]);
144
-		}
145
-		$result = new \stdClass();
146
-		$result->body = $cmsComponent->renderTemplate('cms/documents/brick');
147
-		$result->rteList = isset($GLOBALS['rteList']) ? $GLOBALS['rteList'] : array();
148
-		ob_clean();
149
-		header(CmsComponent::CONTENT_TYPE_APPLICATION_JSON);
150
-		die(json_encode($result));
151
-	}
132
+    /**
133
+     * @param $request
134
+     * @param CmsComponent $cmsComponent
135
+     */
136
+    private function getBrickRoute($request, $cmsComponent)
137
+    {
138
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug);
139
+        $cmsComponent->subTemplate = 'documents/brick';
140
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_BRICK, $cmsComponent->storage->getBricks()->getBrickBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]));
141
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_STATIC, $request::$get[CmsComponent::PARAMETER_STATIC] === 'true');
142
+        if (isset($request::$get[CmsComponent::PARAMETER_MY_BRICK_SLUG])) {
143
+            $cmsComponent->setParameter(CmsComponent::PARAMETER_MY_BRICK_SLUG, $request::$get[CmsComponent::PARAMETER_MY_BRICK_SLUG]);
144
+        }
145
+        $result = new \stdClass();
146
+        $result->body = $cmsComponent->renderTemplate('cms/documents/brick');
147
+        $result->rteList = isset($GLOBALS['rteList']) ? $GLOBALS['rteList'] : array();
148
+        ob_clean();
149
+        header(CmsComponent::CONTENT_TYPE_APPLICATION_JSON);
150
+        die(json_encode($result));
151
+    }
152 152
 
153
-	/**
154
-	 * @param $request
155
-	 * @param CmsComponent $cmsComponent
156
-	 */
157
-	private function deleteDocumentRoute($request, $cmsComponent)
158
-	{
159
-		$cmsComponent->storage->getDocuments()->deleteDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
160
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
161
-		exit;
162
-	}
153
+    /**
154
+     * @param $request
155
+     * @param CmsComponent $cmsComponent
156
+     */
157
+    private function deleteDocumentRoute($request, $cmsComponent)
158
+    {
159
+        $cmsComponent->storage->getDocuments()->deleteDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
160
+        header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
161
+        exit;
162
+    }
163 163
 
164
-	/**
165
-	 * @param $request
166
-	 * @param CmsComponent $cmsComponent
167
-	 */
168
-	private function newFolderRoute($request, $cmsComponent)
169
-	{
170
-		$cmsComponent->subTemplate = 'documents/folder-form';
171
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
172
-		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::GET_PARAMETER_PATH])) {
173
-			$cmsComponent->storage->addDocumentFolder($request::$post);
174
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
175
-			exit;
176
-		}
177
-	}
164
+    /**
165
+     * @param $request
166
+     * @param CmsComponent $cmsComponent
167
+     */
168
+    private function newFolderRoute($request, $cmsComponent)
169
+    {
170
+        $cmsComponent->subTemplate = 'documents/folder-form';
171
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
172
+        if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::GET_PARAMETER_PATH])) {
173
+            $cmsComponent->storage->addDocumentFolder($request::$post);
174
+            header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
175
+            exit;
176
+        }
177
+    }
178 178
 
179
-	/**
180
-	 * @param $request
181
-	 * @param CmsComponent $cmsComponent
182
-	 */
183
-	private function editFolderRoute($request, $cmsComponent)
184
-	{
185
-		$cmsComponent->subTemplate = 'documents/folder-form';
186
-		$folder = $cmsComponent->storage->getDocumentFolderBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
179
+    /**
180
+     * @param $request
181
+     * @param CmsComponent $cmsComponent
182
+     */
183
+    private function editFolderRoute($request, $cmsComponent)
184
+    {
185
+        $cmsComponent->subTemplate = 'documents/folder-form';
186
+        $folder = $cmsComponent->storage->getDocumentFolderBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
187 187
 
188
-		$path = $request::$get[CmsComponent::GET_PARAMETER_SLUG];
189
-		$path = explode('/', $path);
190
-		array_pop($path);
191
-		$path = implode('/', $path);
188
+        $path = $request::$get[CmsComponent::GET_PARAMETER_SLUG];
189
+        $path = explode('/', $path);
190
+        array_pop($path);
191
+        $path = implode('/', $path);
192 192
 
193
-		$request::$get[CmsComponent::GET_PARAMETER_PATH] = '/' . $path;
193
+        $request::$get[CmsComponent::GET_PARAMETER_PATH] = '/' . $path;
194 194
 
195
-		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post['content'])) {
196
-			$cmsComponent->storage->saveDocumentFolder($request::$post);
197
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
198
-			exit;
199
-		}
195
+        if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post['content'])) {
196
+            $cmsComponent->storage->saveDocumentFolder($request::$post);
197
+            header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
198
+            exit;
199
+        }
200 200
 
201
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
202
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_FOLDER, $folder);
203
-	}
201
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
202
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_FOLDER, $folder);
203
+    }
204 204
 
205
-	/**
206
-	 * @param $request
207
-	 * @param CmsComponent $cmsComponent
208
-	 */
209
-	private function deleteFolderRoute($request, $cmsComponent)
210
-	{
211
-		$cmsComponent->storage->deleteDocumentFolderBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
212
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
213
-		exit;
214
-	}
205
+    /**
206
+     * @param $request
207
+     * @param CmsComponent $cmsComponent
208
+     */
209
+    private function deleteFolderRoute($request, $cmsComponent)
210
+    {
211
+        $cmsComponent->storage->deleteDocumentFolderBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
212
+        header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
213
+        exit;
214
+    }
215 215
 
216
-	/**
217
-	 * @param $request
218
-	 * @param CmsComponent $cmsComponent
219
-	 */
220
-	private function publishDocumentRoute($request, $cmsComponent)
221
-	{
222
-		$cmsComponent->storage->publishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
223
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
224
-		exit;
225
-	}
216
+    /**
217
+     * @param $request
218
+     * @param CmsComponent $cmsComponent
219
+     */
220
+    private function publishDocumentRoute($request, $cmsComponent)
221
+    {
222
+        $cmsComponent->storage->publishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
223
+        header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
224
+        exit;
225
+    }
226 226
 
227
-	/**
228
-	 * @param $request
229
-	 * @param CmsComponent $cmsComponent
230
-	 */
231
-	private function unpublishDocumentRoute($request, $cmsComponent)
232
-	{
233
-		$cmsComponent->storage->unpublishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
234
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
235
-		exit;
236
-	}
227
+    /**
228
+     * @param $request
229
+     * @param CmsComponent $cmsComponent
230
+     */
231
+    private function unpublishDocumentRoute($request, $cmsComponent)
232
+    {
233
+        $cmsComponent->storage->unpublishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
234
+        header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
235
+        exit;
236
+    }
237 237
 
238
-	private function valuelistsRoute($cmsComponent)
239
-	{
240
-		$cmsComponent->subTemplate = 'documents/valuelists';
241
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_VALUELISTS, $cmsComponent->storage->getValuelists()->getValuelists());
242
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
243
-	}
238
+    private function valuelistsRoute($cmsComponent)
239
+    {
240
+        $cmsComponent->subTemplate = 'documents/valuelists';
241
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_VALUELISTS, $cmsComponent->storage->getValuelists()->getValuelists());
242
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
243
+    }
244 244
 
245
-	private function newValuelistRoute($request, $cmsComponent)
246
-	{
247
-		$cmsComponent->subTemplate = 'documents/valuelist-form';
248
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
249
-		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
250
-			$cmsComponent->storage->getValuelists()->addValuelist($request::$post);
251
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
252
-			exit;
253
-		}
254
-	}
245
+    private function newValuelistRoute($request, $cmsComponent)
246
+    {
247
+        $cmsComponent->subTemplate = 'documents/valuelist-form';
248
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
249
+        if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
250
+            $cmsComponent->storage->getValuelists()->addValuelist($request::$post);
251
+            header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
252
+            exit;
253
+        }
254
+    }
255 255
 
256
-	private function editValuelistRoute($request, $cmsComponent)
257
-	{
258
-		$cmsComponent->subTemplate = 'documents/valuelist-form';
259
-		$folder = $cmsComponent->storage->getValuelists()->getValuelistBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
256
+    private function editValuelistRoute($request, $cmsComponent)
257
+    {
258
+        $cmsComponent->subTemplate = 'documents/valuelist-form';
259
+        $folder = $cmsComponent->storage->getValuelists()->getValuelistBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
260 260
 
261
-		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
262
-			$cmsComponent->storage->getValuelists()->saveValuelist($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post);
263
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
264
-			exit;
265
-		}
261
+        if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
262
+            $cmsComponent->storage->getValuelists()->saveValuelist($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post);
263
+            header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
264
+            exit;
265
+        }
266 266
 
267
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
268
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_VALUELIST, $folder);
269
-	}
267
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
268
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_VALUELIST, $folder);
269
+    }
270 270
 
271
-	private function deleteValuelistRoute($request, $cmsComponent)
272
-	{
273
-		$cmsComponent->storage->getValuelists()->deleteValuelistBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
274
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
275
-		exit;
276
-	}
271
+    private function deleteValuelistRoute($request, $cmsComponent)
272
+    {
273
+        $cmsComponent->storage->getValuelists()->deleteValuelistBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
274
+        header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
275
+        exit;
276
+    }
277 277
 }
278 278
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     {
42 42
 		if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) {
43 43
 			$this->documentNewRoute($request, $cmsComponent);
44
-		} elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])){
44
+		} elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
45 45
 			switch ($relativeCmsUri) {
46 46
 				case '/documents/edit-document': $this->editDocumentRoute($request, $cmsComponent); break;
47 47
 				case '/documents/get-brick': $this->getBrickRoute($request, $cmsComponent); break;
Please login to merge, or discard this patch.
src/components/cms/SearchRouting.php 2 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -15,88 +15,88 @@
 block discarded – undo
15 15
 class SearchRouting implements CmsRouting
16 16
 {
17 17
 
18
-	/**
19
-	 * SearchRouting constructor.
20
-	 *
21
-	 * @param \CloudControl\Cms\cc\Request              $request
22
-	 * @param                                  $relativeCmsUri
23
-	 * @param \CloudControl\Cms\components\CmsComponent $cmsComponent
24
-	 */
25
-	public function __construct($request, $relativeCmsUri, $cmsComponent)
26
-	{
27
-		switch ($relativeCmsUri) {
28
-			case '/search': $this->overviewRoute($cmsComponent); break;
29
-			case '/search/update-index' : $this->updateIndexRoute($cmsComponent); break;
30
-			case '/search/ajax-update-index': $this->ajaxUpdateIndexRoute($request, $cmsComponent); break;
31
-			case '/search/manual-update-index' :
32
-				$indexer = new Indexer($cmsComponent->storage);
33
-				$indexer->updateIndex();
34
-				break;
35
-		}
36
-	}
18
+    /**
19
+     * SearchRouting constructor.
20
+     *
21
+     * @param \CloudControl\Cms\cc\Request              $request
22
+     * @param                                  $relativeCmsUri
23
+     * @param \CloudControl\Cms\components\CmsComponent $cmsComponent
24
+     */
25
+    public function __construct($request, $relativeCmsUri, $cmsComponent)
26
+    {
27
+        switch ($relativeCmsUri) {
28
+            case '/search': $this->overviewRoute($cmsComponent); break;
29
+            case '/search/update-index' : $this->updateIndexRoute($cmsComponent); break;
30
+            case '/search/ajax-update-index': $this->ajaxUpdateIndexRoute($request, $cmsComponent); break;
31
+            case '/search/manual-update-index' :
32
+                $indexer = new Indexer($cmsComponent->storage);
33
+                $indexer->updateIndex();
34
+                break;
35
+        }
36
+    }
37 37
 
38
-	/**
39
-	 * @param \CloudControl\Cms\components\CmsComponent $cmsComponent
40
-	 */
41
-	private function overviewRoute($cmsComponent)
42
-	{
43
-		$cmsComponent->subTemplate = 'search';
44
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_SEARCH);
45
-		$documentCount = $cmsComponent->storage->getDocuments()->getTotalDocumentCount();
46
-		$indexer = new Search($cmsComponent->storage);
47
-		$indexedDocuments = $indexer->getIndexedDocuments();
48
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_SEARCH_NEEDS_UPDATE, $documentCount !== $indexedDocuments);
49
-	}
38
+    /**
39
+     * @param \CloudControl\Cms\components\CmsComponent $cmsComponent
40
+     */
41
+    private function overviewRoute($cmsComponent)
42
+    {
43
+        $cmsComponent->subTemplate = 'search';
44
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_SEARCH);
45
+        $documentCount = $cmsComponent->storage->getDocuments()->getTotalDocumentCount();
46
+        $indexer = new Search($cmsComponent->storage);
47
+        $indexedDocuments = $indexer->getIndexedDocuments();
48
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_SEARCH_NEEDS_UPDATE, $documentCount !== $indexedDocuments);
49
+    }
50 50
 
51
-	/**
52
-	 * @param \CloudControl\Cms\components\CmsComponent $cmsComponent
53
-	 */
54
-	private function updateIndexRoute($cmsComponent)
55
-	{
56
-		$cmsComponent->subTemplate = 'search/update-index';
57
-		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_SEARCH);
58
-	}
51
+    /**
52
+     * @param \CloudControl\Cms\components\CmsComponent $cmsComponent
53
+     */
54
+    private function updateIndexRoute($cmsComponent)
55
+    {
56
+        $cmsComponent->subTemplate = 'search/update-index';
57
+        $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_SEARCH);
58
+    }
59 59
 
60
-	private function ajaxUpdateIndexRoute($request, $cmsComponent)
61
-	{
62
-		$cmsComponent->subTemplate = 'search/update-index';
63
-		if (isset($request::$get['step'])) {
64
-			\set_time_limit(0); // Set max excecution time infinite
65
-			\session_write_close(); // Close the session, so it doesnt create a lock on the sessionstorage, block other requests.
66
-			$indexer = new Indexer($cmsComponent->storage);
67
-			$step = $request::$get['step'];
68
-			$this->stepRouting($step, $cmsComponent, $indexer);
69
-		} else {
70
-			$this->showJson('No step defined.', 'HTTP/1.0 500 Internal Server Error');
71
-		}
72
-	}
60
+    private function ajaxUpdateIndexRoute($request, $cmsComponent)
61
+    {
62
+        $cmsComponent->subTemplate = 'search/update-index';
63
+        if (isset($request::$get['step'])) {
64
+            \set_time_limit(0); // Set max excecution time infinite
65
+            \session_write_close(); // Close the session, so it doesnt create a lock on the sessionstorage, block other requests.
66
+            $indexer = new Indexer($cmsComponent->storage);
67
+            $step = $request::$get['step'];
68
+            $this->stepRouting($step, $cmsComponent, $indexer);
69
+        } else {
70
+            $this->showJson('No step defined.', 'HTTP/1.0 500 Internal Server Error');
71
+        }
72
+    }
73 73
 
74
-	private function showJson($obj, $httpHeader = 'HTTP/1.0 200 OK') {
75
-		header($_SERVER['SERVER_PROTOCOL'] . $httpHeader, true);
76
-		header('Content-type: application/json');
77
-		die(json_encode($obj));
78
-	}
74
+    private function showJson($obj, $httpHeader = 'HTTP/1.0 200 OK') {
75
+        header($_SERVER['SERVER_PROTOCOL'] . $httpHeader, true);
76
+        header('Content-type: application/json');
77
+        die(json_encode($obj));
78
+    }
79 79
 
80
-	/**
81
-	 * @param CmsComponent $cmsComponent
82
-	 * @param string $step
83
-	 * @param Indexer $indexer
84
-	 */
85
-	private function stepRouting($step, $cmsComponent, $indexer)
86
-	{
87
-		switch($step) {
88
-			case 'resetIndex': $indexer->resetIndex(); break;
89
-			case 'cleanPublishedDeletedDocuments': $cmsComponent->storage->getDocuments()->cleanPublishedDeletedDocuments(); break;
90
-			case 'createDocumentTermCount':
91
-				$documents = $cmsComponent->storage->getDocuments()->getPublishedDocumentsNoFolders();
92
-				$indexer->createDocumentTermCount($documents);
93
-				break;
94
-			case 'createDocumentTermFrequency': $indexer->createDocumentTermFrequency(); break;
95
-			case 'createTermFieldLengthNorm': $indexer->createTermFieldLengthNorm(); break;
96
-			case 'createInverseDocumentFrequency': $indexer->createInverseDocumentFrequency(); break;
97
-			case 'replaceOldIndex': $indexer->replaceOldIndex(); break;
98
-			default : $this->showJson('Invalid step: ' . $step . '.', 'HTTP/1.0 500 Internal Server Error'); break;
99
-		}
100
-		$this->showJson('done');
101
-	}
80
+    /**
81
+     * @param CmsComponent $cmsComponent
82
+     * @param string $step
83
+     * @param Indexer $indexer
84
+     */
85
+    private function stepRouting($step, $cmsComponent, $indexer)
86
+    {
87
+        switch($step) {
88
+            case 'resetIndex': $indexer->resetIndex(); break;
89
+            case 'cleanPublishedDeletedDocuments': $cmsComponent->storage->getDocuments()->cleanPublishedDeletedDocuments(); break;
90
+            case 'createDocumentTermCount':
91
+                $documents = $cmsComponent->storage->getDocuments()->getPublishedDocumentsNoFolders();
92
+                $indexer->createDocumentTermCount($documents);
93
+                break;
94
+            case 'createDocumentTermFrequency': $indexer->createDocumentTermFrequency(); break;
95
+            case 'createTermFieldLengthNorm': $indexer->createTermFieldLengthNorm(); break;
96
+            case 'createInverseDocumentFrequency': $indexer->createInverseDocumentFrequency(); break;
97
+            case 'replaceOldIndex': $indexer->replaceOldIndex(); break;
98
+            default : $this->showJson('Invalid step: ' . $step . '.', 'HTTP/1.0 500 Internal Server Error'); break;
99
+        }
100
+        $this->showJson('done');
101
+    }
102 102
 }
103 103
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 	 */
85 85
 	private function stepRouting($step, $cmsComponent, $indexer)
86 86
 	{
87
-		switch($step) {
87
+		switch ($step) {
88 88
 			case 'resetIndex': $indexer->resetIndex(); break;
89 89
 			case 'cleanPublishedDeletedDocuments': $cmsComponent->storage->getDocuments()->cleanPublishedDeletedDocuments(); break;
90 90
 			case 'createDocumentTermCount':
Please login to merge, or discard this patch.