Passed
Push — master ( 3f6c85...9c6499 )
by Jens
02:40
created
cloudcontrol/templates/cms/documents/function.renderFolder.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@  discard block
 block discarded – undo
5 5
  * @param string                    $slugPrefix
6 6
  * @param bool                      $root
7 7
  */
8
-function renderFolder($document, $cmsPrefix, $slugPrefix ='', $root = false) {?>
8
+function renderFolder($document, $cmsPrefix, $slugPrefix = '', $root = false) {?>
9 9
 	<div class="grid-box-8">
10 10
 		<h3>
11
-			<a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix . $document->slug?>" title="Open">
11
+			<a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix.$document->slug?>" title="Open">
12 12
 				<i class="fa fa-folder-o "></i> <?=$document->title?>
13 13
 			</a>
14 14
 		</h3>
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
 	<div class="documentActions grid-box-4">
17 17
 		<?renderAction('Edit',
18 18
 			'',
19
-			\library\cc\Request::$subfolders . $cmsPrefix . '/documents/edit-folder?slug=' . $slugPrefix . $document->slug,
20
-			'pencil');?>
19
+			\library\cc\Request::$subfolders.$cmsPrefix.'/documents/edit-folder?slug='.$slugPrefix.$document->slug,
20
+			'pencil'); ?>
21 21
 		<?renderAction('Delete',
22 22
 			'error',
23
-			\library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-folder?slug=' . $slugPrefix . $document->slug,
23
+			\library\cc\Request::$subfolders.$cmsPrefix.'/documents/delete-folder?slug='.$slugPrefix.$document->slug,
24 24
 			'trash',
25
-			'return confirm(\'Are you sure you want to delete this document?\');');?>
25
+			'return confirm(\'Are you sure you want to delete this document?\');'); ?>
26 26
 	</div>
27 27
 	<ul class="documents grid-wrapper nested<?=$root ? ' root' : '' ?>">
28 28
 		<? foreach ($document->content as $subDocument) : ?>
29 29
 			<li class="grid-container">
30 30
 				<? if ($subDocument->type == 'document') : ?>
31
-					<?renderDocument($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?>
31
+					<?renderDocument($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?>
32 32
 				<? elseif ($subDocument->type == 'folder') : ?>
33
-					<?renderFolder($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?>
33
+					<?renderFolder($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?>
34 34
 				<? endif ?>
35 35
 			</li>
36 36
 		<? endforeach ?>
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents/function.renderDocument.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 function renderDocument($document, $cmsPrefix, $slugPrefix = '') {?>
8 8
 	<div class="grid-box-10">
9 9
 		<h3>
10
-			<a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix . $document->slug?>" title="Edit">
10
+			<a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix.$document->slug?>" title="Edit">
11 11
 				<i class="fa fa-file-text-o"></i>
12 12
 				<small class="state <?=strtolower($document->state)?>"><i class="fa <?=$document->state == 'published' ? 'fa-check-circle-o' : 'fa-times-circle-o' ?>"></i></small>
13 13
 				<?=$document->title?>
@@ -28,25 +28,25 @@  discard block
 block discarded – undo
28 28
 		<? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?>
29 29
             <?renderAction('Publish',
30 30
                 'publish',
31
-                \library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug,
32
-                'check');?>
31
+                \library\cc\Request::$subfolders.$cmsPrefix.'/documents/publish-document?slug='.$slugPrefix.$document->slug,
32
+                'check'); ?>
33 33
 		<? endif ?>
34 34
 		<? if ($document->state == 'published') : ?>
35 35
 			<?renderAction('Unpublish',
36 36
 				'unpublish',
37
-				\library\cc\Request::$subfolders . $cmsPrefix . '/documents/unpublish-document?slug=' . $slugPrefix . $document->slug,
38
-				'times');?>
37
+				\library\cc\Request::$subfolders.$cmsPrefix.'/documents/unpublish-document?slug='.$slugPrefix.$document->slug,
38
+				'times'); ?>
39 39
 		<? endif ?>
40 40
 		<?renderAction('Edit',
41 41
 			'',
42
-			\library\cc\Request::$subfolders . $cmsPrefix . '/documents/edit-document?slug=' . $slugPrefix . $document->slug,
43
-			'pencil');?>
42
+			\library\cc\Request::$subfolders.$cmsPrefix.'/documents/edit-document?slug='.$slugPrefix.$document->slug,
43
+			'pencil'); ?>
44 44
 		<? if ($document->state == 'unpublished') : ?>
45 45
 			<?renderAction('Delete',
46 46
 				'error',
47
-				\library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug,
47
+				\library\cc\Request::$subfolders.$cmsPrefix.'/documents/delete-document?slug='.$slugPrefix.$document->slug,
48 48
 				'trash',
49
-                'return confirm(\'Are you sure you want to delete this document?\');');?>
49
+                'return confirm(\'Are you sure you want to delete this document?\');'); ?>
50 50
 		<? endif ?>
51 51
 	</div>
52 52
 <?}?>
