Passed
Push — develop ( fc288c...e8c947 )
by Jens
02:51
created
cloudcontrol/library/images/ImageResizer.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 				}
48 48
 				return $returnFileNames;
49 49
 			} else {
50
-				throw new \Exception('Image doesnt exist: ' . $imagePath);
50
+				throw new \Exception('Image doesnt exist: '.$imagePath);
51 51
 			}
52 52
 		}
53 53
 
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 		 * @return string
59 59
 		 * @throws \Exception
60 60
 		 */
61
-		public function resize($imagePath='', $width='',$height='')
61
+		public function resize($imagePath = '', $width = '', $height = '')
62 62
 		{
63
-			$modifier = '-r' . $width . 'x' . $height;
63
+			$modifier = '-r'.$width.'x'.$height;
64 64
 			$destination = $this->modifyName($imagePath, $modifier);
65 65
 			if (file_exists($imagePath)) {
66 66
 				$image = new Image();
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 				$resizedImage->SaveImage($destination, $resizedImage->GetImageMimeType($imagePath), 80);
75 75
 				return basename($destination);
76 76
 			} else {
77
-				throw new \Exception('Image doesnt exist: ' . $imagePath);
77
+				throw new \Exception('Image doesnt exist: '.$imagePath);
78 78
 			}
79 79
 		}
80 80
 
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 		 * @return string
86 86
 		 * @throws \Exception
87 87
 		 */
88
-		public function smartcrop($imagePath='', $width='',$height='')
88
+		public function smartcrop($imagePath = '', $width = '', $height = '')
89 89
 		{
90
-			$modifier = '-s' . $width . 'x' . $height;
90
+			$modifier = '-s'.$width.'x'.$height;
91 91
 			$destination = $this->modifyName($imagePath, $modifier);
92 92
 			if (file_exists($imagePath)) {
93 93
 				$image = new Image();
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 				$resizedImage->SaveImage($destination, $resizedImage->GetImageMimeType($imagePath), 80);
102 102
 				return basename($destination);
103 103
 			} else {
104
-				throw new \Exception('Image doesnt exist: ' . $imagePath);
104
+				throw new \Exception('Image doesnt exist: '.$imagePath);
105 105
 			}
106 106
 		}
107 107
 
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 		 * @return string
113 113
 		 * @throws \Exception
114 114
 		 */
115
-		public function boxcrop($imagePath='', $width='',$height='')
115
+		public function boxcrop($imagePath = '', $width = '', $height = '')
116 116
 		{
117
-			$modifier = '-b' . $width . 'x' . $height;
117
+			$modifier = '-b'.$width.'x'.$height;
118 118
 			$destination = $this->modifyName($imagePath, $modifier);
119 119
 			if (file_exists($imagePath)) {
120 120
 				$image = new Image();
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				$resizedImage->SaveImage($destination, $resizedImage->GetImageMimeType($imagePath), 80);
129 129
 				return basename($destination);
130 130
 			} else {
131
-				throw new \Exception('Image doesnt exist: ' . $imagePath);
131
+				throw new \Exception('Image doesnt exist: '.$imagePath);
132 132
 			}
133 133
 		}
134 134
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		 *
139 139
 		 * @return string
140 140
 		 */
141
-		private function modifyName($imagePath, $modifier='')
141
+		private function modifyName($imagePath, $modifier = '')
142 142
 		{
143 143
 			$filename = basename($imagePath);
144 144
 			$path = dirname($imagePath);
@@ -148,25 +148,25 @@  discard block
 block discarded – undo
148 148
 				array_pop($fileParts);
149 149
 				$fileNameWithoutExtension = implode('-', $fileParts);
150 150
 				$fileNameWithoutExtension = slugify($fileNameWithoutExtension);
151
-				$filename = $fileNameWithoutExtension . $modifier  . '.' . $extension;
151
+				$filename = $fileNameWithoutExtension.$modifier.'.'.$extension;
152 152
 			} else {
153 153
 				$filename = slugify($filename);
154 154
 			}
155 155
 
156
-			if (file_exists($path . '/' . $filename)) {
156
+			if (file_exists($path.'/'.$filename)) {
157 157
 				$fileParts = explode('.', $filename);
158 158
 				if (count($fileParts) > 1) {
159 159
 					$extension = end($fileParts);
160 160
 					array_pop($fileParts);
161 161
 					$fileNameWithoutExtension = implode('-', $fileParts);
162 162
 					$fileNameWithoutExtension .= '-copy';
163
-					$filename = $fileNameWithoutExtension . '.' . $extension;
163
+					$filename = $fileNameWithoutExtension.'.'.$extension;
164 164
 				} else {
165 165
 					$filename .= '-copy';
166 166
 				}
167
-				return $this->modifyName($path . '/' . $filename);
167
+				return $this->modifyName($path.'/'.$filename);
168 168
 			}
169
-			return $path . '/' . $filename;
169
+			return $path.'/'.$filename;
170 170
 		}
