Passed
Push — develop ( d59462...7f0625 )
by Jens
02:38
created
cloudcontrol/library/search/Indexer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$this->storage->getDocuments()->cleanPublishedDeletedDocuments();
61 61
 		$this->addLog('Retrieving documents to be indexed.');
62 62
 		$documents = $this->storage->getDocuments()->getPublishedDocumentsNoFolders();
63
-		$this->addLog('Start Document Term Count for ' . count($documents) . ' documents');
63
+		$this->addLog('Start Document Term Count for '.count($documents).' documents');
64 64
 		$this->createDocumentTermCount($documents);
65 65
 		$this->addLog('Start Document Term Frequency.');
66 66
 		$this->createDocumentTermFrequency();
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	private function addLog($string)
162 162
 	{
163 163
 		$currentTime = round(microtime(true) * 1000);
164
-		$this->log .= date('d-m-Y H:i:s - ') . str_pad($string, 50, " ", STR_PAD_RIGHT) . "\t" . ($currentTime - $this->lastLog) . 'ms since last log. ' . "\t" . ($currentTime - $this->loggingStart) . 'ms since start.' . PHP_EOL;
164
+		$this->log .= date('d-m-Y H:i:s - ').str_pad($string, 50, " ", STR_PAD_RIGHT)."\t".($currentTime - $this->lastLog).'ms since last log. '."\t".($currentTime - $this->loggingStart).'ms since start.'.PHP_EOL;
165 165
 		$this->lastLog = round(microtime(true) * 1000);
166 166
 	}
167 167
 
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	protected function getSearchDbHandle()
174 174
 	{
175 175
 		if ($this->searchDbHandle === null) {
176
-			$path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $this->storageDir . DIRECTORY_SEPARATOR;
177
-			$this->searchDbHandle = new \PDO('sqlite:' . $path . self::SEARCH_TEMP_DB);
176
+			$path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$this->storageDir.DIRECTORY_SEPARATOR;
177
+			$this->searchDbHandle = new \PDO('sqlite:'.$path.self::SEARCH_TEMP_DB);
178 178
 		}
179 179
 		return $this->searchDbHandle;
180 180
 	}
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	public function replaceOldIndex()
186 186
 	{
187 187
 		$this->searchDbHandle = null;
188
-		$path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $this->storageDir . DIRECTORY_SEPARATOR;
189
-		rename($path . self::SEARCH_TEMP_DB, $path . 'search.db');
188
+		$path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$this->storageDir.DIRECTORY_SEPARATOR;
189
+		rename($path.self::SEARCH_TEMP_DB, $path.'search.db');
190 190
 	}
191 191
 }
192 192
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/components/cms/SearchRouting.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	private function showJson($obj, $httpHeader = 'HTTP/1.0 200 OK') {
75
-		header($_SERVER['SERVER_PROTOCOL'] . $httpHeader, true);
75
+		header($_SERVER['SERVER_PROTOCOL'].$httpHeader, true);
76 76
 		header('Content-type: application/json');
77 77
 		die(json_encode($obj));
78 78
 	}
@@ -84,7 +84,7 @@  discard block
 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':
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			case 'createTermFieldLengthNorm': $indexer->createTermFieldLengthNorm(); break;
96 96
 			case 'createInverseDocumentFrequency': $indexer->createInverseDocumentFrequency(); break;
97 97
 			case 'replaceOldIndex': $indexer->replaceOldIndex(); break;
98
-			default : $this->showJson('Invalid step: ' . $step . '.', 'HTTP/1.0 500 Internal Server Error'); break;
98
+			default : $this->showJson('Invalid step: '.$step.'.', 'HTTP/1.0 500 Internal Server Error'); break;
99 99
 		}
100 100
 		$this->showJson('done');
101 101
 	}
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <? include('documents/function.renderAction.php'); ?>
2 2
 <? include('documents/function.renderDocument.php'); ?>
3 3
 <? include('documents/function.renderFolder.php'); ?>