Please login to merge, or discard this patch.
cloudcontrol/library/components/cms/DocumentRouting.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 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;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		if (isset($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE])) {
96 96
 			if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], $request::$get[CmsComponent::GET_PARAMETER_PATH])) {
97 97
 				$cmsComponent->storage->getDocuments()->addDocument($request::$post);
98
-				header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
98
+				header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
99 99
 				exit;
100 100
 			}
101 101
 			$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $cmsComponent->storage->getDocumentTypes()->getDocumentTypeBySlug($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], true));
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		} else {
104 104
 			$documentTypes = $cmsComponent->storage->getDocumentTypes()->getDocumentTypes();
105 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>');
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 107
 			}
108 108
 			$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPES, $documentTypes);
109 109
 		}
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug);
121 121
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
122 122
 			$cmsComponent->storage->getDocuments()->saveDocument($request::$post);
123
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
123
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
124 124
 			exit;
125 125
 		}
126 126
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT, $cmsComponent->storage->getDocuments()->getDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG], 'unpublished'));
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	private function deleteDocumentRoute($request, $cmsComponent)
158 158
 	{
159 159
 		$cmsComponent->storage->getDocuments()->deleteDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
160
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
160
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
161 161
 		exit;
162 162
 	}
163 163
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
172 172
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::GET_PARAMETER_PATH])) {
173 173
 			$cmsComponent->storage->addDocumentFolder($request::$post);
174
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
174
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
175 175
 			exit;
176 176
 		}
177 177
 	}
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
 		array_pop($path);
191 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 195
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post['content'])) {
196 196
 			$cmsComponent->storage->saveDocumentFolder($request::$post);
197
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
197
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
198 198
 			exit;
199 199
 		}
200 200
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	private function deleteFolderRoute($request, $cmsComponent)
210 210
 	{
211 211
 		$cmsComponent->storage->deleteDocumentFolderBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
212
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
212
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
213 213
 		exit;
214 214
 	}
215 215
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	private function publishDocumentRoute($request, $cmsComponent)
221 221
 	{
222 222
 		$cmsComponent->storage->publishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
223
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
223
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
224 224
 		exit;
225 225
 	}
226 226
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	private function unpublishDocumentRoute($request, $cmsComponent)
232 232
 	{
233 233
 		$cmsComponent->storage->unpublishDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
234
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents');
234
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents');
235 235
 		exit;
236 236
 	}
237 237
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
249 249
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) {
250 250
 			$cmsComponent->storage->getValuelists()->addValuelist($request::$post);
251
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
251
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents/valuelists');
252 252
 			exit;
253 253
 		}
254 254
 	}
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 
261 261
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
262 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');
263
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents/valuelists');
264 264
 			exit;
265 265
 		}
266 266
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 	private function deleteValuelistRoute($request, $cmsComponent)
272 272
 	{
273 273
 		$cmsComponent->storage->getValuelists()->deleteValuelistBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
274
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents/valuelists');
274
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents/valuelists');
275 275
 		exit;
276 276
 	}
