| 1 |
<?php $this->layout('layouts/default'); ?> |
| 2 |
|
| 3 |
<?php $data = \Asylum\Utility\Arr::undot($data); ?> |
| 4 |
<div class="ag-row"> |
| 5 |
<?php foreach ($data['sections'] ?? [] as $key => $section) : ?> |
| 6 |
<div class="ag-col"> |
| 7 |
<?php |
| 8 |
switch ($key) { |
| 9 |
case 'set_content': |
| 10 |
/* translators: Indivdual content label */ |
| 11 |
$label = __('Restrict/Bypass indiviual content', 'age-gate'); |
| 12 |
break; |
| 13 |
case 'set_age': |
| 14 |
/* translators: Indivdual age label */ |
| 15 |
$label = __('Change age for indiviual content', 'age-gate'); |
| 16 |
break; |
| 17 |
case 'reset': |
| 18 |
case 'export': |
| 19 |
case 'import': |
| 20 |
/* translators: Permission label. %s name of the setting */ |
| 21 |
$label = sprintf(__('User can %s all settings', 'age-gate'), $key); |
| 22 |
break; |
| 23 |
default: |
| 24 |
/* translators: Permission label. %s name of the setting */ |
| 25 |
$label = sprintf(__('Manage %s settings', 'age-gate'), $key); |
| 26 |
break; |
| 27 |
} |
| 28 |
?> |
| 29 |
|
| 30 |
<p><?php echo esc_html($label) ?></p> |
| 31 |
<?php foreach ($data['roles'] as $slug => $role) : ?> |
| 32 |
<?php if ($slug !== 'administrator') : ?> |
| 33 |
<div> |
| 34 |
<label class="ag-switch"> |
| 35 |
<input type="checkbox" name="ag_settings[<?php echo esc_attr($key); ?>][<?php echo esc_attr($slug) ?>]" value="1" <?php echo(($role['capabilities'][$section] ?? false) ? 'checked' : '') ?> /> |
| 36 |
<span class="ag-switch__slider"></span> |
| 37 |
</label> |
| 38 |
<?php echo esc_html($role['name']) ?> |
| 39 |
</div> |
| 40 |
<?php endif; ?> |
| 41 |
<?php endforeach; ?> |
| 42 |
</div> |
| 43 |
<?php endforeach; ?> |
| 44 |
</div> |
| 45 |
|