4
-<script>window.onload=function(){History.init();History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders . $cmsPrefix?>/documents?path=/');};</script>
4
+<script>window.onload=function(){History.init();History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders.$cmsPrefix?>/documents?path=/');};</script>
5 5
 <section class="documents">
6 6
 	<h2><i class="fa fa-file-text-o"></i> Documents</h2>
7 7
 	<nav class="actions">
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 			<? foreach ($documents as $document) : ?>
28 28
 				<li class="grid-container">
29 29
 					<? if ($document->type == 'document') : ?>
30
-						<?renderDocument($document, $cmsPrefix);?>
30
+						<?renderDocument($document, $cmsPrefix); ?>
31 31
 					<? elseif ($document->type == 'folder') : ?>
32
-						<?renderFolder($document, $cmsPrefix, '', true);?>
32
+						<?renderFolder($document, $cmsPrefix, '', true); ?>
33 33
 					<? endif ?>
34 34
 				</li>
35 35
 			<? endforeach ?>
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents/function.renderDocument.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	<div class="documentActions grid-box-2">
22 22
 		<? if ($document->state == 'unpublished' || $document->unpublishedChanges) : ?>
23 23
             <?renderAction('Publish',
24
-                'publish',
25
-                \library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug,
26
-                'check');?>
24
+				'publish',
25
+				\library\cc\Request::$subfolders . $cmsPrefix . '/documents/publish-document?slug=' . $slugPrefix . $document->slug,
26
+				'check');?>
27 27
 		<? endif ?>
28 28
 		<? if ($document->state == 'published') : ?>
29 29
 			<?renderAction('Unpublish',
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 				'error',
41 41
 				\library\cc\Request::$subfolders . $cmsPrefix . '/documents/delete-document?slug=' . $slugPrefix . $document->slug,
42 42
 				'trash',
43
-                'return confirm(\'Are you sure you want to delete this document?\');');?>
43
+				'return confirm(\'Are you sure you want to delete this document?\');');?>
44 44
 		<? endif ?>
45 45
 	</div>
46 46
 <?}?>
Please login to merge, or discard this 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/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/library/storage/storage/ValuelistsStorage.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -12,83 +12,83 @@
 block discarded – undo
12 12
 
13 13
 class ValuelistsStorage extends AbstractStorage
14 14
 {
15
-    /**
16
-     * Get all valuelists
17
-     *
18
-     * @return mixed
19
-     */
20
-    public function getValuelists()
21
-    {
22
-        return $this->repository->valuelists;
23
-    }
15
+	/**
16
+	 * Get all valuelists
17
+	 *
18
+	 * @return mixed
19
+	 */
20
+	public function getValuelists()
21
+	{
22
+		return $this->repository->valuelists;
23
+	}
24 24
 
25
-    public function addValuelist($postValues)
26
-    {
27
-        $valueListObject = ValuelistFactory::createValuelistFromPostValues($postValues);
28
-        $valuelists = $this->repository->valuelists;
29
-        $valuelists[] = $valueListObject;
30
-        $this->repository->valuelists = $valuelists;
31
-        $this->save();
32
-    }
25
+	public function addValuelist($postValues)
26
+	{
27
+		$valueListObject = ValuelistFactory::createValuelistFromPostValues($postValues);
28
+		$valuelists = $this->repository->valuelists;
29
+		$valuelists[] = $valueListObject;
30
+		$this->repository->valuelists = $valuelists;
31
+		$this->save();
32
+	}
33 33
 
34
-    /**
35
-     * Save changes to a valuelist
36
-     *
37
-     * @param $slug
38
-     * @param $postValues
39
-     *
40
-     * @throws \Exception
41
-     */
42
-    public function saveValuelist($slug, $postValues)
43
-    {
44
-        $valuelistObject = ValuelistFactory::createValuelistFromPostValues($postValues);
34
+	/**
35
+	 * Save changes to a valuelist
36
+	 *
37
+	 * @param $slug
38
+	 * @param $postValues
39
+	 *
40
+	 * @throws \Exception
41
+	 */
42
+	public function saveValuelist($slug, $postValues)
43
+	{
44
+		$valuelistObject = ValuelistFactory::createValuelistFromPostValues($postValues);
45 45
 
46
-        $valuelists = $this->repository->valuelists;
47
-        foreach ($valuelists as $key => $valuelist) {
48
-            if ($valuelist->slug == $slug) {
49
-                $valuelists[$key] = $valuelistObject;
50
-            }
51
-        }
52
-        $this->repository->valuelists = $valuelists;
53
-        $this->save();
54
-    }
46
+		$valuelists = $this->repository->valuelists;
47
+		foreach ($valuelists as $key => $valuelist) {
48
+			if ($valuelist->slug == $slug) {
49
+				$valuelists[$key] = $valuelistObject;
50
+			}
51
+		}
52
+		$this->repository->valuelists = $valuelists;
53
+		$this->save();
54
+	}
55 55
 
56
-    /**
57
-     * Get a valuelist by its slug
58
-     *
59
-     * @param $slug
60
-     *
61
-     * @return mixed
62
-     */
63
-    public function getValuelistBySlug($slug)
64
-    {
65
-        $valuelists = $this->repository->valuelists;
66
-        foreach ($valuelists as $valuelist) {
67
-            if ($valuelist->slug == $slug) {
68
-                return $valuelist;
69
-            }
70
-        }
56
+	/**
57
+	 * Get a valuelist by its slug
58
+	 *
59
+	 * @param $slug
60
+	 *
61
+	 * @return mixed
62
+	 */
63
+	public function getValuelistBySlug($slug)
64
+	{
65
+		$valuelists = $this->repository->valuelists;
66
+		foreach ($valuelists as $valuelist) {
67
+			if ($valuelist->slug == $slug) {
68
+				return $valuelist;
69
+			}
70
+		}
71 71
 
72
-        return null;
73
-    }
72
+		return null;
73
+	}
74 74
 
75
-    /**
76
-     * Delete a sitemap item by its slug
77
-     *
78
-     * @param $slug
79
-     *
80
-     * @throws \Exception
81
-     */
82
-    public function deleteValuelistBySlug($slug)
83
-    {
84
-        $valuelists = $this->repository->valuelists;
85
-        foreach ($valuelists as $key => $valuelist) {
86
-            if ($valuelist->slug == $slug) {
87
-                unset($valuelists[$key]);
88
-            }
89
-        }
90
-        $valuelists = array_values($valuelists);
91
-        $this->repository->valuelists = $valuelists;
92
-        $this->save();
93
-    }
75
+	/**
76
+	 * Delete a sitemap item by its slug
77
+	 *
78
+	 * @param $slug
79
+	 *
80
+	 * @throws \Exception
81
+	 */
82
+	public function deleteValuelistBySlug($slug)
83
+	{
84
+		$valuelists = $this->repository->valuelists;
85
+		foreach ($valuelists as $key => $valuelist) {
86
+			if ($valuelist->slug == $slug) {
87
+				unset($valuelists[$key]);
88
+			}
89
+		}
90
+		$valuelists = array_values($valuelists);
91
+		$this->repository->valuelists = $valuelists;
92
+		$this->save();
93
+	}
94 94
 }