171 171
 	}
172 172
 }
173 173
\ No newline at end of file
Please login to merge, or discard this patch.
cloudcontrol/templates/cms/documents/document-form.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.1/js/bootstrap.min.js"></script>
4 4
 <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
5 5
 <script>var smallestImage = '<?=$smallestImage?>';</script>
6
-<?$copyable=''?>
6
+<?$copyable = ''?>
7 7
 <section class="documents">
8 8
 	<h2><i class="fa fa-file-text-o"></i> Documents</h2>
9 9
 	<nav class="actions">
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 				<label for="state">Published</label>
39 39
 				<input<?=isset($document) && $document->state == 'published' ? ' checked="checked"' : '' ?> type="checkbox" id="state" name="state" placeholder="State" />
40 40
 			</div>
41
-			<?$fieldPrefix='fields';?>
41
+			<?$fieldPrefix = 'fields'; ?>
42 42
 			<? foreach ($documentType->fields as $field) : ?>
43 43
 				<div class="form-element">
44 44
 					<label for="<?=$field->slug?>"><?=$field->title?></label>
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 								<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
63 63
 								<div class="form-element">
64 64
 					<? endif ?>
65
-						<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
65
+						<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
66 66
 					<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
67 67
 
68 68
 								</div>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 							<li class="grid-container">
85 85
 								<div class="grid-box-10">
86 86
 									<div class="grid-inner form-element">
87
-										<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
87
+										<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
88 88
 									</div>
89 89
 								</div>
90 90
 								<div class="grid-box-2">
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 									</div>
95 95
 								</div>
96 96
 							</li>
97
-							<?$value='';?>
97
+							<?$value = ''; ?>
98 98
 							<? endforeach ?>
99 99
 						<? endif ?>
100 100
 					</ul>
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
 								<a class="btn error js-deletemultiple"><i class="fa fa-times"></i></a>
112 112
 								<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
113 113
 								<div class="form-element">
114
-								<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
114
+								<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
115 115
 								</div>
116 116
 							</li>
117
-							<?$value='';?>
117
+							<?$value = ''; ?>
118 118
 						<? endforeach ?>
119 119
 						<? endif ?>
120 120
 						</div>
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 					<a class="btn js-addrtemultiple">+</a>
124 124
 					<? endif ?>
125 125
 				</div>
126
-				<?$value='';?>
126
+				<?$value = ''; ?>
127 127
 			<? endforeach ?>
128 128
 			<hr />
129 129
 			<? foreach ($documentType->bricks as $brick) : ?>
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 				<? if ($brick->multiple == 'true') : ?>
133 133
 					<input type="hidden" value="<?=$brick->brickSlug?>"/>
134 134
 					<input type="hidden" value="<?=$brick->slug?>"/>
135
-					<?$myBrickSlug=$brick->slug;?>
135
+					<?$myBrickSlug = $brick->slug; ?>
136 136
 					<ul id="newBrickDropzone" class="dynamicBricks sortable">
137 137
 						<? if (isset($document)) : ?>
138 138
 							<? foreach ($document->bricks as $brickArray) : ?>
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 									<li class="brick form-element">
146 146
 										<label><?=$brick->title?></label>
147 147
 										<?$static = true; ?>
148
-										<?include(__DIR__ . '/brick.php')?>
148
+										<?include(__DIR__.'/brick.php')?>
149 149
 									</li>
150 150
 								<? endforeach ?>
151 151
 							<? endforeach ?>
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 					</ul>
154 154
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone');">+</a>
155 155
 				<? else : ?>
156
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
156
+					<?$fieldPrefix = 'bricks['.$brick->slug.'][fields]'; ?>
157 157
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
158 158
 					<? foreach ($brick->structure->fields as $field) : ?>
159 159
 						<div class="form-element">
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
180 180
 									<div class="form-element">
181 181
 						<? endif ?>
182
-							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
182
+							<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
183 183
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
184 184
 
185 185
 									</div>
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 								<li class="grid-container">
203 203
 									<div class="grid-box-10">
204 204
 										<div class="grid-inner form-element">
205
-											<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
205
+											<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
206 206
 										</div>
207 207
 									</div>
208 208
 									<div class="grid-box-2">
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 										</div>
213 213
 									</div>
214 214
 								</li>
