| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. |
| 3 |
defined('ABSPATH') || die('Restricted Access'); |
| 4 |
|
| 5 |
use AcyMailing\Classes\TagClass; |
| 6 |
|
| 7 |
?> |
| 8 |
<form id="acym_form" action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>" method="post" name="acyForm" data-abide novalidate> |
| 9 |
<input type="hidden" name="id" value="<?php echo empty($data['id']) ? '' : intval($data['id']); ?>"> |
| 10 |
<input type="hidden" name="actionId" value="<?php echo empty($data['action']->id) ? '' : intval($data['action']->id); ?>"> |
| 11 |
<input type="hidden" name="conditionId" value="<?php echo empty($data['condition']->id) ? '' : intval($data['condition']->id); ?>"> |
| 12 |
<input type="hidden" name="stepAutomationId" value="<?php echo empty($data['step_automation_id']) ? '' : intval($data['step_automation_id']); ?>"> |
| 13 |
<input type="hidden" id="actions" value="<?php echo esc_attr($data['action']->actions); ?>"> |
| 14 |
<input type="hidden" id="adminAutomation" name="automation_admin" value="<?php echo empty($data['automation']->admin) ? 0 : 1; ?>"> |
| 15 |
<input type="hidden" id="acym__automation__action__number__action" value="0"> |
| 16 |
|
| 17 |
<div style="display: none"> |
| 18 |
<?php |
| 19 |
$dataForTemplate = ['allTags' => $data['tagClass']->getAllTagsByType(TagClass::TYPE_MAIL)]; |
| 20 |
acym_modalInclude( |
| 21 |
'', |
| 22 |
ACYM_VIEW.'Mails'.DS.'tmpl'.DS.'choose_template_ajax.php', |
| 23 |
'acym__template__choose__modal', |
| 24 |
$dataForTemplate, |
| 25 |
'acym__template__choose__modal__listing' |
| 26 |
); |
| 27 |
?> |
| 28 |
</div> |
| 29 |
|
| 30 |
<div class="acym__content grid-x cell" id="acym__automation__actions"> |
| 31 |
<?php |
| 32 |
$data['workflowHelper']->display($this->steps, 'action'); |
| 33 |
?> |
| 34 |
<div id="acym__automation__example" style="display: none"> |
| 35 |
<div class="acym__automation__actions__one__action cell grid-x"> |
| 36 |
<div class="acym__automation__and cell grid-x margin-top-2"> |
| 37 |
<h6 class="cell medium-shrink small-11 acym__title acym__title__secondary"><?php echo esc_html(acym_translation('ACYM_AND')); ?></h6> |
| 38 |
<div class="cell medium-4 hide-for-small-only"></div> |
| 39 |
<i class="cell medium-shrink small-1 cursor-pointer acymicon-close acym__color__red acym__automation__delete__one__action"></i> |
| 40 |
</div> |
| 41 |
<div class="medium-5 cell"> |
| 42 |
<?php |
| 43 |
acym_select( |
| 44 |
$data['actionsOption'], |
| 45 |
'action_name', |
| 46 |
null, |
| 47 |
['class' => 'acym__automation__actions__select'], |
| 48 |
'value', |
| 49 |
'text', |
| 50 |
null, |
| 51 |
false, |
| 52 |
true |
| 53 |
); |
| 54 |
?> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
<?php |
| 59 |
foreach ($data['actions'] as $key => $action) { |
| 60 |
if (empty($key)) { |
| 61 |
continue; |
| 62 |
} |
| 63 |
?> |
| 64 |
<template id="acym__automation__actions__template__<?php echo esc_attr($key); ?>"> |
| 65 |
<?php acym_displayAddonOption($action); ?> |
| 66 |
</template> |
| 67 |
<?php } ?> |
| 68 |
<h6 class="acym__title acym__title__secondary cell"><?php echo esc_html(acym_translation('ACYM_SELECT_YOUR_ACTIONS')); ?></h6> |
| 69 |
<div class="cell grid-x acym__content"> |
| 70 |
<div class="acym__automation__actions__one__action cell grid-x" data-action-number="0"> |
| 71 |
<div class="medium-5 cell"> |
| 72 |
<?php acym_select( |
| 73 |
$data['actionsOption'], |
| 74 |
'action_name', |
| 75 |
null, |
| 76 |
['class' => 'acym__select acym__automation__actions__select'], |
| 77 |
'value', |
| 78 |
'text', |
| 79 |
null, |
| 80 |
false, |
| 81 |
true |
| 82 |
); ?> |
| 83 |
</div> |
| 84 |
</div> |
| 85 |
<button data-filter-type="" type="button" class="button-secondary button medium-shrink acym__automation__add-action margin-top-2"> |
| 86 |
<?php echo esc_html(acym_translation('ACYM_ADD_ACTION')); ?> |
| 87 |
</button> |
| 88 |
</div> |
| 89 |
<div class="cell grid-x grid-margin-x margin-top-2"> |
| 90 |
<?php if (empty($data['id'])) { ?> |
| 91 |
<div class="cell medium-auto grid-x grid-margin-x text-right"> |
| 92 |
<div class="cell auto"></div> |
| 93 |
<button type="button" class="button button-secondary acy_button_submit medium-shrink cell" data-task="listing"> |
| 94 |
<?php echo esc_html(acym_translation('ACYM_CANCEL')); ?> |
| 95 |
</button> |
| 96 |
<button type="button" class="button acy_button_submit medium-shrink cell" data-task="edit" data-step="setActionMassAction"> |
| 97 |
<?php echo esc_html(acym_translation('ACYM_SET_ACTIONS_TARGETS')); ?> |
| 98 |
</button> |
| 99 |
</div> |
| 100 |
<?php } else { ?> |
| 101 |
<div class="cell medium-shrink medium-margin-bottom-0 margin-bottom-1 text-left"> |
| 102 |
<?php acym_backToListing('automation'); ?> |
| 103 |
</div> |
| 104 |
<div class="cell medium-auto grid-x grid-margin-x text-right"> |
| 105 |
<div class="cell auto"></div> |
| 106 |
<button type="button" |
| 107 |
class="cell button button-secondary medium-shrink medium-margin-bottom-0 margin-bottom-1 acy_button_submit" |
| 108 |
data-task="edit" |
| 109 |
data-step="saveExitActions"> |
| 110 |
<?php echo esc_html(acym_translation('ACYM_SAVE_EXIT')); ?> |
| 111 |
</button> |
| 112 |
<button type="button" class="cell button medium-shrink medium-margin-bottom-0 acy_button_submit" data-task="edit" data-step="saveActions"> |
| 113 |
<?php echo esc_html(acym_translation('ACYM_SAVE_CONTINUE')); ?> |
| 114 |
</button> |
| 115 |
</div> |
| 116 |
<?php } ?> |
| 117 |
</div> |
| 118 |
</div> |
| 119 |
<?php acym_formOptions(); ?> |
| 120 |
</form> |
| 121 |
|