Passed
Push — develop ( dfac37...8d12b8 )
by Jens
02:54
created
cloudcontrol/templates/cms/documents/document-form.php 2 patches
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.
Spacing   +20 added lines, -20 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,17 +123,17 @@  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
-			<? $static_brick_nr = 0;?>
129
+			<? $static_brick_nr = 0; ?>
130 130
 			<? foreach ($documentType->bricks as $brick) : ?>
131 131
 			<div class="brick">
132 132
 				<label><?=$brick->title?></label>
133 133
 				<? if ($brick->multiple == 'true') : ?>
134 134
 					<input type="hidden" value="<?=$brick->brickSlug?>"/>
135 135
 					<input type="hidden" value="<?=$brick->slug?>"/>
136
-					<?$myBrickSlug=$brick->slug;?>
136
+					<?$myBrickSlug = $brick->slug; ?>
137 137
 					<ul id="newBrickDropzone_<?=$static_brick_nr?>" class="dynamicBricks sortable">
138 138
 						<? if (isset($document)) : ?>
139 139
 							<? foreach ($document->bricks as $currentBrickSlug => $brickArray) : ?>
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 									<li class="brick form-element">
148 148
 										<label><?=$brick->title?></label>
149 149
 										<?$static = true; ?>
150
-										<?include(__DIR__ . '/brick.php')?>
150
+										<?include(__DIR__.'/brick.php')?>
151 151
 									</li>
152 152
 									<? endif ?>
153 153
 								<? endforeach ?>
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 					<a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a>
158 158
 					<?$static_brick_nr += 1?>
159 159
 				<? else : ?>
160
-					<?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?>
160
+					<?$fieldPrefix = 'bricks['.$brick->slug.'][fields]'; ?>
161 161
 					<input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" />
162 162
 					<? foreach ($brick->structure->fields as $field) : ?>
163 163
 						<div class="form-element">
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
184 184
 									<div class="form-element">
185 185
 						<? endif ?>
186
-							<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
186
+							<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
187 187
 						<? if ($field->multiple == true && $field->type != 'Rich Text') : ?>
188 188
 
189 189
 									</div>
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 								<li class="grid-container">
207 207
 									<div class="grid-box-10">
208 208
 										<div class="grid-inner form-element">
209
-											<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
209
+											<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
210 210
 										</div>
211 211
 									</div>
212 212
 									<div class="grid-box-2">
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 										</div>
217 217
 									</div>
218 218
 								</li>
219
-								<?$value='';?>
219
+								<?$value = ''; ?>
220 220
 								<? endforeach ?>
221 221
 							<? endif ?>
222 222
 						</ul>
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
 									<a class="btn error js-deletemultiple"><i class="fa fa-times"></i></a>
235 235
 									<a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a>
236 236
 									<div class="form-element">
237
-									<? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?>
237
+									<? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?>
238 238
 									</div>
239 239
 								</li>
240
-								<?$value='';?>
240
+								<?$value = ''; ?>
241 241
 							<? endforeach ?>
242 242
 							<? endif ?>
243 243
 							</div>
@@ -246,12 +246,12 @@  discard block
 block discarded – undo
246 246
 						<a class="btn js-addrtemultiple">+</a>
247 247
 						<? endif ?>
248 248
 					</div>
249
-					<?$value='';?>
249
+					<?$value = ''; ?>
250 250
 				<? endforeach ?>
251 251
 				<? endif ?>
252 252
 				</div>
253 253
 				<hr />
254
-			<? endforeach;?>
254
+			<? endforeach; ?>
255 255
 
256 256
 
257 257
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 						<li class="brick form-element">
275 275
 							<label><?=$brick->title?></label>
276 276
 							<?$static = false; ?>
277
-							<?include(__DIR__ . '/brick.php')?>
277
+							<?include(__DIR__.'/brick.php')?>
278 278
 						</li>
279 279
 					<? endforeach ?>
280 280
 				<? endif ?>
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.
cloudcontrol/library/components/BaseComponent.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		 * @param array   $parameters
41 41
 		 * @param         $matchedSitemapItem
42 42
 		 */
43
-		public function __construct($template='', Request $request, $parameters=array(), $matchedSitemapItem)
43
+		public function __construct($template = '', Request $request, $parameters = array(), $matchedSitemapItem)
44 44
 		{
45 45
 			$this->template = $template;
46 46
 			$this->request = $request;
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 		 * @return string
88 88
 		 * @throws \Exception
89 89
 		 */
90
-		public function renderTemplate($template='', $obClean = true)
90
+		public function renderTemplate($template = '', $obClean = true)
91 91
 		{
92
-			$templatePath = __DIR__ . '/../../templates/' . $template . '.php';
92
+			$templatePath = __DIR__.'/../../templates/'.$template.'.php';
93 93
 			if (realpath($templatePath) !== false) {
94 94
 				if ($obClean) {
95 95
 					ob_clean();
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 				include($templatePath);
100 100
 				return ob_get_contents();
101 101
 			} else {
102
-				throw new \Exception('Couldnt find template ' . $templatePath);
102
+				throw new \Exception('Couldnt find template '.$templatePath);
103 103
 			}
104 104
 		}
105 105
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 		 * @return string
114 114
 		 * @throws \Exception
115 115
 		 */
116
-		public function includeTemplate($template='', $parameters = array())
116
+		public function includeTemplate($template = '', $parameters = array())
117 117
 		{
118 118
 			if (is_array($parameters)) {
119 119
 				foreach ($parameters as $name => $value) {
Please login to merge, or discard this patch.