| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Tools class for Tools options. |
| 5 |
* |
| 6 |
* @link https://themeatelier.net |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @package darkify |
| 10 |
* @subpackage darkify/src/Admin/Views/Tools |
| 11 |
* @author ThemeAtelier<themeatelierbd@gmail.com> |
| 12 |
*/ |
| 13 |
|
| 14 |
namespace ThemeAtelier\Darkify\Admin\Views; |
| 15 |
|
| 16 |
use ThemeAtelier\Darkify\Admin\Schema\SchemaRegistry; |
| 17 |
|
| 18 |
class Tools |
| 19 |
{ |
| 20 |
/** |
| 21 |
* Create Option fields for the setting options. |
| 22 |
* |
| 23 |
* @param string $prefix Option setting key prefix. |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
public static function options($prefix) |
| 27 |
{ |
| 28 |
SchemaRegistry::createSection( |
| 29 |
$prefix, |
| 30 |
array( |
| 31 |
'id' => 'tools', |
| 32 |
'title' => esc_html__('Tools', 'darkify'), |
| 33 |
'icon' => 'icofont-holding-hands', |
| 34 |
'fields' => array( |
| 35 |
// Intro line, rendered plain above the section cards. |
| 36 |
array( |
| 37 |
'type' => 'page_hint', |
| 38 |
'content' => esc_html__('Maintenance, backup, and restore utilities.', 'darkify'), |
| 39 |
), |
| 40 |
// ===== DATA ===== |
| 41 |
array( |
| 42 |
'type' => 'heading', |
| 43 |
'title' => esc_html__('Data', 'darkify'), |
| 44 |
'section_start' => true, |
| 45 |
), |
| 46 |
array( |
| 47 |
'id' => 'darkify_data_remove', |
| 48 |
'type' => 'switcher', |
| 49 |
'title' => esc_html__('Clean-up Data on Deletion', 'darkify'), |
| 50 |
'title_help' => |
| 51 |
'<div class="darkify-info-label">' . |
| 52 |
esc_html__('Enable this option to completely remove all Darkify data when the plugin is deleted.', 'darkify') . |
| 53 |
'</div>', |
| 54 |
'text_on' => esc_html__('Enabled', 'darkify'), |
| 55 |
'text_off' => esc_html__('Disabled', 'darkify'), |
| 56 |
'text_width' => 100, |
| 57 |
), |
| 58 |
// ===== BACKUP & RESTORE ===== |
| 59 |
array( |
| 60 |
'type' => 'heading', |
| 61 |
'title' => esc_html__('Backup & Restore', 'darkify'), |
| 62 |
'section_start' => true, |
| 63 |
), |
| 64 |
array( |
| 65 |
'title' => esc_html__('Backup and Restore Settings', 'darkify'), |
| 66 |
'title_help' => |
| 67 |
'<div class="darkify-info-label">' . |
| 68 |
esc_html__('Use these options to back up your settings for safekeeping or restore them when needed. You can export your current settings as a .json file and import it anytime to restore your configuration.', 'darkify') . |
| 69 |
'</div>', |
| 70 |
'type' => 'backup', |
| 71 |
), |
| 72 |
), |
| 73 |
) |
| 74 |
); |
| 75 |
} |
| 76 |
} |
| 77 |
|