PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Types / AclType.php

AclType.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 11.1.0, at back/Types/AclType.php

46 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\Types;
4
5 use AcyMailing\Core\AcymObject;
6
7 class AclType extends AcymObject
8 {
9 private array $groups;
10
11 public function __construct()
12 {
13 parent::__construct();
14
15 $this->groups = acym_getGroups();
16
17 $allGroups = new \stdClass();
18 $allGroups->value = 'all';
19 $allGroups->text = acym_translation('ACYM_ALL');
20
21 $seprator = new \stdClass();
22 $seprator->value = '';
23 $seprator->text = '-----------------------------';
24 $seprator->disable = true;
25 array_unshift($this->groups, $seprator);
26 array_unshift($this->groups, $allGroups);
27 }
28
29 public function display(string $page): void
30 {
31 $name = 'acl_'.$page;
32
33 $selected = explode(',', $this->config->get($name, ACYM_ADMIN_GROUP));
34
35 acym_selectMultiple(
36 $this->groups,
37 'config['.$name.']',
38 $selected,
39 ['class' => 'acym__select'],
40 'value',
41 'text',
42 true
43 );
44 }
45 }
46