-
-
Notifications
You must be signed in to change notification settings - Fork 825
/
Copy pathContributionPage.php
717 lines (635 loc) · 21.7 KB
/
ContributionPage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
<?php
/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/
/**
* Create a page for displaying Contribute Pages
* Contribute Pages are pages that are used to display
* contributions of different types. Pages consist
* of many customizable sections which can be
* accessed.
*
* This page provides a top level browse view
* of all the contribution pages in the system.
*
*/
class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
/**
* The action links that we need to display for the browse screen.
*
* @var array
*/
private static $_actionLinks;
private static $_contributionLinks;
private static $_configureActionLinks;
private static $_onlineContributionLinks;
/**
* @var CRM_Utils_Pager
*/
protected $_pager = NULL;
/**
* @var string
*/
protected $_sortByCharacter;
/**
* Get the action links for this page.
*
* @return array
*/
public static function &actionLinks() {
// check if variable _actionsLinks is populated
if (!isset(self::$_actionLinks)) {
// helper variable for nicer formatting
$deleteExtra = ts('Are you sure you want to delete this Contribution page?');
$copyExtra = ts('Are you sure you want to make a copy of this Contribution page?');
self::$_actionLinks = [
CRM_Core_Action::COPY => [
'name' => ts('Make a Copy'),
'url' => CRM_Utils_System::currentPath(),
'qs' => 'action=copy&gid=%%id%%&qfKey=%%key%%',
'title' => ts('Make a Copy of CiviCRM Contribution Page'),
'extra' => 'onclick = "return confirm(\'' . $copyExtra . '\');"',
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::COPY),
],
CRM_Core_Action::DISABLE => [
'name' => ts('Disable'),
'title' => ts('Disable'),
'ref' => 'crm-enable-disable',
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DISABLE),
],
CRM_Core_Action::ENABLE => [
'name' => ts('Enable'),
'ref' => 'crm-enable-disable',
'title' => ts('Enable'),
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::ENABLE),
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => CRM_Utils_System::currentPath(),
'qs' => 'action=delete&reset=1&id=%%id%%',
'title' => ts('Delete Custom Field'),
'extra' => 'onclick = "return confirm(\'' . $deleteExtra . '\');"',
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DELETE),
],
];
}
return self::$_actionLinks;
}
/**
* Get the configure action links for this page.
*
* @return array
*/
public function &configureActionLinks() {
// check if variable _actionsLinks is populated
if (!isset(self::$_configureActionLinks)) {
$urlString = 'civicrm/admin/contribute/';
$urlParams = 'reset=1&action=update&id=%%id%%';
self::$_configureActionLinks = [
CRM_Core_Action::ADD => [
'name' => ts('Title and Settings'),
'title' => ts('Title and Settings'),
'url' => $urlString . 'settings',
'qs' => $urlParams,
'uniqueName' => 'settings',
// This needs to be lower than Membership Settings since otherwise the order doesn't make sense.
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Contribution Amounts'),
'title' => ts('Contribution Amounts'),
'url' => $urlString . 'amount',
'qs' => $urlParams,
'uniqueName' => 'amount',
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::UPDATE),
],
CRM_Core_Action::VIEW => [
'name' => ts('Membership Settings'),
'title' => ts('Membership Settings'),
'url' => $urlString . 'membership',
'qs' => $urlParams,
'uniqueName' => 'membership',
// This should come after Title
'weight' => 0,
],
CRM_Core_Action::EXPORT => [
'name' => ts('Thank-you and Receipting'),
'title' => ts('Thank-you and Receipting'),
'url' => $urlString . 'thankyou',
'qs' => $urlParams,
'uniqueName' => 'thankyou',
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::EXPORT),
],
CRM_Core_Action::PROFILE => [
'name' => ts('Include Profiles'),
'title' => ts('Include Profiles'),
'url' => $urlString . 'custom',
'qs' => $urlParams,
'uniqueName' => 'custom',
'weight' => 20,
],
CRM_Core_Action::MAP => [
'name' => ts('Contribution Widget'),
'title' => ts('Contribution Widget'),
'url' => $urlString . 'widget',
'qs' => $urlParams,
'uniqueName' => 'widget',
'weight' => 30,
],
CRM_Core_Action::FOLLOWUP => [
'name' => ts('Premiums'),
'title' => ts('Premiums'),
'url' => $urlString . 'premium',
'qs' => $urlParams,
'uniqueName' => 'premium',
'weight' => 40,
],
CRM_Core_Action::ADVANCED => [
'name' => ts('Personal Campaign Pages'),
'title' => ts('Personal Campaign Pages'),
'url' => $urlString . 'pcp',
'qs' => $urlParams,
'uniqueName' => 'pcp',
'weight' => 50,
],
];
$context = [
'urlString' => $urlString,
'urlParams' => $urlParams,
];
CRM_Utils_Hook::tabset('civicrm/admin/contribute', self::$_configureActionLinks, $context);
}
return self::$_configureActionLinks;
}
/**
* Get the online contribution links.
*
* @return array
*/
public function &onlineContributionLinks() {
if (!isset(self::$_onlineContributionLinks)) {
$urlString = 'civicrm/contribute/transact';
$urlParams = 'reset=1&id=%%id%%';
self::$_onlineContributionLinks = [
CRM_Core_Action::RENEW => [
'name' => ts('Live Page'),
'title' => ts('Live Page'),
'url' => $urlString,
'qs' => $urlParams,
'fe' => TRUE,
'uniqueName' => 'live_page',
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::RENEW),
],
CRM_Core_Action::PREVIEW => [
'name' => ts('Test-drive'),
'title' => ts('Test-drive'),
'url' => $urlString,
'qs' => $urlParams . '&action=preview',
// Addresses https://lab.civicrm.org/dev/core/issues/658
'fe' => TRUE,
'uniqueName' => 'test_drive',
'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::PREVIEW),
],
];
}
return self::$_onlineContributionLinks;
}
/**
* Get the contributions links.
*
* @return array
*/
public function &contributionLinks() {
if (!isset(self::$_contributionLinks)) {
//get contribution dates.
$dates = CRM_Contribute_BAO_Contribution::getContributionDates();
$now = $dates['now'];
$yearDate = $dates['yearDate'];
$monthDate = $dates['monthDate'];
$yearNow = $yearDate + 10000;
$urlString = 'civicrm/contribute/search';
$urlParams = 'reset=1&contribution_page_id=%%id%%&force=1&test=0';
self::$_contributionLinks = [
CRM_Core_Action::DETACH => [
'name' => ts('Current Month-To-Date'),
'title' => ts('Current Month-To-Date'),
'url' => $urlString,
'qs' => "{$urlParams}&receive_date_low={$monthDate}&receive_date_high={$now}",
'uniqueName' => 'current_month_to_date',
'weight' => 10,
],
CRM_Core_Action::REVERT => [
'name' => ts('Fiscal Year-To-Date'),
'title' => ts('Fiscal Year-To-Date'),
'url' => $urlString,
'qs' => "{$urlParams}&receive_date_low={$yearDate}&receive_date_high={$yearNow}",
'uniqueName' => 'fiscal_year_to_date',
'weight' => 20,
],
CRM_Core_Action::BROWSE => [
'name' => ts('Cumulative'),
'title' => ts('Cumulative'),
'url' => $urlString,
'qs' => "{$urlParams}",
'uniqueName' => 'cumulative',
'weight' => 30,
],
];
}
return self::$_contributionLinks;
}
/**
* Run the page.
*
* This method is called after the page is created. It checks for the
* type of action and executes that action.
* Finally it calls the parent's run method.
*
* @return mixed
*/
public function run() {
// get the requested action
$action = CRM_Utils_Request::retrieve('action', 'String',
// default to 'browse'
$this, FALSE, 'browse'
);
// assign vars to templates
$this->assign('action', $action);
$id = CRM_Utils_Request::retrieve('id', 'Positive',
$this, FALSE, 0
);
// set breadcrumb to append to 2nd layer pages
$breadCrumb = [
[
'title' => ts('Manage Contribution Pages'),
'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(),
'reset=1'
),
],
];
// what action to take ?
if ($action & CRM_Core_Action::ADD) {
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(),
'action=browse&reset=1'
));
$controller = new CRM_Contribute_Controller_ContributionPage(NULL, $action);
CRM_Utils_System::setTitle(ts('Manage Contribution Page'));
CRM_Utils_System::appendBreadCrumb($breadCrumb);
return $controller->run();
}
elseif ($action & CRM_Core_Action::UPDATE) {
// assign vars to templates
$this->assign('id', $id);
$this->assign('title', CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $id, 'title'));
$this->assign('is_active', CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $id, 'is_active'));
$this->assign('CiviMember', CRM_Core_Component::isEnabled('CiviMember'));
}
elseif ($action & CRM_Core_Action::COPY) {
$key = $_POST['qfKey'] ?? $_GET['qfKey'] ?? $_REQUEST['qfKey'] ?? NULL;
$k = CRM_Core_Key::validate($key, CRM_Utils_System::getClassName($this));
if (!$k) {
$this->invalidKey();
}
$this->copy();
CRM_Core_Session::setStatus(ts('A copy of the contribution page has been created'), ts('Successfully Copied'), 'success');
}
elseif ($action & CRM_Core_Action::DELETE) {
CRM_Utils_System::appendBreadCrumb($breadCrumb);
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(),
'reset=1&action=browse'
));
$id = CRM_Utils_Request::retrieve('id', 'Positive',
$this, FALSE, 0
);
$query = "
SELECT ccp.title
FROM civicrm_contribution_page ccp
JOIN civicrm_pcp cp ON ccp.id = cp.page_id
WHERE cp.page_id = {$id}
AND cp.page_type = 'contribute'
";
if ($pageTitle = CRM_Core_DAO::singleValueQuery($query)) {
CRM_Core_Session::setStatus(ts('The \'%1\' cannot be deleted! You must Delete all Personal Campaign Page(s) related with this contribution page prior to deleting the page.', [1 => $pageTitle]), ts('Deletion Error'), 'error');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1'));
}
$controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_ContributionPage_Delete',
'Delete Contribution Page',
CRM_Core_Action::DELETE
);
$controller->set('id', $id);
$controller->process();
return $controller->run();
}
else {
// finally browse the contribution pages
$this->browse();
CRM_Utils_System::setTitle(ts('Manage Contribution Pages'));
}
return parent::run();
}
/**
* Make a copy of a contribution page, including all the fields in the page.
*/
public function copy() {
$gid = CRM_Utils_Request::retrieve('gid', 'Positive',
$this, TRUE, 0, 'GET'
);
$copy = CRM_Contribute_BAO_ContributionPage::copy($gid);
$urlString = CRM_Utils_System::currentPath();
$urlParams = 'reset=1';
// Redirect to copied contribution page
if ($copy->id) {
$urlString = 'civicrm/admin/contribute/settings';
$urlParams .= '&action=update&id=' . $copy->id;
}
CRM_Utils_System::redirect(CRM_Utils_System::url($urlString, $urlParams));
}
/**
* Browse all contribution pages.
*
* @param mixed $action
* Unused parameter.
*/
public function browse($action = NULL) {
Civi::resources()->addStyleFile('civicrm', 'css/searchForm.css', 1, 'html-header');
$this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter',
'String',
$this
);
// @todo Unused local variable can be safely removed.
// But are there any side effects of CRM_Utils_Request::retrieve() that we
// need to preserve?
$createdId = CRM_Utils_Request::retrieve('cid', 'Positive',
$this, FALSE, 0
);
if ($this->_sortByCharacter == 'all' ||
!empty($_POST)
) {
$this->_sortByCharacter = '';
$this->set('sortByCharacter', '');
}
$this->search();
$params = [];
$whereClause = $this->whereClause($params, FALSE);
$config = CRM_Core_Config::singleton();
if ($config->includeAlphabeticalPager) {
$this->pagerAToZ($whereClause, $params);
}
$params = [];
$whereClause = $this->whereClause($params, TRUE);
$this->pager($whereClause, $params);
list($offset, $rowCount) = $this->_pager->getOffsetAndRowCount();
//check for delete CRM-4418
$allowToDelete = CRM_Core_Permission::check('delete in CiviContribute');
$query = "
SELECT id
FROM civicrm_contribution_page
WHERE $whereClause
ORDER BY is_active desc, title asc
LIMIT $offset, $rowCount";
$contribPage = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Contribute_DAO_ContributionPage');
$contribPageIds = [];
while ($contribPage->fetch()) {
$contribPageIds[$contribPage->id] = $contribPage->id;
}
//get all section info.
$contriPageSectionInfo = CRM_Contribute_BAO_ContributionPage::getSectionInfo($contribPageIds);
$query = "
SELECT *
FROM civicrm_contribution_page
WHERE $whereClause
ORDER BY is_active desc, title asc
LIMIT $offset, $rowCount";
$dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Contribute_DAO_ContributionPage');
//get all campaigns.
$allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
//get configure actions links.
$configureActionLinks = self::configureActionLinks();
$contributions = [];
while ($dao->fetch()) {
$contributions[$dao->id] = [];
CRM_Core_DAO::storeValues($dao, $contributions[$dao->id]);
// form all action links
$action = array_sum(array_keys(self::actionLinks()));
//add configure actions links.
$action += array_sum(array_keys($configureActionLinks));
//add online contribution links.
$action += array_sum(array_keys(self::onlineContributionLinks()));
//add contribution search links.
$action += array_sum(array_keys(self::contributionLinks()));
if ($dao->is_active) {
$action -= (int) CRM_Core_Action::ENABLE;
}
else {
$action -= (int) CRM_Core_Action::DISABLE;
}
//CRM-4418
if (!$allowToDelete) {
$action -= (int) CRM_Core_Action::DELETE;
}
//build the configure links.
$sectionsInfo = $contriPageSectionInfo[$dao->id] ?? [];
$contributions[$dao->id]['configureActionLinks'] = CRM_Core_Action::formLink(self::formatConfigureLinks($sectionsInfo),
$action,
['id' => $dao->id],
ts('Configure'),
TRUE,
'contributionpage.configure.actions',
'ContributionPage',
$dao->id
);
//build the contributions links.
$contributions[$dao->id]['contributionLinks'] = CRM_Core_Action::formLink(self::contributionLinks(),
$action,
['id' => $dao->id],
ts('Contributions'),
TRUE,
'contributionpage.contributions.search',
'ContributionPage',
$dao->id
);
//build the online contribution links.
$contributions[$dao->id]['onlineContributionLinks'] = CRM_Core_Action::formLink(self::onlineContributionLinks(),
$action,
['id' => $dao->id],
ts('Links'),
TRUE,
'contributionpage.online.links',
'ContributionPage',
$dao->id
);
//build the normal action links.
$contributions[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(),
$action,
['id' => $dao->id, 'key' => CRM_Core_Key::get(CRM_Utils_System::getClassName($this))],
ts('more'),
TRUE,
'contributionpage.action.links',
'ContributionPage',
$dao->id
);
//show campaigns on selector.
$contributions[$dao->id]['campaign'] = $allCampaigns[$dao->campaign_id] ?? NULL;
}
$this->assign('rows', $contributions);
}
public function search() {
if (isset($this->_action) & (CRM_Core_Action::ADD |
CRM_Core_Action::UPDATE |
CRM_Core_Action::DELETE
)
) {
return;
}
$form = new CRM_Core_Controller_Simple('CRM_Contribute_Form_SearchContribution',
ts('Search Contribution'),
CRM_Core_Action::ADD
);
$form->setEmbedded(TRUE);
$form->setParent($this);
$form->process();
$form->run();
}
/**
* @param array $params
* @param bool $sortBy
*
* @return int|string
*/
public function whereClause(&$params, $sortBy = TRUE) {
// @todo Unused local variable can be safely removed.
$values = $clauses = [];
$title = $this->get('title');
$createdId = $this->get('cid');
if ($createdId) {
$clauses[] = "(created_id = {$createdId})";
}
if ($title) {
$clauses[] = "title LIKE %1";
if (strpos($title, '%') !== FALSE) {
$params[1] = [trim($title), 'String', FALSE];
}
else {
$params[1] = [trim($title), 'String', TRUE];
}
}
$value = $this->get('financial_type_id');
$val = [];
if ($value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
if ($v) {
$val[$k] = $k;
}
}
$type = implode(',', $val);
}
// @todo Variable 'type' might not have been defined.
$clauses[] = "financial_type_id IN ({$type})";
}
if ($sortBy && $this->_sortByCharacter !== NULL) {
$clauses[] = "title LIKE '" . strtolower(CRM_Core_DAO::escapeWildCardString($this->_sortByCharacter)) . "%'";
}
$campaignIds = $this->getCampaignIds();
if (count($campaignIds) >= 1) {
$clauses[] = '( campaign_id IN ( ' . implode(' , ', $campaignIds) . ' ) )';
}
if (empty($clauses)) {
// Let template know if user has run a search or not
$this->assign('isSearch', 0);
return 1;
}
else {
$this->assign('isSearch', 1);
}
return implode(' AND ', $clauses);
}
/**
* Gets the campaign ids from the session.
*
* @return int[]
*/
public function getCampaignIds() {
// The unfiltered value from the session cannot be trusted, it needs to be
// processed to get a clean array of positive integers.
$ids = [];
foreach ((array) $this->get('campaign_id') as $id) {
if ((string) (int) $id === (string) $id && $id > 0) {
$ids[] = $id;
}
}
return $ids;
}
/**
* @param $whereClause
* @param array $whereParams
*/
public function pager($whereClause, $whereParams) {
$params['status'] = ts('Contribution %%StatusMessage%%');
$params['csvString'] = NULL;
$params['buttonTop'] = 'PagerTopButton';
$params['buttonBottom'] = 'PagerBottomButton';
$params['rowCount'] = $this->get(CRM_Utils_Pager::PAGE_ROWCOUNT);
if (!$params['rowCount']) {
$params['rowCount'] = Civi::settings()->get('default_pager_size');
}
$query = "
SELECT count(id)
FROM civicrm_contribution_page
WHERE $whereClause";
$params['total'] = CRM_Core_DAO::singleValueQuery($query, $whereParams);
$this->_pager = new CRM_Utils_Pager($params);
$this->assign('pager', $this->_pager);
}
/**
* @param $whereClause
* @param array $whereParams
*/
public function pagerAtoZ($whereClause, $whereParams) {
$query = "
SELECT DISTINCT UPPER(LEFT(title, 1)) as sort_name
FROM civicrm_contribution_page
WHERE $whereClause
ORDER BY UPPER(LEFT(title, 1))
";
$dao = CRM_Core_DAO::executeQuery($query, $whereParams);
$aToZBar = CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_sortByCharacter, TRUE);
$this->assign('aToZ', $aToZBar);
}
/**
* @param array $sectionsInfo
*
* @return array
*/
public function formatConfigureLinks($sectionsInfo) {
// build the formatted configure links.
$formattedConfLinks = self::configureActionLinks();
foreach ($formattedConfLinks as $act => & $link) {
$sectionName = $link['uniqueName'] ?? NULL;
if (!$sectionName) {
continue;
}
if (empty($sectionsInfo[$sectionName])) {
$classes = [];
if (isset($link['class'])) {
$classes = $link['class'];
}
$link['class'] = array_merge($classes, ['crm-disabled']);
}
}
return $formattedConfLinks;
}
}