215
-								<?$value='';?>
215
+								<?$value = ''; ?>
216 216
 								<? endforeach ?>
217 217
 							<? endif ?>
218 218
 						</ul>
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 									<a class="btn error js-deletemultiple"><i class="fa fa-times"></i></a>
231 231
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
232 232
 									<div class="form-element">
233
-									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
233
+									<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
234 234
 									</div>
235 235
 								</li>
236
-								<?$value='';?>
236
+								<?$value = ''; ?>
237 237
 							<? endforeach ?>
238 238
 							<? endif ?>
239 239
 							</div>
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
 						<a class="btn js-addrtemultiple">+</a>
243 243
 						<? endif ?>
244 244
 					</div>
245
-					<?$value='';?>
245
+					<?$value = ''; ?>
246 246
 				<? endforeach ?>
247 247
 				<? endif ?>
248 248
 				</div>
249 249
 				<hr />
250
-			<? endforeach;?>
250
+			<? endforeach; ?>
251 251
 
252 252
 
253 253
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 						<li class="brick form-element">
271 271
 							<label><?=$brick->title?></label>
272 272
 							<?$static = false; ?>
273
-							<?include(__DIR__ . '/brick.php')?>
273
+							<?include(__DIR__.'/brick.php')?>
274 274
 						</li>
275 275
 					<? endforeach ?>
276 276
 				<? endif ?>
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,8 +45,10 @@  discard block
 block discarded – undo
45 45
 					<? if (isset($document)) :
46 46
 						$fieldSlug = $field->slug;
47 47
 						$value = isset($document->fields->$fieldSlug) ? current($document->fields->$fieldSlug) : '';
48
-					else :
48
+					else {
49
+						:
49 50
 						$value = '';
51
+					}
50 52
 					endif ?>
51 53
 					<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
52 54
 					<ul class="grid-wrapper sortable">
@@ -152,8 +154,11 @@  discard block
 block discarded – undo
152 154
 						<? endif ?>
153 155
 					</ul>
154 156
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone');">+</a>
155
-				<? else : ?>
156
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
157
+				<? else {
158
+	: ?>
159
+					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';
160
+}
161
+?>
157 162
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
158 163
 					<? foreach ($brick->structure->fields as $field) : ?>
159 164
 						<div class="form-element">
@@ -162,8 +167,10 @@  discard block
 block discarded – undo
162 167
 							$brickSlug = $brick->slug;
163 168
 							$fieldSlug = $field->slug;
164 169
 							$value = isset($document->bricks->$brickSlug->fields->$fieldSlug) ? current($document->bricks->$brickSlug->fields->$fieldSlug) : '';
165
-						else :
170
+						else {
171
+							:
166 172
 							$value = '';
173
+						}
167 174
 						endif ?>
168 175
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
169 176
 						<ul class="grid-wrapper sortable">
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]]
@@ -29,4 +29,4 @@  discard block
 block discarded – undo
29 29
 if (!isset($GLOBALS['rteList'])) {
30 30
 	$GLOBALS['rteList'] = array();
31 31
 }
32
-$GLOBALS['rteList'][] = 'summernote_' . str_replace(']', '-', str_replace('[','-', $fieldPrefix)) . $field->slug . '_rte_' . $summernoteInstances ?>
32
+$GLOBALS['rteList'][] = 'summernote_'.str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug.'_rte_'.$summernoteInstances ?>
Please login to merge, or discard this patch.
cloudcontrol/library/components/DocumentComponent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 				if (isset($this->parameters['document'])) {
21 21
 					$this->parameters['document'] = $storage->getDocumentBySlug($this->parameters['document']);
22 22
 				} else {
23
-					throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: ' . $this->matchedSitemapItem->title);
23
+					throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: '.$this->matchedSitemapItem->title);
24 24
 				}
25 25
 			} else {
26 26
 				if (isset($this->parameters['document'])) {
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 					$relativeDocumentUri = current($this->matchedSitemapItem->matches[1]);
30 30
 					if (isset($this->parameters['folder'])) {
31 31
 						if (substr($this->parameters['folder'], -1) !== '/') {
32
-							$this->parameters['folder'] = $this->parameters['folder'] . '/';
32
+							$this->parameters['folder'] = $this->parameters['folder'].'/';
33 33
 						}
34
-						$relativeDocumentUri = $this->parameters['folder'] . $relativeDocumentUri;
34
+						$relativeDocumentUri = $this->parameters['folder'].$relativeDocumentUri;
35 35
 					}
36 36
 
37 37
 					$document = $storage->getDocumentBySlug($relativeDocumentUri);
Please login to merge, or discard this patch.