PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.2.2
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.2.2
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 / front / Params / lists.php

lists.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.2.2, at front/Params/lists.php

61 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use AcyMailing\Classes\ListClass;
4
5 include_once __DIR__.DIRECTORY_SEPARATOR.'AcymJFormField.php';
6
7 class JFormFieldLists extends AcymJFormField
8 {
9 var $type = 'lists';
10
11 public $value;
12
13 public function getInput()
14 {
15
16 $listClass = new ListClass();
17 $lists = $listClass->getAllWithoutManagement();
18 foreach ($lists as $i => $oneList) {
19 if ($oneList->active == 0) {
20 unset($lists[$i]);
21 }
22 }
23
24 if (ACYM_CMS == 'joomla' && $this->value == 'All' && !empty($this->form)) {
25 $formId = $this->form->getData()->get('id');
26 if (!empty($formId)) {
27 $this->value = '';
28 }
29 }
30
31 if (is_string($this->value)) {
32 $this->value = explode(',', $this->value);
33 }
34
35 if (in_array('None', $this->value)) {
36 $this->value = [];
37 }
38 if (in_array('All', $this->value)) {
39 $visibleLists = [];
40 foreach ($lists as $listId => $oneList) {
41 if ($oneList->visible == 0) continue;
42
43 $visibleLists[] = $listId;
44 }
45 $this->value = $visibleLists;
46 }
47
48 return acym_selectMultiple(
49 $lists,
50 $this->name,
51 $this->value,
52 [
53 'class' => 'acym_simple_select2',
54 'id' => $this->name,
55 ],
56 'id',
57 'name'
58 );
59 }
60 }
61