| 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 |
if (empty($data['lists'])) { ?> |
| 5 |
<h1 class="cell acym__listing__empty__search__title text-center"><?php echo esc_html(acym_translation('ACYM_NO_RESULTS_FOUND')); ?></h1> |
| 6 |
<?php } else { ?> |
| 7 |
<div class="cell grid-x margin-top-1"> |
| 8 |
<div class="grid-x acym__listing__actions cell margin-bottom-1"> |
| 9 |
<?php |
| 10 |
$actions = [ |
| 11 |
'setActive' => acym_translation('ACYM_ENABLE'), |
| 12 |
'setInactive' => acym_translation('ACYM_DISABLE'), |
| 13 |
'delete' => acym_translation('ACYM_DELETE'), |
| 14 |
]; |
| 15 |
acym_listingActions($actions); |
| 16 |
?> |
| 17 |
</div> |
| 18 |
<div class="cell grid-x align-justify"> |
| 19 |
<div class="cell grid-x large-shrink acym_vcenter"> |
| 20 |
<?php |
| 21 |
$options = [ |
| 22 |
'' => ['ACYM_ALL', $data['listNumberPerStatus']['all']], |
| 23 |
'active' => ['ACYM_ACTIVE', $data['listNumberPerStatus']['active']], |
| 24 |
'inactive' => ['ACYM_INACTIVE', $data['listNumberPerStatus']['inactive']], |
| 25 |
'visible' => ['ACYM_VISIBLE', $data['listNumberPerStatus']['visible']], |
| 26 |
'invisible' => ['ACYM_INVISIBLE', $data['listNumberPerStatus']['invisible']], |
| 27 |
]; |
| 28 |
acym_filterStatus($options, $data['status'], 'lists_status'); |
| 29 |
?> |
| 30 |
</div> |
| 31 |
<div class="cell large-shrink acym_listing_sort-by"> |
| 32 |
<?php acym_sortBy( |
| 33 |
[ |
| 34 |
'id' => acym_strtolower(acym_translation('ACYM_ID')), |
| 35 |
'name' => acym_translation('ACYM_NAME'), |
| 36 |
'creation_date' => acym_translation('ACYM_DATE_CREATED'), |
| 37 |
'active' => acym_translation('ACYM_ACTIVE'), |
| 38 |
'visible' => acym_translation('ACYM_VISIBLE'), |
| 39 |
], |
| 40 |
'lists', |
| 41 |
$data['ordering'], |
| 42 |
$data['orderingSortOrder'] |
| 43 |
); ?> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
<?php |
| 48 |
$columnClassesText = acym_isAdmin() ? 'show-for-xxlarge medium-1 xxlarge-2' : 'is-hidden medium-1'; |
| 49 |
$columnClassesIcon = acym_isAdmin() ? 'hide-for-small-only hide-for-xxlarge medium-1 xxlarge-2' : 'hide-for-small-only medium-1'; |
| 50 |
$columnWidthClass = acym_isAdmin() ? 'medium-1 xxlarge-2' : 'medium-1'; |
| 51 |
?> |
| 52 |
<div class="grid-x acym__listing acym__listing__view__list"> |
| 53 |
<div class="grid-x cell acym__listing__header"> |
| 54 |
<div class="medium-shrink small-1 cell"> |
| 55 |
<input id="checkbox_all" type="checkbox" name="checkbox_all"> |
| 56 |
</div> |
| 57 |
<div class="grid-x medium-auto small-11 cell acym__listing__header__title__container"> |
| 58 |
<div class="acym__listing__header__title cell auto"> |
| 59 |
<?php echo esc_html(acym_translation('ACYM_LIST')); ?> |
| 60 |
</div> |
| 61 |
<div class="acym__listing__header__title cell <?php echo esc_attr($columnClassesText); ?> text-center"> |
| 62 |
<?php echo esc_html(acym_translation('ACYM_SUBSCRIBED')); ?> |
| 63 |
</div> |
| 64 |
<div class="acym__listing__header__title cell <?php echo esc_attr($columnClassesIcon); ?> text-center"> |
| 65 |
<?php |
| 66 |
acym_tooltip( |
| 67 |
[ |
| 68 |
'hoveredText' => '<i class="acymicon-user-check"></i>', |
| 69 |
'textShownInTooltip' => acym_translation('ACYM_SUBSCRIBED'), |
| 70 |
] |
| 71 |
); |
| 72 |
?> |
| 73 |
</div> |
| 74 |
<?php if ($this->config->get('require_confirmation', 1) == 1) { ?> |
| 75 |
<div class="acym__listing__header__title cell show-for-xxlarge <?php echo esc_attr($columnClassesText); ?> text-center"> |
| 76 |
<?php echo esc_html(acym_translation('ACYM_NOT_CONFIRMED')); ?> |
| 77 |
</div> |
| 78 |
<div class="acym__listing__header__title cell <?php echo esc_attr($columnClassesIcon); ?> text-center"> |
| 79 |
<?php |
| 80 |
acym_tooltip( |
| 81 |
[ |
| 82 |
'hoveredText' => '<i class="acymicon-hourglass-2"></i>', |
| 83 |
'textShownInTooltip' => acym_translation('ACYM_NOT_CONFIRMED'), |
| 84 |
] |
| 85 |
); |
| 86 |
?> |
| 87 |
</div> |
| 88 |
<?php } ?> |
| 89 |
<div class="acym__listing__header__title cell <?php echo esc_attr($columnClassesText); ?> text-center"> |
| 90 |
<?php echo esc_html(acym_translation('ACYM_UNSUBSCRIBED')); ?> |
| 91 |
</div> |
| 92 |
<div class="acym__listing__header__title cell <?php echo esc_attr($columnClassesIcon); ?> text-center"> |
| 93 |
<?php |
| 94 |
acym_tooltip( |
| 95 |
[ |
| 96 |
'hoveredText' => '<i class="acymicon-user-minus"></i>', |
| 97 |
'textShownInTooltip' => acym_translation('ACYM_UNSUBSCRIBED'), |
| 98 |
] |
| 99 |
); |
| 100 |
?> |
| 101 |
</div> |
| 102 |
<div class="acym__listing__header__title cell <?php echo esc_attr($columnClassesText); ?> text-center"> |
| 103 |
<?php echo esc_html(acym_translation('ACYM_INACTIVE')); ?> |
| 104 |
</div> |
| 105 |
<div class="acym__listing__header__title cell <?php echo esc_attr($columnClassesIcon); ?> text-center"> |
| 106 |
<?php |
| 107 |
acym_tooltip( |
| 108 |
[ |
| 109 |
'hoveredText' => '<i class="acymicon-close"></i>', |
| 110 |
'textShownInTooltip' => acym_translation('ACYM_INACTIVE'), |
| 111 |
] |
| 112 |
); |
| 113 |
?> |
| 114 |
</div> |
| 115 |
<div class="acym__listing__header__title cell hide-for-small-only medium-2 large-1 text-center"> |
| 116 |
<?php echo esc_html(acym_translation('ACYM_STATUS')); ?> |
| 117 |
</div> |
| 118 |
<div class="large-1 cell hide-for-small-only hide-for-medium-only text-center acym__listing__header__title"> |
| 119 |
<?php echo esc_html(acym_translation('ACYM_ACTIONS')); ?> |
| 120 |
</div> |
| 121 |
<div class="acym__listing__header__title cell hide-for-small-only medium-shrink text-center acym__listing__id"> |
| 122 |
<?php echo esc_html(acym_translation('ACYM_ID')); ?> |
| 123 |
</div> |
| 124 |
</div> |
| 125 |
</div> |
| 126 |
<?php foreach ($data['lists'] as $list) { |
| 127 |
$linkList = acym_completeLink(acym_getVar('cmd', 'ctrl').'&task=settings&listId='.intval($list->id)); |
| 128 |
?> |
| 129 |
<div data-acy-elementid="<?php echo esc_attr($list->id); ?>" class="grid-x cell align-middle acym__listing__row"> |
| 130 |
<div class="medium-shrink small-1 cell"> |
| 131 |
<input id="checkbox_<?php echo esc_attr($list->id); ?>" type="checkbox" name="elements_checked[]" value="<?php echo esc_attr($list->id); ?>"> |
| 132 |
</div> |
| 133 |
<div class="grid-x medium-auto small-11 cell acym__listing__title__container"> |
| 134 |
<div class="cell auto grid-x acym__listing__title"> |
| 135 |
<i class='cell shrink acymicon-circle' style="color:<?php echo esc_attr($list->color ?? '#4A412A'); ?>"></i> |
| 136 |
<a class="cell auto" href="<?php echo esc_url($linkList); ?>"> |
| 137 |
<?php |
| 138 |
echo '<h6 class="acym__listing__title__primary">'.esc_html($list->name).'</h6>'; |
| 139 |
echo '<p class="acym__listing__title__secondary" title="'.esc_attr($list->description).'">'.esc_html($list->description).'</p>'; |
| 140 |
?> |
| 141 |
</a> |
| 142 |
</div> |
| 143 |
<div class="small-1 <?php echo esc_attr($columnWidthClass); ?> text-center small-up-1 cell"> |
| 144 |
<?php |
| 145 |
acym_tooltip( |
| 146 |
[ |
| 147 |
'hoveredText' => $list->sendable_users, |
| 148 |
'textShownInTooltip' => acym_translation('ACYM_SUBSCRIBED'), |
| 149 |
] |
| 150 |
); |
| 151 |
|
| 152 |
if (!empty($list->newSub)) { |
| 153 |
acym_tooltip( |
| 154 |
[ |
| 155 |
'hoveredText' => ' <span class="acym__listing__evol-green">(+'.$list->newSub.')</span>', |
| 156 |
'textShownInTooltip' => acym_translation('ACYM_EVOL_SUB'), |
| 157 |
] |
| 158 |
); |
| 159 |
} ?> |
| 160 |
</div> |
| 161 |
<?php if ($this->config->get('require_confirmation', 1) == 1) { ?> |
| 162 |
<div class="small-1 <?php echo esc_attr($columnWidthClass); ?> text-center small-up-1 cell"> |
| 163 |
<?php |
| 164 |
acym_tooltip( |
| 165 |
[ |
| 166 |
'hoveredText' => $list->unconfirmed_users, |
| 167 |
'textShownInTooltip' => acym_translation('ACYM_NOT_CONFIRMED'), |
| 168 |
] |
| 169 |
); |
| 170 |
?> |
| 171 |
</div> |
| 172 |
<?php } ?> |
| 173 |
<div class="small-1 <?php echo esc_attr($columnWidthClass); ?> text-center small-up-1 cell"> |
| 174 |
<?php |
| 175 |
acym_tooltip( |
| 176 |
[ |
| 177 |
'hoveredText' => $list->unsubscribed_users, |
| 178 |
'textShownInTooltip' => acym_translation('ACYM_UNSUBSCRIBED'), |
| 179 |
] |
| 180 |
); |
| 181 |
?> |
| 182 |
<?php |
| 183 |
if (!empty($list->newUnsub)) { |
| 184 |
acym_tooltip( |
| 185 |
[ |
| 186 |
'hoveredText' => ' <span class="acym__listing__evol-red">(+'.$list->newUnsub.')</span>', |
| 187 |
'textShownInTooltip' => acym_translation('ACYM_EVOL_UNSUB'), |
| 188 |
] |
| 189 |
); |
| 190 |
} ?> |
| 191 |
</div> |
| 192 |
<div class="small-1 <?php echo esc_attr($columnWidthClass); ?> text-center small-up-1 cell"> |
| 193 |
<?php |
| 194 |
acym_tooltip( |
| 195 |
[ |
| 196 |
'hoveredText' => $list->inactive_users, |
| 197 |
'textShownInTooltip' => acym_translation('ACYM_INACTIVE'), |
| 198 |
] |
| 199 |
); |
| 200 |
?> |
| 201 |
</div> |
| 202 |
<div class="cell small-1 medium-2 large-1 text-center acym__listing__controls acym__lists__controls acym__icon__table"> |
| 203 |
<?php |
| 204 |
if ($list->active == 1) { |
| 205 |
$class = 'acymicon-check-circle acym__color__green'; |
| 206 |
$newvalue = 0; |
| 207 |
$tooltip = 'ACYM_ACTIVE'; |
| 208 |
} else { |
| 209 |
$class = 'acymicon-times-circle acym__color__red'; |
| 210 |
$newvalue = 1; |
| 211 |
$tooltip = 'ACYM_INACTIVE'; |
| 212 |
} |
| 213 |
acym_tooltip( |
| 214 |
[ |
| 215 |
'hoveredText' => '<i data-acy-table="list" data-acy-field="active" data-acy-elementid="'.esc_attr( |
| 216 |
$list->id |
| 217 |
).'" data-acy-newvalue="'.esc_attr($newvalue).'" class="acym_toggleable '.esc_attr($class).'"></i>', |
| 218 |
'textShownInTooltip' => acym_translation($tooltip), |
| 219 |
] |
| 220 |
); |
| 221 |
|
| 222 |
if (acym_isAdmin()) { |
| 223 |
if ($list->visible == 1) { |
| 224 |
$class = 'acymicon-eye'; |
| 225 |
$newvalue = 0; |
| 226 |
$tooltip = 'ACYM_VISIBLE'; |
| 227 |
} else { |
| 228 |
$class = 'acymicon-eye-slash acym__color__dark-gray'; |
| 229 |
$newvalue = 1; |
| 230 |
$tooltip = 'ACYM_INVISIBLE'; |
| 231 |
} |
| 232 |
acym_tooltip( |
| 233 |
[ |
| 234 |
'hoveredText' => '<i data-acy-table="list" data-acy-field="visible" data-acy-elementid="'.esc_attr( |
| 235 |
$list->id |
| 236 |
).'" data-acy-newvalue="'.esc_attr($newvalue).'" class="acym_toggleable '.esc_attr($class).'"></i>', |
| 237 |
'textShownInTooltip' => acym_translation($tooltip), |
| 238 |
] |
| 239 |
); |
| 240 |
} |
| 241 |
?> |
| 242 |
</div> |
| 243 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center acym__icon__table"> |
| 244 |
<a href="<?php echo esc_url($linkList); ?>"><i class="acymicon-pencil" title="<?php echo esc_attr(acym_translation('ACYM_EDIT')); ?>"></i></a> |
| 245 |
<?php if (acym_isAdmin()) { ?> |
| 246 |
<a><i class="acymicon-download fastActions" |
| 247 |
data-action="export" |
| 248 |
data-ctrl="users" |
| 249 |
data-acy-elementid="<?php echo esc_attr($list->id); ?>" |
| 250 |
title="<?php echo esc_attr(acym_translation('ACYM_EXPORT')); ?>"></i></a> |
| 251 |
<?php } ?> |
| 252 |
<i class="cursor-pointer acymicon-delete fastActions deleteFastAction" |
| 253 |
data-action="delete" |
| 254 |
data-acy-elementid="<?php echo esc_attr($list->id); ?>" |
| 255 |
title="<?php echo esc_attr(acym_translation('ACYM_DELETE')); ?>"></i> |
| 256 |
</div> |
| 257 |
<div class="medium-shrink hide-for-small-only text-center acym__listing__id"> |
| 258 |
<?php echo esc_html($list->id); ?> |
| 259 |
</div> |
| 260 |
</div> |
| 261 |
</div> |
| 262 |
<?php } ?> |
| 263 |
</div> |
| 264 |
<?php $data['pagination']->display('lists'); ?> |
| 265 |
<?php } ?> |
| 266 |
|