Passed
Push — develop ( a5e1bf...c22bc5 )
by Jens
02:34
created
src/templates/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
 
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.
src/templates/documents/fieldTypes/Image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
   <div class="grid-container">
3 3
     <div class="grid-box-2">
4 4
       <div class="grid-inner">
5
-        <div<?= isset($value) ? ' style="background-image:url(\'' . $request::$subfolders . 'images/' . $value . '\');"' : '' ?> class="selected-image" id="<?= $field->slug ?>_selectedImage"></div>
5
+        <div<?= isset($value) ? ' style="background-image:url(\''.$request::$subfolders.'images/'.$value.'\');"' : '' ?> class="selected-image" id="<?= $field->slug ?>_selectedImage"></div>
6 6
       </div>
7 7
     </div>
8 8
     <div class="grid-box-10">
Please login to merge, or discard this patch.
src/templates/documents/fieldTypes/Rich-Text.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 }
7 7
 ?>
8 8
 <div class="rte">
9
-  <div id="summernote_<?= str_replace(']', '-', str_replace('[', '-', $fieldPrefix)) . $field->slug ?>_rte_<?= $summernoteInstances ?>" class="summernote"><?= isset($value) ? $value : '' ?></div>
9
+  <div id="summernote_<?= str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug ?>_rte_<?= $summernoteInstances ?>" class="summernote"><?= isset($value) ? $value : '' ?></div>
10 10
 </div>
11 11
 <textarea style="display:none;" id="summernote_<?= $field->slug ?>_container_<?= $summernoteInstances ?>" name="<?= $fieldPrefix ?>[<?= $field->slug ?>][]"></textarea>
12 12
 <script>
