Passed
Push — master ( 15b471...17fc67 )
by Nicolaas
02:18
created
src/Api/DefaultDashboardProvider.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $this->addFindPages();
35 35
         $this->addFilesAndImages();
36 36
         $this->addSiteConfigLinks();
37
-        if(Permission::check('ADMIN')) {
37
+        if (Permission::check('ADMIN')) {
38 38
             $this->addSecurityLinks();
39 39
         }
40 40
         $this->addModelAdminLinks();
@@ -54,20 +54,20 @@  discard block
 block discarded – undo
54 54
     protected function addPagesLinks()
55 55
     {
56 56
         DashboardWelcomeQuicklinks::add_group('PAGES', 'Pages', 10);
57
-        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('add'). ' Page', '/admin/pages/add');
57
+        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('add') . ' Page', '/admin/pages/add');
58 58
         $pagesCount = DataObject::get('Page')->count();
59 59
         $draftCount = CMSSiteTreeFilter_StatusDraftPages::create()->getFilteredPages()->count();
60 60
         $revisedCount = CMSSiteTreeFilter_ChangedPages::create()->getFilteredPages()->count();
61
-        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' Pages ('.$pagesCount.')', '/admin/pages');
62
-        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' Unpublished Drafts ('.$draftCount.')', '/admin/pages?q[FilterClass]=SilverStripe\CMS\Controllers\CMSSiteTreeFilter_StatusDraftPages');
63
-        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' Unpublished Changes ('.$revisedCount.')', '/admin/pages?q[FilterClass]=SilverStripe\CMS\Controllers\CMSSiteTreeFilter_ChangedPages');
61
+        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' Pages (' . $pagesCount . ')', '/admin/pages');
62
+        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' Unpublished Drafts (' . $draftCount . ')', '/admin/pages?q[FilterClass]=SilverStripe\CMS\Controllers\CMSSiteTreeFilter_StatusDraftPages');
63
+        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' Unpublished Changes (' . $revisedCount . ')', '/admin/pages?q[FilterClass]=SilverStripe\CMS\Controllers\CMSSiteTreeFilter_ChangedPages');
64 64
         $pageLastEdited = DataObject::get_one('Page', '', true, 'LastEdited DESC');
65 65
         if ($pageLastEdited) {
66
-            DashboardWelcomeQuicklinks::add_link('PAGES', '✎ Last Edited Page: '.$pageLastEdited->Title, $pageLastEdited->CMSEditLink());
66
+            DashboardWelcomeQuicklinks::add_link('PAGES', '✎ Last Edited Page: ' . $pageLastEdited->Title, $pageLastEdited->CMSEditLink());
67 67
         }
68
-        $lastWeekLink = '/admin/pages?'.'q[LastEditedFrom]='.date('Y-m-d', strtotime('-1 week'));
69
-        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Recently Modified Pages', $lastWeekLink);
70
-        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Page Reports', '/admin/reports');
68
+        $lastWeekLink = '/admin/pages?' . 'q[LastEditedFrom]=' . date('Y-m-d', strtotime('-1 week'));
69
+        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Recently Modified Pages', $lastWeekLink);
70
+        DashboardWelcomeQuicklinks::add_link('PAGES', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Page Reports', '/admin/reports');
71 71
     }
72 72
 
73 73
     protected function addFindPages()
@@ -76,34 +76,34 @@  discard block
 block discarded – undo
76 76
         $notUsedArray = [];
77 77
         $pagesToSkip = (array) $this->Config()->get('pages_to_skip');