95 95
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/storage/factories/ValuelistFactory.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -12,34 +12,34 @@
 block discarded – undo
12 12
 
13 13
 class ValuelistFactory
14 14
 {
15
-    /**
16
-     * Create a sitemap item from post values
17
-     *
18
-     * @param $postValues
19
-     *
20
-     * @return \stdClass
21
-     * @throws \Exception
22
-     */
23
-    public static function createValuelistFromPostValues($postValues)
24
-    {
25
-        if (isset($postValues['title'])) {
26
-            $valuelistObject = new \stdClass();
27
-            $valuelistObject->title = $postValues['title'];
28
-            $valuelistObject->slug = StringUtil::slugify($postValues['title']);
29
-            $valuelistObject->pairs = new \stdClass();
30
-            if (isset($postValues['keys'], $postValues['values'])) {
31
-                foreach ($postValues['keys'] as $key => $value) {
32
-                    $valuelistObject->pairs->$value = $postValues['values'][$key];
33
-                }
34
-            }
35
-            $object_vars = get_object_vars($valuelistObject->pairs);
36
-            ksort($object_vars);
37
-            $valuelistObject->pairs = (object) $object_vars;
15
+	/**
16
+	 * Create a sitemap item from post values
17
+	 *
18
+	 * @param $postValues
19
+	 *
20
+	 * @return \stdClass
21
+	 * @throws \Exception
22
+	 */
23
+	public static function createValuelistFromPostValues($postValues)
24
+	{
25
+		if (isset($postValues['title'])) {
26
+			$valuelistObject = new \stdClass();
27
+			$valuelistObject->title = $postValues['title'];
28
+			$valuelistObject->slug = StringUtil::slugify($postValues['title']);
29
+			$valuelistObject->pairs = new \stdClass();
30
+			if (isset($postValues['keys'], $postValues['values'])) {
31
+				foreach ($postValues['keys'] as $key => $value) {
32
+					$valuelistObject->pairs->$value = $postValues['values'][$key];
33
+				}
34
+			}
35
+			$object_vars = get_object_vars($valuelistObject->pairs);
36
+			ksort($object_vars);
37
+			$valuelistObject->pairs = (object) $object_vars;
38 38
 
39
-            return $valuelistObject;
40
-        } else {
41
-            throw new \Exception('Trying to create valuelist with invalid data.');
42
-        }
43
-    }
39
+			return $valuelistObject;
40
+		} else {
41
+			throw new \Exception('Trying to create valuelist with invalid data.');
42
+		}
43
+	}
44 44
 
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/library/components/cms/DocumentRouting.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -12,33 +12,33 @@  discard block
 block discarded – undo
12 12
 
13 13
 class DocumentRouting implements CmsRouting
14 14
 {
15
-    /**
16
-     * DocumentRouting constructor.
17
-     * @param $request
18
-     * @param $relativeCmsUri
19
-     * @param CmsComponent $cmsComponent
20
-     */
21
-    public function __construct($request, $relativeCmsUri, $cmsComponent)
22
-    {
23
-        if ($relativeCmsUri == '/documents') {
24
-            $cmsComponent->subTemplate = 'cms/documents';
25
-            $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENTS, $cmsComponent->storage->getDocuments()->getDocumentsWithState());
26
-            $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
27
-        }
28
-        $this->documentRouting($request, $relativeCmsUri, $cmsComponent);
29
-        $this->folderRouting($request, $relativeCmsUri, $cmsComponent);
15
+	/**
16
+	 * DocumentRouting constructor.
17
+	 * @param $request
18
+	 * @param $relativeCmsUri
19
+	 * @param CmsComponent $cmsComponent
20
+	 */
21
+	public function __construct($request, $relativeCmsUri, $cmsComponent)
22
+	{
23
+		if ($relativeCmsUri == '/documents') {
24
+			$cmsComponent->subTemplate = 'cms/documents';
25
+			$cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENTS, $cmsComponent->storage->getDocuments()->getDocumentsWithState());
26
+			$cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS);
27
+		}
28
+		$this->documentRouting($request, $relativeCmsUri, $cmsComponent);
29
+		$this->folderRouting($request, $relativeCmsUri, $cmsComponent);
30 30
 		$this->valuelistsRouting($request, $relativeCmsUri, $cmsComponent);
31
-    }
31
+	}
32 32
 
