Completed
Branch develop (ce1157)
by
unknown
25:35
created
htdocs/admin/tools/ui/components/icons.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 }
34 34
 
35 35
 // Includes
36
-require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php';
36
+require_once DOL_DOCUMENT_ROOT.'/admin/tools/ui/class/documentation.class.php';
37 37
 
38 38
 // Load documentation translations
39 39
 $langs->load('uxdocumentation');
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 
47 47
 // Set view for menu and breadcrumb
48 48
 // Menu must be set in constructor of documentation class
49
-$documentation->view = array('Components','Icons');
49
+$documentation->view = array('Components', 'Icons');
50 50
 $form = new Form($db);
51 51
 
52 52
 
53
-$displayMode = GETPOST('displayMode') == 'kanban' ?  'kanban' : 'icon-only';
53
+$displayMode = GETPOST('displayMode') == 'kanban' ? 'kanban' : 'icon-only';
54 54
 $revertDisplayMode = $displayMode == 'kanban' ? 'icon-only' : 'kanban';
55 55
 $revertDisplayName = $displayMode == 'kanban' ? $langs->trans('ViewList') : $langs->trans('ViewKanban');
56
-$switchDisplayLink = dol_buildpath($documentation->baseUrl . '/components/icons.php', 1) . '?displayMode=' . $revertDisplayMode;
56
+$switchDisplayLink = dol_buildpath($documentation->baseUrl.'/components/icons.php', 1).'?displayMode='.$revertDisplayMode;
57 57
 $switchDisplayLinkIcon = $displayMode == 'kanban' ? 'fa fa-th' : 'fa fa-th-list';
58 58
 
59 59
 // Output sidebar
@@ -78,16 +78,16 @@  discard block
 block discarded – undo
78 78
 				<?php
79 79
 
80 80
 				$iconFileName = 'shims.json';
81
-				$iconFilePath = DOL_DOCUMENT_ROOT . '/theme/common/fontawesome-5/metadata';
81
+				$iconFilePath = DOL_DOCUMENT_ROOT.'/theme/common/fontawesome-5/metadata';
82 82
 
83
-				$fontAwesomeIconRaw = file_get_contents($iconFilePath. '/' .$iconFileName);
83
+				$fontAwesomeIconRaw = file_get_contents($iconFilePath.'/'.$iconFileName);
84 84
 				if ($fontAwesomeIconRaw === false) {
85
-					dol_print_error($db, 'Error missing file  '. $iconFilePath . '/' . $iconFileName);
85
+					dol_print_error($db, 'Error missing file  '.$iconFilePath.'/'.$iconFileName);
86 86
 				}
87 87
 
88 88
 				$fontAwesomeIcons = json_decode($fontAwesomeIconRaw);
89 89
 				if ($fontAwesomeIcons === null) {
90
-					dol_print_error($db, 'Error decoding '. $iconFilePath . '/' . $iconFileName);
90
+					dol_print_error($db, 'Error decoding '.$iconFilePath.'/'.$iconFileName);
91 91
 				}
92 92
 				?>
93 93
 
@@ -117,13 +117,13 @@  discard block
 block discarded – undo
117 117
 							$labelAlt = 'Text on title tag for tooltip';
118 118
 
119 119
 							if ($displayMode == 'kanban') {
120
-								$iconCode =  img_picto($iconName, $iconName);
120
+								$iconCode = img_picto($iconName, $iconName);
121 121
 								print '<div class="info-box ">
122 122
 									<span class="info-box-icon bg-infobox-expensereport">
123 123
 										'.$iconCode.'
124 124
 									</span>
125 125
 									<div class="info-box-content">
126
-										<div class="info-box-title" >'. $iconName .'</div>
126
+										<div class="info-box-title" >'. $iconName.'</div>
127 127
 										<div class="info-box-lines">
128 128
 											<div class="info-box-line spanoverflow nowrap">
129 129
 												<div class="inline-block nowraponall">
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
 				<?php
157 157
 
158 158
 				$iconFileName = 'shims.json';
159
-				$iconFilePath = DOL_DOCUMENT_ROOT . '/theme/common/fontawesome-5/metadata';
159
+				$iconFilePath = DOL_DOCUMENT_ROOT.'/theme/common/fontawesome-5/metadata';
160 160
 
161
-				$fontAwesomeIconRaw = file_get_contents($iconFilePath. '/' .$iconFileName);
161
+				$fontAwesomeIconRaw = file_get_contents($iconFilePath.'/'.$iconFileName);
162 162
 				if ($fontAwesomeIconRaw === false) {
163
-					dol_print_error($db, 'Error missing file  '. $iconFilePath . '/' . $iconFileName);
163
+					dol_print_error($db, 'Error missing file  '.$iconFilePath.'/'.$iconFileName);
164 164
 				}
165 165
 
166 166
 				$fontAwesomeIcons = json_decode($fontAwesomeIconRaw);
167 167
 				if ($fontAwesomeIcons === null) {
168
-					dol_print_error($db, 'Error decoding '. $iconFilePath . '/' . $iconFileName);
168
+					dol_print_error($db, 'Error decoding '.$iconFilePath.'/'.$iconFileName);
169 169
 				}
170 170
 				?>
171 171
 
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
 					$alreadyDisplay = [];
192 192
 					if ($fontAwesomeIcons && is_array($fontAwesomeIcons)) {
193 193
 						foreach ($fontAwesomeIcons as $iconData) {
194
-							$class= $iconData[1]??'fa';
194
+							$class = $iconData[1] ?? 'fa';
195 195
 							if (!empty($iconData[2])) {
196
-								$class.= ' fa-'.$iconData[2];
196
+								$class .= ' fa-'.$iconData[2];
197 197
 							} else {
198
-								$class.= ' fa-'.$iconData[0];
198
+								$class .= ' fa-'.$iconData[0];
199 199
 							}
200 200
 
201 201
 							if (in_array($class, $alreadyDisplay)) {
@@ -203,19 +203,19 @@  discard block
 block discarded – undo
203 203
 							}
204 204
 
205 205
 							$alreadyDisplay[] = $class;
206
-							$iconCode =  '<span class="'.$class.'" ></span>';
206
+							$iconCode = '<span class="'.$class.'" ></span>';
207 207
 
208 208
 							if ($displayMode == 'kanban') {
209 209
 								print '<div class="info-box ">
210 210
 										<span class="info-box-icon bg-infobox-expensereport">
211
-											' . $iconCode . '
211
+											' . $iconCode.'
212 212
 										</span>
213 213
 										<div class="info-box-content">
214
-											<div class="info-box-title" >' . ($iconData[2] ?? ($iconData[0] ?? '')) . '</div>
214
+											<div class="info-box-title" >' . ($iconData[2] ?? ($iconData[0] ?? '')).'</div>
215 215
 											<div class="info-box-lines">
216 216
 												<div class="info-box-line spanoverflow nowrap">
217 217
 													<div class="inline-block nowraponall">
218
-														<div class="documentation-code"><pre>' . dol_htmlentities($iconCode) . '</pre></div>
218
+														<div class="documentation-code"><pre>' . dol_htmlentities($iconCode).'</pre></div>
219 219
 													</div>
220 220
 												</div>
221 221
 											</div><!-- /.info-box-lines -->
Please login to merge, or discard this patch.