13 13
   $(document).ready(function () {
14
-    $('#summernote_<?=str_replace(']', '-', str_replace('[', '-', $fieldPrefix)) . $field->slug?>_rte_<?=$summernoteInstances?>').summernote({
14
+    $('#summernote_<?=str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug?>_rte_<?=$summernoteInstances?>').summernote({
15 15
       height: 300,
16 16
       toolbar: [
17 17
         /*[groupname, [button list]]*/
@@ -28,4 +28,4 @@  discard block
 block discarded – undo
28 28
 if (!isset($GLOBALS['rteList'])) {
29 29
     $GLOBALS['rteList'] = array();
30 30
 }
31
-$GLOBALS['rteList'][] = 'summernote_' . str_replace(']', '-', str_replace('[', '-', $fieldPrefix)) . $field->slug . '_rte_' . $summernoteInstances ?>
31
+$GLOBALS['rteList'][] = 'summernote_'.str_replace(']', '-', str_replace('[', '-', $fieldPrefix)).$field->slug.'_rte_'.$summernoteInstances ?>
Please login to merge, or discard this patch.
src/templates/documents/function.renderFolder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 { ?>
11 11
   <div class="grid-box-8">
12 12
     <h3>
13
-      <a class="btn documentTitle openFolder" data-slug="<?= $slugPrefix . $document->slug ?>" title="Open">
13
+      <a class="btn documentTitle openFolder" data-slug="<?= $slugPrefix.$document->slug ?>" title="Open">
14 14
         <i class="fa fa-folder-o "></i> <?= $document->title ?>
15 15
       </a>
16 16
     </h3>
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
   <div class="documentActions grid-box-4">
19 19
       <? renderAction('Edit',
20 20
           '',
21
-          $request::$subfolders . $cmsPrefix . '/documents/edit-folder?slug=' . $slugPrefix . $document->slug,
21
+          $request::$subfolders.$cmsPrefix.'/documents/edit-folder?slug='.$slugPrefix.$document->slug,
22 22
           'pencil'); ?>
23 23
       <? renderAction('Delete',
24 24
           'error',
25
-          $request::$subfolders . $cmsPrefix . '/documents/delete-folder?slug=' . $slugPrefix . $document->slug,
25
+          $request::$subfolders.$cmsPrefix.'/documents/delete-folder?slug='.$slugPrefix.$document->slug,
26 26
           'trash',
27 27
           'return confirm(\'Are you sure you want to delete this document?\');'); ?>
28 28
   </div>
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
       <? foreach ($document->getContent() as $subDocument) : ?>
31 31
         <li class="grid-container">
32 32
             <? if ($subDocument->type == 'document') : ?>
33
-                <? renderDocument($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/', $request); ?>
33
+                <? renderDocument($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/', $request); ?>
34 34
             <? elseif ($subDocument->type == 'folder') : ?>
35
-                <? renderFolder($subDocument, $cmsPrefix, $slugPrefix . $document->slug . '/', false, $request); ?>
35
+                <? renderFolder($subDocument, $cmsPrefix, $slugPrefix.$document->slug.'/', false, $request); ?>
36 36
             <? endif ?>
37 37
         </li>
38 38
       <? endforeach ?>
Please login to merge, or discard this patch.
src/templates/images/show.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
           <? foreach ($image->set as $key => $set) : ?>
26 26
           <div class="sets">
27 27
             <label><?= $key ?></label>
28
-            <img src="<?= $request::$subfolders . 'images/' . $set ?>"/>
28
+            <img src="<?= $request::$subfolders.'images/'.$set ?>"/>
29 29
           </div>
30 30
           <? endforeach ?>
31 31
       <? endif ?>
Please login to merge, or discard this patch.
src/templates/cms.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
     </main>
98 98
     <script>
99 99
       var subfolders = '<?=$request::$subfolders?>',
100
-        cmsSubfolders = '<?=$request::$subfolders . $cmsPrefix?>';
100
+        cmsSubfolders = '<?=$request::$subfolders.$cmsPrefix?>';
101 101
     </script>
102 102
     <script src="<?= $request::$subfolders ?>js/cms.js"></script>
103 103
   </body>
Please login to merge, or discard this patch.
src/templates/documents.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 <? include('documents/function.renderFolder.php'); ?>
4 4
 <script>window.onload = function () {
5 5
     History.init();
6
-    History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders . $cmsPrefix?>/documents?path=/');
6
+    History.replaceState(null, 'Cloud Control CMS', '/<?=$request::$subfolders.$cmsPrefix?>/documents?path=/');
7 7
   };</script>
8 8
 <section class="documents">
9 9
   <h2><i class="fa fa-file-text-o"></i> Documents</h2>
Please login to merge, or discard this patch.
src/CloudControl.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
         $event->getIO()->write("*** Checking installation of Cloud Control framework ***");
37 37
 
38 38
         $vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
39
-        $rootDir = realpath($vendorDir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
39
+        $rootDir = realpath($vendorDir.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR);
40 40
 
41
-        $baseConfigTargetPath = $rootDir . DIRECTORY_SEPARATOR . 'config.json';
41
+        $baseConfigTargetPath = $rootDir.DIRECTORY_SEPARATOR.'config.json';
42 42
         $configObject = self::getConfig($baseConfigTargetPath);
43 43
 
44 44
         $configObject->{'vendorDir'} = realpath($vendorDir);
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 
54 54
         // TODO Fie FilesStorage to use filesDir from config, similar to ImagesStorage
55 55
 
56
-        $baseStorageDefaultPath = __DIR__ . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . '_storage.json';
57
-        $baseStorageSqlPath = __DIR__ . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . '_storage.sql';
56
+        $baseStorageDefaultPath = __DIR__.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'_storage.json';
57
+        $baseStorageSqlPath = __DIR__.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'_storage.sql';
58 58
 
59 59
         self::createStorage($configObject->{'storageDir'}, $baseStorageDefaultPath, $baseStorageSqlPath);
60 60
         self::saveConfig($event, $baseConfigTargetPath, $configObject);
@@ -81,23 +81,23 @@  discard block
 block discarded – undo
81 81
     private static function saveConfig(Event $event, $baseConfigTargetPath, $configObject)
82 82
     {
83 83
         file_put_contents($baseConfigTargetPath, json_encode($configObject));
84
-        $event->getIO()->write("Saved config to: " . $baseConfigTargetPath);
84
+        $event->getIO()->write("Saved config to: ".$baseConfigTargetPath);
85 85
     }
86 86
 
87 87
     private static function copyInstallFile(Event $event, $sourceFileName, $destinationPath, $destinationFileName = null)
88 88
     {
89
-        $sourceFilePath = realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install/_' . $sourceFileName);
89
+        $sourceFilePath = realpath(__DIR__.DIRECTORY_SEPARATOR.'install/_'.$sourceFileName);
90 90
 
91 91
         if (file_exists($sourceFilePath) && realpath($destinationPath) !== false) {
92 92
             if ($destinationFileName !== null) {
93
-                copy($sourceFilePath, realpath($destinationPath) . DIRECTORY_SEPARATOR . $destinationFileName);
93
+                copy($sourceFilePath, realpath($destinationPath).DIRECTORY_SEPARATOR.$destinationFileName);
94 94
             } else {
95
-                copy($sourceFilePath, realpath($destinationPath) . DIRECTORY_SEPARATOR . $sourceFileName);
95
+                copy($sourceFilePath, realpath($destinationPath).DIRECTORY_SEPARATOR.$sourceFileName);
96 96
             }
97 97
 
98
-            $event->getIO()->write("Copied file: " . $sourceFileName . ' to ' . $destinationPath);
98
+            $event->getIO()->write("Copied file: ".$sourceFileName.' to '.$destinationPath);
99 99
         } else {
100
-            $event->getIO()->write("[ERROR] Couldnt copy file: " . $sourceFileName . ' to ' . $destinationPath);
100
+            $event->getIO()->write("[ERROR] Couldnt copy file: ".$sourceFileName.' to '.$destinationPath);
101 101
         }
102 102
     }
103 103
 
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
     private static function createDir(Event $event, $rootDir, $dirName)
116 116
     {
117
-        $dir = $rootDir . DIRECTORY_SEPARATOR . $dirName . DIRECTORY_SEPARATOR;
117
+        $dir = $rootDir.DIRECTORY_SEPARATOR.$dirName.DIRECTORY_SEPARATOR;
118 118
         if (!is_dir($dir)) {
119 119
             mkdir($dir);
120
-            $event->getIO()->write("Created dir: " . $dir);
120
+            $event->getIO()->write("Created dir: ".$dir);
121 121
         }
122 122
         return realpath($dir);
123 123
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     private static function getConfig($configTargetPath)
130 130
     {
131
-        $baseConfigDefaultPath = realpath(__DIR__ . DIRECTORY_SEPARATOR . 'install/_config.json');
131
+        $baseConfigDefaultPath = realpath(__DIR__.DIRECTORY_SEPARATOR.'install/_config.json');
132 132
 
133 133
         if (file_exists($configTargetPath)) {
134 134
             $config = json_decode(file_get_contents($configTargetPath));
Please login to merge, or discard this patch.
src/util/functions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
 	$debug_backtrace = current(debug_backtrace());
13 13
 	if (PHP_SAPI == 'cli') {
14
-		echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n";
14
+		echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n";
15 15
 		foreach (func_get_args() as $data) {
16 16
 			var_dump($data);
17 17
 		}
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 <body>
30 30
 END;
31 31
 
32
-		echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>";
32
+		echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>";
33 33
 		echo '<pre>';
34 34
 		foreach (func_get_args() as $data) {
35 35
 			echo "<code>";
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
  */
54 54
 function utf8Convert($array)
55 55
 {
56
-	array_walk_recursive($array, function(&$item){
57
-		if(!mb_detect_encoding($item, 'utf-8', true)){
56
+	array_walk_recursive($array, function(&$item) {
57
+		if (!mb_detect_encoding($item, 'utf-8', true)) {
58 58
 			$item = utf8_encode($item);
59 59
 		}
60 60
 	});
Please login to merge, or discard this patch.