33 33
 
34
-    /**
35
-     * @param $request
36
-     * @param $relativeCmsUri
37
-     * @param CmsComponent $cmsComponent
38
-     * @throws \Exception
39
-     */
40
-    private function documentRouting($request, $relativeCmsUri, $cmsComponent)
41
-    {
34
+	/**
35
+	 * @param $request
36
+	 * @param $relativeCmsUri
37
+	 * @param CmsComponent $cmsComponent
38
+	 * @throws \Exception
39
+	 */
40
+	private function documentRouting($request, $relativeCmsUri, $cmsComponent)
41
+	{
42 42
 		if ($relativeCmsUri == '/documents/new-document' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) {
43 43
 			$this->documentNewRoute($request, $cmsComponent);
44 44
 		} elseif (isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])){
@@ -50,23 +50,23 @@  discard block
 block discarded – undo
50 50
 				case '/documents/unpublish-document': $this->unpublishDocumentRoute($request, $cmsComponent); break;
51 51
 			}
52 52
 		}
53
-    }
53
+	}
54 54
 
55
-    /**
56
-     * @param $request
57
-     * @param $relativeCmsUri
58
-     * @param CmsComponent $cmsComponent
59
-     */
60
-    private function folderRouting($request, $relativeCmsUri, $cmsComponent)
61
-    {
62
-        if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) {
55
+	/**
56
+	 * @param $request
57
+	 * @param $relativeCmsUri
58
+	 * @param CmsComponent $cmsComponent
59
+	 */
60
+	private function folderRouting($request, $relativeCmsUri, $cmsComponent)
61
+	{
62
+		if ($relativeCmsUri == '/documents/new-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_PATH])) {
63 63
 			$this->newFolderRoute($request, $cmsComponent);
64
-        } else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
64
+		} else if ($relativeCmsUri == '/documents/edit-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
65 65
 			$this->editFolderRoute($request, $cmsComponent);
66
-        } else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
66
+		} else if ($relativeCmsUri == '/documents/delete-folder' && isset($request::$get[CmsComponent::GET_PARAMETER_SLUG])) {
67 67
 			$this->deleteFolderRoute($request, $cmsComponent);
68
-        }
69
-    }
68
+		}
69
+	}
70 70
 
71 71
 	private function valuelistsRouting($request, $relativeCmsUri, $cmsComponent)
72 72
 	{
Please login to merge, or discard this 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/NotFoundComponent.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
 
13 13
 class NotFoundComponent extends BaseComponent
14 14
 {
15
-    public function run(Storage $storage)
16
-    {
17
-        parent::run($storage);
18
-        header("HTTP/1.0 404 Not Found");
19
-    }
15
+	public function run(Storage $storage)
16
+	{
17
+		parent::run($storage);
18
+		header("HTTP/1.0 404 Not Found");
19
+	}
20 20
 
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.