Passed
Push — develop ( f5d3ab...1cfb3a )
by Jens
03:36
created
cloudcontrol/library/cc/cc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 {
38 38
 	$debug_backtrace = current(debug_backtrace());
39 39
 	if (PHP_SAPI == 'cli') {
40
-		echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n";
40
+		echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n";
41 41
 		foreach (func_get_args() as $data) {
42 42
 			var_dump($data);
43 43
 		}
44 44
 	} else {
45 45
 		ob_clean();
46
-		echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>";
46
+		echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>";
47 47
 		echo '<pre>';
48 48
 		foreach (func_get_args() as $data) {
49 49
 			echo "<code>";
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
  */
92 92
 function utf8Convert($array)
93 93
 {
94
-	array_walk_recursive($array, function(&$item){
95
-		if(!mb_detect_encoding($item, 'utf-8', true)){
94
+	array_walk_recursive($array, function(&$item) {
95
+		if (!mb_detect_encoding($item, 'utf-8', true)) {
96 96
 			$item = utf8_encode($item);
97 97
 		}
98 98
 	});
Please login to merge, or discard this patch.
cloudcontrol/library/cc/StringUtil.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	public static function slugify($str, $replace = array(), $delimiter = '-')
21 21
 	{
22 22
 		if (!empty($replace)) {
23
-			$str = str_replace((array)$replace, ' ', $str);
23
+			$str = str_replace((array) $replace, ' ', $str);
24 24
 		}
25 25
 
26 26
 		$clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 	public static function humanFileSize($size, $unit = "")
80 80
 	{
81 81
 		if ((!$unit && $size >= 1 << 30) || $unit == "GB")
82
-			return number_format($size / (1 << 30), 2) . "GB";
82
+			return number_format($size / (1 << 30), 2)."GB";
83 83
 		if ((!$unit && $size >= 1 << 20) || $unit == "MB")
84
-			return number_format($size / (1 << 20), 2) . "MB";
84
+			return number_format($size / (1 << 20), 2)."MB";
85 85
 		if ((!$unit && $size >= 1 << 10) || $unit == "KB")
86
-			return number_format($size / (1 << 10), 2) . "KB";
86
+			return number_format($size / (1 << 10), 2)."KB";
87 87
 
88
-		return number_format($size) . " bytes";
88
+		return number_format($size)." bytes";
89 89
 	}
90 90
 
91 91
 	/**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			if ($d >= 1) {
122 122
 				$r = round($d);
123 123
 
124
-				return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . ' ago';
124
+				return $r.' '.($r > 1 ? $a_plural[$str] : $str).' ago';
125 125
 			}
126 126
 		}
127 127
 
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/images/show.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,22 +10,22 @@
 block discarded – undo
10 10
 	<div class="show-image">
11 11
 		<label>File</label>
12 12
 		<div class="value">
13
-			<?=isset($image)? $image->file : '' ?>
13
+			<?=isset($image) ? $image->file : '' ?>
14 14
 		</div>
15 15
 		<label>Type</label>
16 16
 		<div class="value">
17
-			<?=isset($image)? $image->type : '' ?>
17
+			<?=isset($image) ? $image->type : '' ?>
18 18
 		</div>
19 19
 		<label>Size</label>
20 20
 		<div class="value">
21
-			<?=isset($image)? \library\cc\StringUtil::humanFileSize($image->size) : '' ?>
21
+			<?=isset($image) ? \library\cc\StringUtil::humanFileSize($image->size) : '' ?>
22 22
 		</div>
23 23
 		<label>Set</label>
24 24
 		<? if (isset($image)) : ?>
25 25
 			<? foreach ($image->set as $key => $set) : ?>
26 26
 				<div class="sets">
27 27
 					<label><?=$key?></label>
28
-					<img src="<?=\library\cc\Request::$subfolders . 'images/' . $set?>" />
28
+					<img src="<?=\library\cc\Request::$subfolders.'images/'.$set?>" />
29 29
 				</div>
30 30
 			<? endforeach ?>
31 31
 		<? endif ?>
Please login to merge, or discard this patch.
cloudcontrol/library/search/indexer/TermCount.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	protected function applyFilters($tokens)
47 47
 	{
48 48
 		foreach ($this->filters as $filterName) {
49
-			$filterClassName = '\library\search\filters\\' . $filterName;
49
+			$filterClassName = '\library\search\filters\\'.$filterName;
50 50
 			$filter = new $filterClassName($tokens);
51 51
 			$tokens = $filter->getFilterResults();
52 52
 		}
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		foreach ($documentTermCount as $field => $countArray) {
67 67
 			$quotedField = $db->quote($field);
68 68
 			foreach ($countArray as $term => $count) {
69
-				$values[] = $quotedDocumentPath . ', ' . $db->quote($term) . ', ' . $db->quote($count) . ', ' . $quotedField;
69
+				$values[] = $quotedDocumentPath.', '.$db->quote($term).', '.$db->quote($count).', '.$quotedField;
70 70
 				$i += 1;
71 71
 				if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) {
72 72
 					$this->executeStoreDocumentTermCount($values, $sql, $db);
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	protected function executeStoreDocumentTermCount($values, $sql, $db)
92 92
 	{
93
-		$sql .= '(' . implode('),' . PHP_EOL . '(', $values) . ');';
93
+		$sql .= '('.implode('),'.PHP_EOL.'(', $values).');';
94 94
 
95 95
 		$stmt = $db->prepare($sql);
96 96
 		if ($stmt === false || !$stmt->execute()) {
97 97
 			$errorInfo = $db->errorInfo();
98 98
 			$errorMsg = $errorInfo[2];
99
-			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
99
+			throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>');
100 100
 		}
101 101
 	}
102 102
 
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<script>window.onload=function(){History.init();History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders . $cmsPrefix?>/documents?path=/');};</script>
1
+<script>window.onload=function(){History.init();History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders.$cmsPrefix?>/documents?path=/');};</script>
2 2
 <section class="documents">
3 3
 	<h2><i class="fa fa-file-text-o"></i> Documents</h2>
4 4
 	<nav class="actions">
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
 			<? foreach ($documents as $document) : ?>
25 25
 				<li class="grid-container">
26 26
 					<? if ($document->type == 'document') : ?>
27
-						<?renderDocument($document, $cmsPrefix);?>
27
+						<?renderDocument($document, $cmsPrefix); ?>
28 28
 					<? elseif ($document->type == 'folder') : ?>
29
-						<?renderFolder($document, $cmsPrefix, '', true);?>
29
+						<?renderFolder($document, $cmsPrefix, '', true); ?>
30 30
 					<? endif ?>
31 31
 				</li>
32 32
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 <? function renderDocument($document, $cmsPrefix, $slugPrefix = '') {?>
38 38
 <div class="grid-box-10">
39 39
 	<h3>
40
-		<a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix . $document->slug?>" title="Edit">
40
+		<a class="btn documentTitle" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix.$document->slug?>" title="Edit">
41 41
 			<i class="fa fa-file-text-o"></i>
42 42
             <small class="state <?=strtolower($document->state)?>"><i class="fa <?=$document->state == 'published' ? 'fa-check-circle-o' : 'fa-times-circle-o' ?>"></i></small>
43 43
             <?=$document->title?>
@@ -56,36 +56,36 @@  discard block
 block discarded – undo
56 56
 </div>
57 57
 <div class="documentActions grid-box-2">
58 58
     <? if (strtolower($document->state) == 'unpublished' || $document->unpublishedChanges) : ?>
59
-        <a class="btn publish" title="Publish" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/publish-document?slug=<?=$slugPrefix . $document->slug?>"><i class="fa fa-check"></i></a>
59
+        <a class="btn publish" title="Publish" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/publish-document?slug=<?=$slugPrefix.$document->slug?>"><i class="fa fa-check"></i></a>
60 60
     <? endif ?>
61 61
     <? if (strtolower($document->state) == 'published') : ?>
62
-        <a class="btn unpublish" title="Unpublish" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/unpublish-document?slug=<?=$slugPrefix . $document->slug?>"><i class="fa fa-times"></i></a>
62
+        <a class="btn unpublish" title="Unpublish" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/unpublish-document?slug=<?=$slugPrefix.$document->slug?>"><i class="fa fa-times"></i></a>
63 63
     <? endif ?>
64
-	<a class="btn" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix . $document->slug?>" title="Edit"><i class="fa fa-pencil"></i></a>
64
+	<a class="btn" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-document?slug=<?=$slugPrefix.$document->slug?>" title="Edit"><i class="fa fa-pencil"></i></a>
65 65
 	<? if (strtolower($document->state) == 'unpublished') : ?>
66
-	<a onclick="return confirm('Are you sure you want to delete this item?');" class="btn error" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/delete-document?slug=<?=$slugPrefix . $document->slug?>" title="Delete"><i class="fa fa-trash"></i></a>
66
+	<a onclick="return confirm('Are you sure you want to delete this item?');" class="btn error" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/delete-document?slug=<?=$slugPrefix.$document->slug?>" title="Delete"><i class="fa fa-trash"></i></a>
67 67
     <? endif ?>
68 68
 </div>
69 69
 <?}?>
70
-<? function renderFolder($document, $cmsPrefix, $slugPrefix ='', $root = false) {?>
70
+<? function renderFolder($document, $cmsPrefix, $slugPrefix = '', $root = false) {?>
71 71
 <div class="grid-box-8">
72 72
 	<h3>
73
-		<a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix . $document->slug?>" title="Open">
73
+		<a class="btn documentTitle openFolder" data-slug="<?=$slugPrefix.$document->slug?>" title="Open">
74 74
 			<i class="fa fa-folder-o "></i> <?=$document->title?>
75 75
 		</a>
76 76
 	</h3>
77 77
 </div>
78 78
 <div class="documentActions grid-box-4">
79
-	<a class="btn" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-folder?slug=<?=$slugPrefix . $document->slug?>" title="Edit"><i class="fa fa-pencil"></i></a>
80
-	<a onclick="return confirm('Are you sure you want to delete this item?');" class="btn error" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/delete-folder?slug=<?=$slugPrefix . $document->slug?>" title="Delete"><i class="fa fa-trash"></i></a>
79
+	<a class="btn" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/edit-folder?slug=<?=$slugPrefix.$document->slug?>" title="Edit"><i class="fa fa-pencil"></i></a>
80
+	<a onclick="return confirm('Are you sure you want to delete this item?');" class="btn error" href="<?=\library\cc\Request::$subfolders?><?=$cmsPrefix?>/documents/delete-folder?slug=<?=$slugPrefix.$document->slug?>" title="Delete"><i class="fa fa-trash"></i></a>
81 81
 </div>
82 82
 <ul class="documents grid-wrapper nested<?=$root ? ' root' : '' ?>">
83 83
 	<? foreach ($document->content as $subDocument) : ?>
84 84
 		<li class="grid-container">
85 85
 			<? if ($subDocument->type == 'document') : ?>
86
-				<?renderDocument($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?>
86
+				<?renderDocument($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?>
87 87
 			<? elseif ($subDocument->type == 'folder') : ?>
88
-				<?renderFolder($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/');?>
88
+				<?renderFolder($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/'); ?>
89 89
 			<? endif ?>
90 90
 		</li>
91 91
 	<? endforeach ?>
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents/brick.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 block discarded – undo
3 3
 	<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
4 4
 </div>
5 5
 <?if ($static == true) {
6
-	$fieldPrefix = 'bricks[' . $myBrickSlug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . '][fields]';
6
+	$fieldPrefix = 'bricks['.$myBrickSlug.']['.str_replace('.', '', str_replace(' ', '', microtime())).'][fields]';
7 7
 } else {
8
-	$fieldPrefix = 'dynamicBricks[' . $brick->slug . '][' . str_replace('.', '', str_replace(' ', '', microtime())) . ']';
8
+	$fieldPrefix = 'dynamicBricks['.$brick->slug.']['.str_replace('.', '', str_replace(' ', '', microtime())).']';
9 9
 }?>
10 10
 <? foreach ($brick->fields as $field) : ?>
11 11
 			<div class="form-element">
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 							<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
31 31
 							<div class="form-element">
32 32
 				<? endif ?>
33
-					<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
33
+					<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
34 34
 				<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
35 35
 
36 36
 							</div>
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 						<li class="grid-container">
53 53
 							<div class="grid-box-10">
54 54
 								<div class="grid-inner form-element">
55
-									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
55
+									<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
56 56
 								</div>
57 57
 							</div>
58 58
 							<div class="grid-box-2">
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 								</div>
63 63
 							</div>
64 64
 						</li>
65
-						<?$value='';?>
65
+						<?$value = ''; ?>
66 66
 						<? endforeach ?>
67 67
 					<? endif ?>
68 68
 				</ul>
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
 							<a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a>
80 80
 							<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
81 81
 							<div class="form-element">
82
-							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
82
+							<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
83 83
 							</div>
84 84
 						</li>
85
-						<?$value='';?>
85
+						<?$value = ''; ?>
86 86
 					<? endforeach ?>
87 87
 					<? endif ?>
88 88
 					</div>
@@ -91,5 +91,5 @@  discard block
 block discarded – undo
91 91
 				<a class="btn js-addrtemultiple">+</a>
92 92
 				<? endif ?>
93 93
 			</div>
94
-			<?$value='';?>
94
+			<?$value = ''; ?>
95 95
 		<? endforeach ?>
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents/document-form-form.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?=isset($formId) ? '#' . $formId : '' ?>">
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 4
     <? else : ?>
@@ -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>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 								<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
42 42
 								<div class="form-element">
43 43
 					<? endif ?>
44
-						<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
44
+						<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
45 45
 					<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
46 46
 
47 47
 								</div>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 							<li class="grid-container">
64 64
 								<div class="grid-box-10">
65 65
 									<div class="grid-inner form-element">
66
-										<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
66
+										<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
67 67
 									</div>
68 68
 								</div>
69 69
 								<div class="grid-box-2">
@@ -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>
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 								<a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a>
91 91
 								<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
92 92
 								<div class="form-element">
93
-								<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
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) : ?>
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 									<li class="brick form-element">
127 127
 										<label><?=$brick->title?></label>
128 128
 										<?$static = true; ?>
129
-										<?include(__DIR__ . '/brick.php')?>
129
+										<?include(__DIR__.'/brick.php')?>
130 130
 									</li>
131 131
 									<? endif ?>
132 132
 								<? endforeach ?>
@@ -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">
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
163 163
 									<div class="form-element">
164 164
 						<? endif ?>
165
-							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
165
+							<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
166 166
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
167 167
 
168 168
 									</div>
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 								<li class="grid-container">
186 186
 									<div class="grid-box-10">
187 187
 										<div class="grid-inner form-element">
188
-											<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
188
+											<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
189 189
 										</div>
190 190
 									</div>
191 191
 									<div class="grid-box-2">
@@ -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>
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
 									<a class="btn error js-deletemultiple"><i class="fa fa-trash"></i></a>
214 214
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
215 215
 									<div class="form-element">
216
-									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
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
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 						<li class="brick form-element">
254 254
 							<label><?=$brick->title?></label>
255 255
 							<?$static = false; ?>
256
-							<?include(__DIR__ . '/brick.php')?>
256
+							<?include(__DIR__.'/brick.php')?>
257 257
 						</li>
258 258
 					<? endforeach ?>
259 259
 				<? endif ?>
Please login to merge, or discard this patch.
cloudcontrol/library/storage/storage/DocumentStorage.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	public function getDocuments($state = 'published')
22 22
 	{
23 23
 		if (!in_array($state, Document::$DOCUMENT_STATES)) {
24
-			throw new \Exception('Unsupported document state: ' . $state);
24
+			throw new \Exception('Unsupported document state: '.$state);
25 25
 		}
26 26
 		return $this->repository->getDocuments($state);
27 27
 	}
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 	public function getDocumentBySlug($slug, $state = 'published')
51 51
 	{
52 52
 		if (!in_array($state, Document::$DOCUMENT_STATES)) {
53
-			throw new \Exception('Unsupported document state: ' . $state);
53
+			throw new \Exception('Unsupported document state: '.$state);
54 54
 		}
55
-		$path = '/' . $slug;
55
+		$path = '/'.$slug;
56 56
 
57 57
 		return $this->repository->getDocumentByPath($path, $state);
58 58
 	}
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 	public function saveDocument($postValues, $state = 'unpublished')
67 67
 	{
68 68
 		if (!in_array($state, Document::$DOCUMENT_STATES)) {
69
-			throw new \Exception('Unsupported document state: ' . $state);
69
+			throw new \Exception('Unsupported document state: '.$state);
70 70
 		}
71
-		$oldPath = '/' . $postValues['path'];
71
+		$oldPath = '/'.$postValues['path'];
72 72
 
73 73
 		$container = $this->getDocumentContainerByPath($oldPath);
74 74
 		$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, new DocumentTypesStorage($this->repository));
75 75
 		if ($container->path === '/') {
76
-			$newPath = $container->path . $documentObject->slug;
76
+			$newPath = $container->path.$documentObject->slug;
77 77
 		} else {
78
-			$newPath = $container->path . '/' . $documentObject->slug;
78
+			$newPath = $container->path.'/'.$documentObject->slug;
79 79
 		}
80 80
 		$documentObject->path = $newPath;
81 81
 		$this->repository->saveDocument($documentObject, $state);
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 	{
90 90
 		$documentObject = DocumentFactory::createDocumentFromPostValues($postValues, new DocumentTypesStorage($this->repository));
91 91
 		if ($postValues['path'] === '/') {
92
-			$documentObject->path = $postValues['path'] . $documentObject->slug;
92
+			$documentObject->path = $postValues['path'].$documentObject->slug;
93 93
 		} else {
94
-			$documentObject->path = $postValues['path'] . '/' . $documentObject->slug;
94
+			$documentObject->path = $postValues['path'].'/'.$documentObject->slug;
95 95
 		}
96 96
 
97 97
 		$this->repository->saveDocument($documentObject, $state);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function deleteDocumentBySlug($slug)
104 104
 	{
105
-		$path = '/' . $slug;
105
+		$path = '/'.$slug;
106 106
 		$this->repository->deleteDocumentByPath($path);
107 107
 	}
108 108
 
Please login to merge, or discard this patch.
cloudcontrol/library/storage/Document.php 1 patch
Spacing   +9 added lines, -9 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();
@@ -87,20 +87,20 @@  discard block
 block discarded – undo
87 87
     	$docs = $this->documentStorage->getDocumentsWithState($this->path);
88 88
     	return $docs;
89 89
     	//dump($this->path, $docs);
90
-        $folderPathWithWildcard = $this->path . '%';
90
+        $folderPathWithWildcard = $this->path.'%';
91 91
         $sql = '    SELECT *
92 92
                       FROM documents_published
93
-                     WHERE `path` LIKE ' . $this->dbHandle->quote($folderPathWithWildcard) . '
94
-                       AND substr(`path`, ' . (strlen($this->path) + 2) . ') NOT LIKE "%/%"
95
-                       AND substr(`path`, ' . (strlen($this->path) + 1) . ', 1) = "/"
96
-                       AND path != ' . $this->dbHandle->quote($this->path) . '
97
-                  ORDER BY ' . (in_array($orderBy, $this->orderableFields) ? $orderBy : 'title') . ' ' . ($order === 'ASC' ? 'ASC' : 'DESC') . '
93
+                     WHERE `path` LIKE ' . $this->dbHandle->quote($folderPathWithWildcard).'
94
+                       AND substr(`path`, ' . (strlen($this->path) + 2).') NOT LIKE "%/%"
95
+                       AND substr(`path`, ' . (strlen($this->path) + 1).', 1) = "/"
96
+                       AND path != ' . $this->dbHandle->quote($this->path).'
97
+                  ORDER BY ' . (in_array($orderBy, $this->orderableFields) ? $orderBy : 'title').' '.($order === 'ASC' ? 'ASC' : 'DESC').'
98 98
                     ';
99 99
         $stmt = $this->dbHandle->prepare($sql);
100 100
 		if ($stmt === false) {
101 101
 			$errorInfo = $this->dbHandle->errorInfo();
102 102
 			$errorMsg = $errorInfo[2];
103
-			throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>');
103
+			throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>');
104 104
 		}
105 105
         $stmt->bindColumn(':orderBy', $orderBy, \PDO::PARAM_STMT);
106 106
 		$stmt->execute();
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function __toString()
122 122
 	{
123
-		return 'Document:' . $this->title;
123
+		return 'Document:'.$this->title;
124 124
 	}
125 125
 
126 126
 
Please login to merge, or discard this patch.