PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.1
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
← All changes | front/Params/fields.php +0 -57 11.0.2 → 11.1.1 View file →
@@ -1,57 +1,0 @@
1 -<?php
2 -defined('ABSPATH') || die('Restricted Access');
3 -
4 -use AcyMailing\Classes\FieldClass;
5 -
6 -include_once __DIR__.DIRECTORY_SEPARATOR.'AcymJFormField.php';
7 -
8 -// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Joomla specific class naming with imposed prefix "JFormField".
9 -class JFormFieldFields extends AcymJFormField
10 -{
11 - public function __construct($form = null)
12 - {
13 - $this->type = 'fields';
14 - parent::__construct($form);
15 - }
16 -
17 - public function getInput()
18 - {
19 -
20 - $fieldsClass = new FieldClass();
21 - $allFields = $fieldsClass->getAllFieldsForModuleFront();
22 - $fields = [];
23 - foreach ($allFields as $field) {
24 - $fields[$field->id] = acym_translation($field->name);
25 - }
26 -
27 -
28 - // In Joomla, when the user chooses to empty a field, it sets the default value of this field... that's not what we want
29 - if (ACYM_CMS == 'joomla' && $this->value == '1') {
30 - $formId = $this->form->getData()->get('id');
31 - if (!empty($formId)) {
32 - $this->value = '';
33 - }
34 - }
35 -
36 - if (is_string($this->value)) {
37 - $this->value = explode(',', $this->value);
38 - }
39 -
40 - if (in_array('None', $this->value)) {
41 - $this->value = [];
42 - }
43 - if (in_array('All', $this->value)) {
44 - $this->value = array_keys($fields);
45 - }
46 -
47 - return acym_selectMultiple(
48 - $fields,
49 - $this->name,
50 - $this->value,
51 - [
52 - 'class' => 'acym_simple_select2',
53 - 'id' => $this->name,
54 - ]
55 - );
56 - }
57 -}