78 78
         foreach (ClassInfo::subclassesFor(SiteTree::class, false) as $className) {
79
-            if(in_array($className, $pagesToSkip)) {
79
+            if (in_array($className, $pagesToSkip)) {
80 80
                 continue;
81 81
             }
82 82
             $pages[$className] = $className;
83 83
 
84 84
         }
85
-        DashboardWelcomeQuicklinks::add_group('PAGEFILTER', 'Page Types ('.count($pages).')', 300);
85
+        DashboardWelcomeQuicklinks::add_group('PAGEFILTER', 'Page Types (' . count($pages) . ')', 300);
86 86
         $count = 0;
87
-        foreach($pages as $pageClassName) {
87
+        foreach ($pages as $pageClassName) {
88 88
             $pageCount = $pageClassName::get()->filter(['ClassName' => $pageClassName])->count();
89
-            if($pageCount < 1) {
89
+            if ($pageCount < 1) {
90 90
                 $notUsedArray[$pageClassName] = $pageClassName::singleton()->i18n_singular_name();
91 91
                 continue;
92 92
             }
93 93
             $count++;
94
-            if($pageCount === 1) {
94
+            if ($pageCount === 1) {
95 95
                 $obj = DataObject::get_one($pageClassName, ['ClassName' => $pageClassName]);
96
-                DashboardWelcomeQuicklinks::add_link('PAGEFILTER', DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' '.$pageClassName::singleton()->i18n_singular_name() . ' (1)', $obj->CMSEditLink());
96
+                DashboardWelcomeQuicklinks::add_link('PAGEFILTER', DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' ' . $pageClassName::singleton()->i18n_singular_name() . ' (1)', $obj->CMSEditLink());
97 97
                 continue;
98 98
             }
99 99
             $page = Injector::inst()->get($pageClassName);
100 100
             $pageTitle = $page->i18n_plural_name();
101
-            $query = 'q[ClassName]='.$pageClassName;
101
+            $query = 'q[ClassName]=' . $pageClassName;
102 102
             $link = 'admin/pages?' . $query;
103
-            DashboardWelcomeQuicklinks::add_link('PAGEFILTER', DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' '.$pageTitle.' ('.$pageCount.')', $link);
103
+            DashboardWelcomeQuicklinks::add_link('PAGEFILTER', DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' ' . $pageTitle . ' (' . $pageCount . ')', $link);
104 104
         }
105
-        foreach($notUsedArray as $pageClassName => $pageTitle) {
106
-            DashboardWelcomeQuicklinks::add_link('PAGEFILTER', DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' '.$pageTitle.' (0)', 'admin/pages/add?PageType='.$pageClassName);
105
+        foreach ($notUsedArray as $pageClassName => $pageTitle) {
106
+            DashboardWelcomeQuicklinks::add_link('PAGEFILTER', DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' ' . $pageTitle . ' (0)', 'admin/pages/add?PageType=' . $pageClassName);
107 107
         }
108 108
     }
109 109
     protected function addFilesAndImages()
@@ -113,44 +113,44 @@  discard block
 block discarded – undo
113 113
         $uploadFolderName = Config::inst()->get(Upload::class, 'uploads_folder');
114 114
         $uploadFolder = Folder::find_or_make($uploadFolderName);
115 115
         // all
116
-        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' Open File Browswer', '/admin/assets');
116
+        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' Open File Browswer', '/admin/assets');
117 117
         // per type
118 118
         $filesCount = File::get()->exclude(['ClassName' => [Folder::class, Image::class]])->count();
119 119
         $imageCount = File::get()->filter(['ClassName' => [Image::class]])->count();
120
-        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Images ('.$imageCount.')', 'admin/assets?filter[appCategory]=IMAGE');
121
-        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Files ('.$filesCount.')', 'admin/assets?filter[appCategory]=DOCUMENT');
120
+        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Images (' . $imageCount . ')', 'admin/assets?filter[appCategory]=IMAGE');
121
+        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Files (' . $filesCount . ')', 'admin/assets?filter[appCategory]=DOCUMENT');
122 122
 
123 123
         // default upload folder
124
-        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Open Default Upload Folder', $uploadFolder->CMSEditLink());
124
+        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Open Default Upload Folder', $uploadFolder->CMSEditLink());
125 125
 
126 126
         // recent
127
-        $lastWeekLink = '/admin/assets?'.'filter[lastEditedFrom]='.date('Y-m-d', strtotime('-1 week')).'&view=tile';
128
-        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Recently modified Files', $lastWeekLink);
127
+        $lastWeekLink = '/admin/assets?' . 'filter[lastEditedFrom]=' . date('Y-m-d', strtotime('-1 week')) . '&view=tile';
128
+        DashboardWelcomeQuicklinks::add_link('FILESANDIMAGES', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Recently modified Files', $lastWeekLink);
129 129
     }
130 130
 
131 131
     protected function addSiteConfigLinks()
132 132
     {
133 133
         DashboardWelcomeQuicklinks::add_group('SITECONFIG', 'Site Wide Configuration', 20);
134
-        DashboardWelcomeQuicklinks::add_link('SITECONFIG', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Site Settings', '/admin/settings');
134
+        DashboardWelcomeQuicklinks::add_link('SITECONFIG', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Site Settings', '/admin/settings');
135 135
     }
136 136
 
137 137
     protected function addSecurityLinks()
138 138
     {
139 139
         DashboardWelcomeQuicklinks::add_group('SECURITY', 'Security', 30);
140
-        DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('add'). ' User', '/admin/security/users/EditForm/field/users/item/new');
140
+        DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('add') . ' User', '/admin/security/users/EditForm/field/users/item/new');
141 141
         $userCount = Member::get()->count();
142 142
         $groupCount = Group::get()->count();
143
-        DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Users ('.$userCount.')', '/admin/security');
144
-        DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Groups  ('.$groupCount.')', '/admin/security/groups');
143
+        DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Users (' . $userCount . ')', '/admin/security');
144
+        DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Groups  (' . $groupCount . ')', '/admin/security/groups');
145 145
         DefaultAdminService::singleton()->extend('addSecurityLinks', $this);
146 146
         $adminGroup = Permission::get_groups_by_permission('ADMIN')->first();
147
-        if($adminGroup) {
147
+        if ($adminGroup) {
148 148
             $userCount = $adminGroup->Members()->count();
149
-            DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Administrators ('.$userCount.')', '/admin/security/groups/EditForm/field/groups/item/'.$adminGroup->ID.'/edit');
149
+            DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Administrators (' . $userCount . ')', '/admin/security/groups/EditForm/field/groups/item/' . $adminGroup->ID . '/edit');
150 150
         }
151
-        if(class_exists(EnabledMembers::class)) {
151
+        if (class_exists(EnabledMembers::class)) {
152 152
             $obj = Injector::inst()->get(EnabledMembers::class);
153
-            DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review'). ' Multi-Factor Authentication Status', $obj->getLink());
153
+            DashboardWelcomeQuicklinks::add_link('SECURITY', DashboardWelcomeQuicklinks::get_base_phrase('review') . ' Multi-Factor Authentication Status', $obj->getLink());
154 154
 
155 155
         }
156 156
     }
@@ -163,33 +163,33 @@  discard block
 block discarded – undo
163 163
         $modelAdmins = [];
164 164
         $skips = (array) $this->Config()->get('model_admins_to_skip');
165 165
         foreach (ClassInfo::subclassesFor(ModelAdmin::class, false) as $className) {
166
-            if(in_array($className, $skips)) {
166
+            if (in_array($className, $skips)) {
167 167
                 continue;
168 168
             }
169 169
             $modelAdmins[$className] = $className;
170 170
 
171 171
         }
172
-        foreach($modelAdmins as $modelAdminClassName) {
172
+        foreach ($modelAdmins as $modelAdminClassName) {
173 173
             $groupAdded = false;
174 174
             $ma = Injector::inst()->get($modelAdminClassName);
175
-            if($ma->canView()) {
175
+            if ($ma->canView()) {
176 176
                 $mas = $ma->getManagedModels();
177
-                if(count($mas)) {
177
+                if (count($mas)) {
178 178
                     $numberOfModels = count($mas);
179 179
                     $groupCode = strtoupper($modelAdminClassName);
180 180
                     $count = 0;
181
-                    foreach($mas as $model => $title) {
181
+                    foreach ($mas as $model => $title) {
182 182
                         $count++;
183
-                        if(is_array($title)) {
183
+                        if (is_array($title)) {
184 184
                             $title = $title['title'];
185 185
                             $model = $title['dataClass'] ?? $model;
186 186
                         }
187
-                        if(! class_exists($model)) {
187
+                        if (!class_exists($model)) {
188 188
                             continue;
189 189
                         }
190 190
                         $obj = Injector::inst()->get($model);
191
-                        if($obj && $obj->canView()) {
192
-                            if(! $groupAdded) {
191
+                        if ($obj && $obj->canView()) {
192
+                            if (!$groupAdded) {
193 193
                                 DashboardWelcomeQuicklinks::add_group($groupCode, $ma->menu_title(), 100);
194 194
                                 $groupAdded = true;
195 195
                             }
@@ -197,38 +197,38 @@  discard block
 block discarded – undo
197 197
                             $ma = ReflectionHelper::allowAccessToProperty(get_class($ma), 'modelClass');
198 198
                             $ma->modelClass = $model;
199 199
                             $list = $ma->getList();
200
-                            if(! $list) {
200
+                            if (!$list) {
201 201
                                 $list = $model::get();
202 202
                             }
203 203
                             $objectCount = $list->count();
204
-                            if($objectCount === 1) {
204
+                            if ($objectCount === 1) {
205 205
                                 $obj = DataObject::get_one($model, ['ClassName' => $model]);
206
-                                if(! $obj) {
206
+                                if (!$obj) {
207 207
                                     $obj = DataObject::get_one($model);
208 208
                                 }
209
-                                if($obj && $obj->hasMethod('CMSEditLink')) {
210
-                                    DashboardWelcomeQuicklinks::add_link($groupCode, DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' '.$model::singleton()->i18n_singular_name(), $obj->CMSEditLink());
209
+                                if ($obj && $obj->hasMethod('CMSEditLink')) {
210
+                                    DashboardWelcomeQuicklinks::add_link($groupCode, DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' ' . $model::singleton()->i18n_singular_name(), $obj->CMSEditLink());
211 211
                                     continue;
212 212
                                 }
213 213
                             }
214 214
 
215 215
                             $link = '';
216
-                            if($obj->hasMethod('CMSListLink')) {
216
+                            if ($obj->hasMethod('CMSListLink')) {
217 217
                                 $link = $obj->CMSListLink();
218
-                            } if(! $link) {
218
+                            } if (!$link) {
219 219
                                 $link = $ma->getLinkForModelTab($model);
220 220
                             }
221
-                            $titleContainsObjectCount = strpos($title, ' ('.$objectCount.')');
222
-                            if($titleContainsObjectCount === false) {
223
-                                $title .= ' ('.$objectCount.')';
221
+                            $titleContainsObjectCount = strpos($title, ' (' . $objectCount . ')');
222
+                            if ($titleContainsObjectCount === false) {
223
+                                $title .= ' (' . $objectCount . ')';
224 224
                             }
225
-                            DashboardWelcomeQuicklinks::add_link($groupCode, DashboardWelcomeQuicklinks::get_base_phrase('edit'). ' '.$title, $link);
226
-                            if($numberOfModels < 4) {
225
+                            DashboardWelcomeQuicklinks::add_link($groupCode, DashboardWelcomeQuicklinks::get_base_phrase('edit') . ' ' . $title, $link);
226
+                            if ($numberOfModels < 4) {
227 227
                                 $obj = Injector::inst()->get($model);
228
-                                if($obj->canCreate()) {
228
+                                if ($obj->canCreate()) {
229 229
                                     $classNameEscaped = str_replace('\\', '-', $model);
230
-                                    $linkNew = $link .= '/EditForm/field/'.$classNameEscaped.'/item/new';
231
-                                    DashboardWelcomeQuicklinks::add_link($groupCode, DashboardWelcomeQuicklinks::get_base_phrase('add'). ' '.$obj->i18n_singular_name(), $linkNew);
230
+                                    $linkNew = $link .= '/EditForm/field/' . $classNameEscaped . '/item/new';
231
+                                    DashboardWelcomeQuicklinks::add_link($groupCode, DashboardWelcomeQuicklinks::get_base_phrase('add') . ' ' . $obj->i18n_singular_name(), $linkNew);
232 232
                                 }
233 233
                             }
234 234
                         }
Please login to merge, or discard this patch.
src/Admin/DashboardWelcomeQuickLinks.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 
52 52
     public static function get_base_phrase(string $phrase): string
53 53
     {
54
-        $phrase = Config::inst()->get(static::class, $phrase .'_phrase');
55
-        return _t('DashboardWelcomeQuicklinks.'.$phrase, $phrase);
54
+        $phrase = Config::inst()->get(static::class, $phrase . '_phrase');
55
+        return _t('DashboardWelcomeQuicklinks.' . $phrase, $phrase);
56 56
     }
57 57
 
58 58
     private static string $add_phrase = '+';
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
             usort(
179 179
                 $shortcuts,
180
-                function ($a, $b) {
180
+                function($a, $b) {
181 181
                     ($a['SortOrder'] ?? 0) <=> ($b['SortOrder'] ?? 0);
182 182
                 }
183 183
             );
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                         $entry['IconClass'] ?? '',
219 219
                         $entry['Target'] ?? '',
220 220
                     )->Field();
221
-                    if($count > $max && count($items) == $count + 1) {
221
+                    if ($count > $max && count($items) == $count + 1) {
222 222
                         $html .= $this->makeShortCut(
223 223
                             $this->Config()->get('more_phrase'),
224 224
                             '#', // link
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
             }
233 233
         }
234 234
         $kc = (array) $this->Config()->get('colour_options');
235
-        if(empty($kc)) {
235
+        if (empty($kc)) {
236 236
             $kc = $this->Config()->get('default_colour_options');
237 237
         }
238 238
         $kcCount = count($kc);
239 239
         $colours = '';
240 240
         foreach ($kc as $key => $colour) {
241
-            $colours .= ' .grid-wrapper .grid-cell:nth-child(' . $kcCount . 'n+' . ($key + 1) . ') div.header {background-color: ' . $colour . '; color: '.$this->getFontColor($colour).'!important;}';
241
+            $colours .= ' .grid-wrapper .grid-cell:nth-child(' . $kcCount . 'n+' . ($key + 1) . ') div.header {background-color: ' . $colour . '; color: ' . $this->getFontColor($colour) . '!important;}';
242 242
         }
243 243
         $html .= '</div>';
244 244
         $html .= '<script>window.setTimeout(dashboardWelcomeQuickLinksSetupInputAndFilter, 500)</script>';
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         $useDefaultDashboard = (bool) $this->config()->get('use_default_dashboard_provider');
253 253
         $classNames = ClassInfo::implementorsOf(DashboardWelcomeQuickLinksProvider::class);
254 254
         foreach ($classNames as $className) {
255
-            if($useDefaultDashboard === false && (string) $className === DefaultDashboardProvider::class) {
255
+            if ($useDefaultDashboard === false && (string) $className === DefaultDashboardProvider::class) {
256 256
                 continue;
257 257
             }
258 258
             $array += Injector::inst()->get($className)->provideDashboardWelcomeQuickLinks();
@@ -274,10 +274,10 @@  discard block
 block discarded – undo
274 274
         if (!empty($iconClass)) {
275 275
             $icon = '<i class="' . $iconClass . '"></i> ';
276 276
         }
277
-        if(!$target) {
277
+        if (!$target) {
278 278
             $target = '_self';
279 279
         }
280
-        $target = ' target="'.$target.'"';
280
+        $target = ' target="' . $target . '"';
281 281
         if ($link) {
282 282
             $html = '
283 283
             ' . $script . '
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
     {
306 306
         $app = $this->getApplicationName();
307 307
         $siteConfigTitle = SiteConfig::current_site_config()->Title;
308
-        if($siteConfigTitle) {
309
-            $app = $siteConfigTitle . ' ('.$app.')';
308
+        if ($siteConfigTitle) {
309
+            $app = $siteConfigTitle . ' (' . $app . ')';
310 310
         }
311 311
         return ($section = $this->SectionTitle()) ? sprintf('%s for %s', $section, $app) : $app;
312 312
     }
Please login to merge, or discard this patch.