277 277
 }
278 278
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/components/cms/SitemapRouting.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_SITEMAP);
60 60
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::POST_PARAMETER_TEMPLATE], $request::$post[CmsComponent::POST_PARAMETER_COMPONENT])) {
61 61
 			$cmsComponent->storage->getSitemap()->addSitemapItem($request::$post);
62
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap');
62
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap');
63 63
 			exit;
64 64
 		}
65 65
 	}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		$sitemapItem = $cmsComponent->storage->getSitemap()->getSitemapItemBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
76 76
 		if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::POST_PARAMETER_TEMPLATE], $request::$post[CmsComponent::POST_PARAMETER_COMPONENT])) {
77 77
 			$cmsComponent->storage->getSitemap()->saveSitemapItem($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post);
78
-			header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap');
78
+			header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap');
79 79
 			exit;
80 80
 		}
81 81
 		$cmsComponent->setParameter(CmsComponent::PARAMETER_SITEMAP_ITEM, $sitemapItem);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	private function deleteRoute($request, $cmsComponent)
89 89
 	{
90 90
 		$cmsComponent->storage->getSitemap()->deleteSitemapItemBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
91
-		header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap');
91
+		header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap');
92 92
 		exit;
93 93
 	}
94 94
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_SITEMAP);
119 119
         if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::POST_PARAMETER_FROM_URL], $request::$post[CmsComponent::POST_PARAMETER_TO_URL])) {
120 120
             $cmsComponent->storage->getRedirects()->addRedirect($request::$post);
121
-            header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap/redirects');
121
+            header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap/redirects');
122 122
             exit;
123 123
         }
124 124
     }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $redirect = $cmsComponent->storage->getRedirects()->getRedirectBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
131 131
         if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::POST_PARAMETER_FROM_URL], $request::$post[CmsComponent::POST_PARAMETER_TO_URL])) {
132 132
             $cmsComponent->storage->getRedirects()->saveRedirect($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post);
133
-            header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap/redirects');
133
+            header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap/redirects');
134 134
             exit;
135 135
         }
136 136
         $cmsComponent->setParameter(CmsComponent::PARAMETER_REDIRECT, $redirect);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     private function redirectDeleteRoute($request, $cmsComponent)
140 140
     {
141 141
         $cmsComponent->storage->getRedirects()->deleteRedirectBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]);
142
-        header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap/redirects');
142
+        header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap/redirects');
143 143
         exit;
144 144
     }
145 145
 }
146 146
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/cc/Application.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
          */
65 65
         private function config()
