| 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 |
<form id="acym_form" action="<?php echo esc_url(acym_completeLink(acym_getVar('cmd', 'ctrl'))); ?>" method="post" name="acySegments" data-abide novalidate> |
| 6 |
<?php |
| 7 |
foreach ($data['filter_option'] as $key => $filterHtml) { |
| 8 |
if (empty($key)) { |
| 9 |
continue; |
| 10 |
} |
| 11 |
?> |
| 12 |
<template id="acym__segments__edit__info__template__<?php echo esc_attr($key); ?>"> |
| 13 |
<?php echo $filterHtml; ?> |
| 14 |
</template> |
| 15 |
<?php } ?> |
| 16 |
<input type="hidden" value="<?php echo empty($data['segment']->id) ? '' : esc_attr($data['segment']->id); ?>" name="segmentId"> |
| 17 |
<input type="hidden" id="acym__segments__filters" value="<?php echo esc_attr(empty($data['segment']->filters) ? '' : json_encode($data['segment']->filters)); ?>"> |
| 18 |
<input type="hidden" id="acym__segments__filters__count__and" value="0"> |
| 19 |
<div class="cell grid-x grid-margin-x acym__segments__edit__info acym__content margin-bottom-1 padding-bottom-0 margin-y margin-left-0 margin-right-0"> |
| 20 |
<div class="cell large-4 medium-6 grid-x grid-margin-x acym_vcenter"> |
| 21 |
<label for="acym__segments__edit__info__name" class="cell shrink"><?php echo esc_html(acym_translation('ACYM_SEGMENT_NAME')); ?></label> |
| 22 |
<input required |
| 23 |
type="text" |
| 24 |
name="segment[name]" |
| 25 |
class="cell auto" |
| 26 |
id="acym__segments__edit__info__name" |
| 27 |
value="<?php echo empty($data['segment']->name) ? '' : esc_attr($data['segment']->name); ?>"> |
| 28 |
</div> |
| 29 |
<div class="cell large-3 medium-6 grid-x grid-margin-x acym_vcenter"> |
| 30 |
<?php acym_switch([ |
| 31 |
'name' => 'segment[active]', |
| 32 |
'value' => $data['segment']->active, |
| 33 |
'label' => acym_translation('ACYM_ACTIVE'), |
| 34 |
'labelClass' => 'shrink', |
| 35 |
]); ?> |
| 36 |
</div> |
| 37 |
<div class="cell large-5 align-right grid-x grid-margin-x acym__segments__edit__info__actions margin-y margin-bottom-0"> |
| 38 |
<?php acym_cancelButton(); ?> |
| 39 |
<button data-before-action="segmentSave" class="cell large-shrink medium-6 button acy_button_submit button-secondary" data-task="apply"> |
| 40 |
<?php echo esc_html(acym_translation('ACYM_SAVE')); ?> |
| 41 |
</button> |
| 42 |
<button data-before-action="segmentSave" class="cell large-shrink medium-6 button acy_button_submit" data-task="save"> |
| 43 |
<?php echo esc_html(acym_translation('ACYM_SAVE_EXIT')); ?> |
| 44 |
</button> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
<div class="cell grid-x acym__segments__edit__filters acym__content"> |
| 48 |
<?php include acym_getView('segments', 'edit_filters'); ?> |
| 49 |
</div> |
| 50 |
<?php acym_formOptions(); ?> |
| 51 |
</form> |
| 52 |
|