66 66
         {
67
-            $configPath = __DIR__ . '/../../config.json';
67
+            $configPath = __DIR__.'/../../config.json';
68 68
             if (realpath($configPath) !== false) {
69 69
                 $json = file_get_contents($configPath);
70 70
                 $this->config = json_decode($json);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         private function redirectMatching($request)
86 86
         {
87 87
             $redirects = $this->storage->getRedirects()->getRedirects();
88
-            $relativeUri = '/' . $request::$relativeUri;
88
+            $relativeUri = '/'.$request::$relativeUri;
89 89
 
90 90
             foreach ($redirects as $redirect) {
91 91
                 if (preg_match_all($redirect->fromUrl, $relativeUri, $matches)) {
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
                     }
96 96
                     if ($redirect->type == '301') {
97 97
                         header('HTTP/1.1 301 Moved Permanently');
98
-                        header('Location: ' . $request::$subfolders . $toUrl);
98
+                        header('Location: '.$request::$subfolders.$toUrl);
99 99
                         exit;
100 100
                     } elseif ($redirect->type == '302') {
101
-                        header('Location: ' . $request::$subfolders . $toUrl, true, 302);
101
+                        header('Location: '.$request::$subfolders.$toUrl, true, 302);
102 102
                         exit;
103 103
                     } else {
104 104
                         throw new \Exception('Invalid redirect type.');
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         private function sitemapMatching($request)
117 117
         {
118 118
             $sitemap = $this->storage->getSitemap()->getSitemap();
119
-            $relativeUri = '/' . $request::$relativeUri;
119
+            $relativeUri = '/'.$request::$relativeUri;
120 120
 
121 121
             foreach ($sitemap as $sitemapItem) {
122 122
                 if ($sitemapItem->regex) {
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
          */
182 182
         private function getComponentObject($class = '', $template = '', $parameters = array(), $matchedSitemapItem)
183 183
         {
184
-            $libraryComponentName = '\\library\\components\\' . $class;
185
-            $userComponentName = '\\components\\' . $class;
184
+            $libraryComponentName = '\\library\\components\\'.$class;
185
+            $userComponentName = '\\components\\'.$class;
186 186
 
187 187
             if (AutoloadUtil::autoLoad($libraryComponentName, false)) {
188 188
                 $component = new $libraryComponentName($template, $this->request, $parameters, $matchedSitemapItem);
189 189
             } elseif (AutoloadUtil::autoLoad($userComponentName, false)) {
190 190
                 $component = new $userComponentName($template, $this->request, $parameters, $matchedSitemapItem);
191 191
             } else {
192
-                throw new \Exception('Could not load component ' . $class);
192
+                throw new \Exception('Could not load component '.$class);
193 193
             }
194 194
 
195 195
             if (!$component instanceof Component) {
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
          */
248 248
         public function setCachingHeaders()
249 249
         {
250
-            header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days
251
-            header("Cache-Control: max-age=" . (60 * 60 * 24 * 2));
250
+            header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days
251
+            header("Cache-Control: max-age=".(60 * 60 * 24 * 2));
252 252
         }
253 253
 
254 254
         /**
Please login to merge, or discard this patch.
cloudcontrol/library/storage/Document.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             }
53 53
         } elseif ($name === 'content') {
54 54
             if ($this->dbHandle === null) {
55
-                throw new \Exception('Document doesnt have a dbHandle handle. (path: ' . $this->path . ')');
55
+                throw new \Exception('Document doesnt have a dbHandle handle. (path: '.$this->path.')');
56 56
             } else {
57 57
                 if ($this->content === null) {
58 58
                     return $this->getContent();
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function __toString()
99 99
 	{
100
-		return 'Document:' . $this->title;
100
+		return 'Document:'.$this->title;
101 101
 	}
102 102
 
103 103
 
Please login to merge, or discard this patch.
cloudcontrol/library/storage/Repository.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
             if (in_array($name, $this->fileBasedSubsets)) {
116 116
                 return $this->$name;
117 117
             } else {
118
-                throw new \Exception('Trying to get undefined property from Repository: ' . $name);
118
+                throw new \Exception('Trying to get undefined property from Repository: '.$name);
119 119
             }
120 120
         } else {
121 121
             if (in_array($name, $this->fileBasedSubsets)) {
122 122
                 return $this->loadSubset($name);
123 123
             } else {
124
-                throw new \Exception('Trying to get undefined property from Repository: ' . $name);
124
+                throw new \Exception('Trying to get undefined property from Repository: '.$name);
125 125
             }
126 126
         }
127 127
     }
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
     {
137 137
         if (in_array($name, $this->fileBasedSubsets)) {
138 138
             $this->$name = $value;
139
-            $changes = $name . 'Changes';
139
+            $changes = $name.'Changes';
140 140
             $this->$changes = true;
141 141
         } else {
142
-            throw new \Exception('Trying to persist unknown subset in repository: ' . $name . ' <br /><pre>' . print_r($value, true) . '</pre>');
142
+            throw new \Exception('Trying to persist unknown subset in repository: '.$name.' <br /><pre>'.print_r($value, true).'</pre>');
143 143
         }
144 144
     }
145 145
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     public function save()
150 150
     {
151 151
         $host = $this;
152
-        array_map(function ($value) use ($host) {
152
+        array_map(function($value) use ($host) {
153 153
             $host->saveSubset($value);
154 154
 		}, $this->fileBasedSubsets);
155 155
     }
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public function saveSubset($subset)
162 162
     {
163
-		$changes = $subset . 'Changes';
163
+		$changes = $subset.'Changes';
164 164
 		if ($this->$changes === true) {
165 165
             if (!defined('JSON_PRETTY_PRINT')) {
166 166
                 $json = json_encode($this->$subset);
167 167
             } else {
168 168
                 $json = json_encode($this->$subset, JSON_PRETTY_PRINT);
169 169
             }
170
-			$subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json';
170
+			$subsetStoragePath = $this->storagePath.DIRECTORY_SEPARATOR.$subset.'.json';
171 171
 			file_put_contents($subsetStoragePath, $json);
172 172
 
173 173
 			$this->$changes = false;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
      */
182 182
     protected function loadSubset($subset)
183 183
     {
184
-        $subsetStoragePath = $this->storagePath . DIRECTORY_SEPARATOR . $subset . '.json';
184
+        $subsetStoragePath = $this->storagePath.DIRECTORY_SEPARATOR.$subset.'.json';
185 185
         $json = file_get_contents($subsetStoragePath);
186 186
         $json = json_decode($json);
187 187
         $this->$subset = $json;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
     public function getContentDbHandle()
232 232
     {
233 233
         if ($this->contentDbHandle === null) {
234
-            $this->contentDbHandle = new \PDO('sqlite:' . $this->storagePath . DIRECTORY_SEPARATOR . 'content.db');
234
+            $this->contentDbHandle = new \PDO('sqlite:'.$this->storagePath.DIRECTORY_SEPARATOR.'content.db');
235 235
         }
236 236
         return $this->contentDbHandle;
237 237
     }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
     public function getDocuments($state = 'published')
248 248
     {
249 249
 		if (!in_array($state, Document::$DOCUMENT_STATES)) {
250
-			throw new \Exception('Unsupported document state: ' . $state);
250
+			throw new \Exception('Unsupported document state: '.$state);
251 251
 		}
252 252
         return $this->getDocumentsByPath('/', $state);
253 253
     }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	public function getDocumentsWithState($folderPath = '/')
256 256
 	{
257 257
 		$db = $this->getContentDbHandle();
258
-		$folderPathWithWildcard = $folderPath . '%';
258
+		$folderPathWithWildcard = $folderPath.'%';
259 259
 
260 260
 		$ifRootIndex = 1;
261 261
 		if ($folderPath == '/') {
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
               FROM documents_unpublished
271 271
 		 LEFT JOIN documents_published
272 272
          		ON documents_published.path = documents_unpublished.path
273
-             WHERE documents_unpublished.`path` LIKE ' . $db->quote($folderPathWithWildcard) . '
274
-               AND substr(documents_unpublished.`path`, ' . (strlen($folderPath) + $ifRootIndex + 1) . ') NOT LIKE "%/%"
275
-               AND length(documents_unpublished.`path`) > ' . (strlen($folderPath) + $ifRootIndex) . '
276
-               AND documents_unpublished.path != ' . $db->quote($folderPath) . '
273
+             WHERE documents_unpublished.`path` LIKE ' . $db->quote($folderPathWithWildcard).'
274
+               AND substr(documents_unpublished.`path`, ' . (strlen($folderPath) + $ifRootIndex + 1).') NOT LIKE "%/%"
275
+               AND length(documents_unpublished.`path`) > ' . (strlen($folderPath) + $ifRootIndex).'
276
+               AND documents_unpublished.path != ' . $db->quote($folderPath).'
277 277
           ORDER BY documents_unpublished.`type` DESC, documents_unpublished.`path` ASC
278 278
         ';
279 279
 		$stmt = $this->getDbStatement($sql);
@@ -300,16 +300,16 @@  discard block
 block discarded – undo
300 300
     public function getDocumentsByPath($folderPath, $state = 'published')
301 301
     {
302 302
     	if (!in_array($state, Document::$DOCUMENT_STATES)) {
303
-    		throw new \Exception('Unsupported document state: ' . $state);
303
+    		throw new \Exception('Unsupported document state: '.$state);
304 304
 		}
305 305
         $db = $this->getContentDbHandle();
306
-        $folderPathWithWildcard = $folderPath . '%';
306
+        $folderPathWithWildcard = $folderPath.'%';
307 307
 
308 308
         $sql = 'SELECT *
309
-              FROM documents_' . $state . '
310
-             WHERE `path` LIKE ' . $db->quote($folderPathWithWildcard) . '
311
-               AND substr(`path`, ' . (strlen($folderPath) + 1) . ') NOT LIKE "%/%"
312
-               AND path != ' . $db->quote($folderPath) . '
309
+              FROM documents_' . $state.'
310
+             WHERE `path` LIKE ' . $db->quote($folderPathWithWildcard).'
311
+               AND substr(`path`, ' . (strlen($folderPath) + 1).') NOT LIKE "%/%"
312
+               AND path != ' . $db->quote($folderPath).'
313 313
           ORDER BY `type` DESC, `path` ASC';
314 314
         $stmt = $this->getDbStatement($sql);
315 315
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
         if ($containerPath === '/') {
337 337
             return $this->getRootFolder();
338 338
         }
339
-        if (substr($containerPath, -1) === '/'){
339
+        if (substr($containerPath, -1) === '/') {
340 340
 			$containerPath = substr($containerPath, 0, -1);
341 341
 		}
342 342
         $containerFolder = $this->getDocumentByPath($containerPath, 'unpublished');
@@ -353,13 +353,13 @@  discard block
 block discarded – undo
353 353
     public function getDocumentByPath($path, $state = 'published')
354 354
     {
355 355
 		if (!in_array($state, Document::$DOCUMENT_STATES)) {
356
-			throw new \Exception('Unsupported document state: ' . $state);
356
+			throw new \Exception('Unsupported document state: '.$state);
357 357
 		}
358 358
         $db = $this->getContentDbHandle();
359 359
         $document = $this->fetchDocument('
360 360
             SELECT *
361
-              FROM documents_' .  $state . '
362
-             WHERE path = ' . $db->quote($path) . '
361
+              FROM documents_' .  $state.'
362
+             WHERE path = ' . $db->quote($path).'
363 363
         ');
364 364
         if ($document instanceof Document && $document->type === 'folder') {
365 365
             $document->dbHandle = $db;
@@ -379,16 +379,16 @@  discard block
 block discarded – undo
379 379
 	public function getTotalDocumentCount($state = 'published')
380 380
 	{
381 381
 		if (!in_array($state, Document::$DOCUMENT_STATES)) {
382
-			throw new \Exception('Unsupported document state: ' . $state);
382
+			throw new \Exception('Unsupported document state: '.$state);
383 383
 		}
384 384
 		$db = $this->getContentDbHandle();
385 385
 		$stmt = $db->query('
386 386
 			SELECT count(*)
387
-			  FROM documents_' . $state . '
387
+			  FROM documents_' . $state.'
388 388
 			 WHERE `type` != "folder"
389 389
 		');
390 390
 		$result = $stmt->fetch(\PDO::FETCH_ASSOC);
391
-		if (!is_array($result )) {
391
+		if (!is_array($result)) {
392 392
 			return 0;
393 393
 		}
394 394
 		return intval(current($result));
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 		if ($stmt === false || !$stmt->execute()) {
408 408
 			$errorInfo = $db->errorInfo();
409 409
 			$errorMsg = $errorInfo[2];
410
-			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
410
+			throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>');
411 411
 		}
412 412
 		return $result;
413 413
 	}
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 			$sql = '
418 418
 				INSERT OR REPLACE INTO documents_published 
419 419
 					  (`id`,`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,`state`,`lastModificationDate`,`creationDate`,`publicationDate`,`lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`)
420
-				SELECT `id`,`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,"published" as state,`lastModificationDate`,`creationDate`,' . time() . ' as publicationDate, `lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`
420
+				SELECT `id`,`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,"published" as state,`lastModificationDate`,`creationDate`,' . time().' as publicationDate, `lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`
421 421
 				  FROM documents_unpublished
422 422
 				 WHERE `path` = :path
423 423
 			';
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 		if ($stmt === false) {
431 431
 			$errorInfo = $db->errorInfo();
432 432
 			$errorMsg = $errorInfo[2];
433
-			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
433
+			throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>');
434 434
 		}
435 435
 		$stmt->bindValue(':path', $path);
436 436
 		$stmt->execute();
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         if ($stmt === false) {
498 498
             $errorInfo = $db->errorInfo();
499 499
             $errorMsg = $errorInfo[2];
500
-            throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
500
+            throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>');
501 501
         }
502 502
         return $stmt;
503 503
     }
@@ -527,25 +527,25 @@  discard block
 block discarded – undo
527 527
     public function saveDocument($documentObject, $state = 'published')
528 528
     {
529 529
 		if (!in_array($state, Document::$DOCUMENT_STATES)) {
530
-			throw new \Exception('Unsupported document state: ' . $state);
530
+			throw new \Exception('Unsupported document state: '.$state);
531 531
 		}
532 532
         $db = $this->getContentDbHandle();
533 533
         $stmt = $this->getDbStatement('
534
-            INSERT OR REPLACE INTO documents_' . $state . ' (`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,`state`,`lastModificationDate`,`creationDate`,`lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`)
534
+            INSERT OR REPLACE INTO documents_' . $state.' (`path`,`title`,`slug`,`type`,`documentType`,`documentTypeSlug`,`state`,`lastModificationDate`,`creationDate`,`lastModifiedBy`,`fields`,`bricks`,`dynamicBricks`)
535 535
             VALUES(
536
-              ' . $db->quote($documentObject->path) . ',
537
-              ' . $db->quote($documentObject->title) . ',
538
-              ' . $db->quote($documentObject->slug) . ',
539
-              ' . $db->quote($documentObject->type) . ',
540
-              ' . $db->quote($documentObject->documentType) . ',
541
-              ' . $db->quote($documentObject->documentTypeSlug) . ',
542
-              ' . $db->quote($documentObject->state) . ',
543
-              ' . $db->quote($documentObject->lastModificationDate) . ',
544
-              ' . $db->quote($documentObject->creationDate) . ',
545
-              ' . $db->quote($documentObject->lastModifiedBy) . ',
546
-              ' . $db->quote(json_encode($documentObject->fields)) . ',
547
-              ' . $db->quote(json_encode($documentObject->bricks)) . ',
548
-              ' . $db->quote(json_encode($documentObject->dynamicBricks)) . '
536
+              ' . $db->quote($documentObject->path).',
537
+              ' . $db->quote($documentObject->title).',
538
+              ' . $db->quote($documentObject->slug).',
539
+              ' . $db->quote($documentObject->type).',
540
+              ' . $db->quote($documentObject->documentType).',
541
+              ' . $db->quote($documentObject->documentTypeSlug).',
542
+              ' . $db->quote($documentObject->state).',
543
+              ' . $db->quote($documentObject->lastModificationDate).',
544
+              ' . $db->quote($documentObject->creationDate).',
545
+              ' . $db->quote($documentObject->lastModifiedBy).',
546
+              ' . $db->quote(json_encode($documentObject->fields)).',
547
+              ' . $db->quote(json_encode($documentObject->bricks)).',
548
+              ' . $db->quote(json_encode($documentObject->dynamicBricks)).'
549 549
             )
550 550
         ');
551 551
         $result = $stmt->execute();
@@ -569,16 +569,16 @@  discard block
 block discarded – undo
569 569
             if ($documentToDelete->type == 'document') {
570 570
                 $stmt = $this->getDbStatement('
571 571
                     DELETE FROM documents_unpublished
572
-                          WHERE path = ' . $db->quote($path) . '
572
+                          WHERE path = ' . $db->quote($path).'
573 573
                 ');
574 574
                 $stmt->execute();
575 575
             } elseif ($documentToDelete->type == 'folder') {
576
-                $folderPathWithWildcard = $path . '%';
576
+                $folderPathWithWildcard = $path.'%';
577 577
                 $stmt = $this->getDbStatement('
578 578
                     DELETE FROM documents_unpublished
579
-                          WHERE (path LIKE ' . $db->quote($folderPathWithWildcard) . '
580
-                            AND substr(`path`, ' . (strlen($path) + 1) . ', 1) = "/")
581
-                            OR path = ' . $db->quote($path) . '
579
+                          WHERE (path LIKE ' . $db->quote($folderPathWithWildcard).'
580
+                            AND substr(`path`, ' . (strlen($path) + 1).', 1) = "/")
581
+                            OR path = ' . $db->quote($path).'
582 582
                 ');
583 583
                 $stmt->execute();
584 584
             }
Please login to merge, or discard this patch.
cloudcontrol/library/search/CharacterFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		$string = strip_tags($string);
49 49
 		$string = trim($string);
50 50
 		$string = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $string); // Remove special alphanumeric characters
51
-		$string = str_replace(array('+', '=', '!', ',', '.',';', ':', '?'), ' ', $string); // Replace sentence breaking charaters with spaces
51
+		$string = str_replace(array('+', '=', '!', ',', '.', ';', ':', '?'), ' ', $string); // Replace sentence breaking charaters with spaces
52 52
 		$string = preg_replace("/[\r\n]+/", " ", $string); // Replace multiple newlines with a single space.
53 53
 		$string = preg_replace("/[\t]+/", " ", $string); // Replace multiple tabs with a single space.
54 54
 		$string = preg_replace("/[^a-zA-Z0-9 ]/", '', $string); // Filter out everything that is not alphanumeric or a space
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	{
67 67
 		$encoding = mb_detect_encoding($string, mb_detect_order(), false);
68 68
 
69
-		if($encoding == "UTF-8") {
69
+		if ($encoding == "UTF-8") {
70 70
 			$string = mb_convert_encoding($string, 'UTF-8', 'UTF-8');
71 71
 		}
72 72
 
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents/fieldTypes/Rich-Text.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 }
7 7
 ?>
8 8
 <div class="rte">
9
-	<div id="summernote_<?=str_replace(']', '-', str_replace('[','-', $fieldPrefix)) . $field->slug?>_rte_<?=$summernoteInstances?>" class="summernote"><?=isset($value) ? $value : '' ?></div>
9
+	<div id="summernote_<?=str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug?>_rte_<?=$summernoteInstances?>" class="summernote"><?=isset($value) ? $value : '' ?></div>
10 10
 </div>
11 11
 <textarea style="display:none;" id="summernote_<?=$field->slug?>_container_<?=$summernoteInstances?>" name="<?=$fieldPrefix?>[<?=$field->slug?>][]"></textarea>
12 12
 <script>
13 13
 	$(document).ready(function () {
14
-		$('#summernote_<?=str_replace(']', '-', str_replace('[','-', $fieldPrefix)) . $field->slug?>_rte_<?=$summernoteInstances?>').summernote({
14
+		$('#summernote_<?=str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug?>_rte_<?=$summernoteInstances?>').summernote({
15 15
 			height: 300,
16 16
 			toolbar: [
17 17
 				/*[groupname, [button list]]*/
@@ -28,4 +28,4 @@  discard block
 block discarded – undo
28 28
 if (!isset($GLOBALS['rteList'])) {
29 29
 	$GLOBALS['rteList'] = array();
30 30
 }
31
-$GLOBALS['rteList'][] = 'summernote_' . str_replace(']', '-', str_replace('[','-', $fieldPrefix)) . $field->slug . '_rte_' . $summernoteInstances ?>
31
+$GLOBALS['rteList'][] = 'summernote_'.str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug.'_rte_'.$summernoteInstances ?>
Please login to merge, or discard this patch.