| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Views class for Shortcode generator options. |
| 5 |
* |
| 6 |
* @link https://themeatelier.net |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @package darkify |
| 10 |
* @subpackage darkify/src/Admin/Views/Control |
| 11 |
* @author ThemeAtelier<themeatelierbd@gmail.com> |
| 12 |
*/ |
| 13 |
|
| 14 |
namespace ThemeAtelier\Darkify\Admin\Views; |
| 15 |
|
| 16 |
use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify; |
| 17 |
|
| 18 |
class Control |
| 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 |
Darkify::createSection( |
| 29 |
$prefix, |
| 30 |
array( |
| 31 |
'title' => esc_html__('CONTROL', 'darkify'), |
| 32 |
'icon' => 'icofont-ui-settings', |
| 33 |
'fields' => array( |
| 34 |
array( |
| 35 |
'type' => 'heading', |
| 36 |
'content' => esc_html__('Basic Control', 'darkify'), |
| 37 |
), |
| 38 |
array( |
| 39 |
'id' => 'enable_dark_mode_switch', |
| 40 |
'type' => 'switcher', |
| 41 |
'title' => esc_html__('Enable or Disable Frontend Dark Mode Switch', 'darkify'), |
| 42 |
'desc' => esc_html__('Switch to show the Dark Mode Floating Switch in your Websites frontend.', 'darkify'), |
| 43 |
'text_on' => esc_html__('Enabled', 'darkify-pro'), |
| 44 |
'text_off' => esc_html__('Disabled', 'darkify-pro'), |
| 45 |
'text_width' => 100, |
| 46 |
'default' => true, |
| 47 |
), |
| 48 |
array( |
| 49 |
'id' => 'enable_default_dark_mode', |
| 50 |
'type' => 'switcher', |
| 51 |
'title' => esc_html__('Enable or Disable Default Dark Mode', 'darkify'), |
| 52 |
'desc' => esc_html__('Switch to automatically turn your website dark by default.', 'darkify'), |
| 53 |
'text_on' => esc_html__('Enabled', 'darkify-pro'), |
| 54 |
'text_off' => esc_html__('Disabled', 'darkify-pro'), |
| 55 |
'text_width' => 100, |
| 56 |
), |
| 57 |
array( |
| 58 |
'id' => 'enable_os_aware', |
| 59 |
'type' => 'switcher', |
| 60 |
'title' => esc_html__('Enable or Disable OS Aware Dark Mode', 'darkify'), |
| 61 |
'desc' => esc_html__('Switch to enable or disable dark mode automatically according to users’ device preference.', 'darkify'), |
| 62 |
'text_on' => esc_html__('Enabled', 'darkify-pro'), |
| 63 |
'text_off' => esc_html__('Disabled', 'darkify-pro'), |
| 64 |
'text_width' => 100, |
| 65 |
'default' => true, |
| 66 |
), |
| 67 |
array( |
| 68 |
'id' => 'enable_keyboard_shortcut', |
| 69 |
'type' => 'switcher', |
| 70 |
'title' => esc_html__('Enable or Disable Keyboard Shortcut', 'darkify'), |
| 71 |
'desc' => esc_html__('Switch to turn ON or OFF dark mode by pressing Ctrl+Alt+D on keyboard.', 'darkify'), |
| 72 |
'text_on' => esc_html__('Enabled', 'darkify-pro'), |
| 73 |
'text_off' => esc_html__('Disabled', 'darkify-pro'), |
| 74 |
'text_width' => 100, |
| 75 |
'default' => true, |
| 76 |
), |
| 77 |
array( |
| 78 |
'type' => 'heading', |
| 79 |
'content' => esc_html__('Advanced Control', 'darkify'), |
| 80 |
), |
| 81 |
|
| 82 |
// Enable Time Based Auto Dark Mode |
| 83 |
array( |
| 84 |
'id' => 'enable_time', |
| 85 |
'type' => 'fieldset', |
| 86 |
'fields' => array( |
| 87 |
array( |
| 88 |
'id' => 'enable_time_based_dark', |
| 89 |
'type' => 'switcher', |
| 90 |
'title' => esc_html__('Enable or Disable Time Based Auto Dark Mode', 'darkify'), |
| 91 |
'desc' => esc_html__('Automatically turn dark mode ON based on users’ localtime.', 'darkify'), |
| 92 |
'text_on' => esc_html__('Enabled', 'darkify-pro'), |
| 93 |
'text_off' => esc_html__('Disabled', 'darkify-pro'), |
| 94 |
'text_width' => 100, |
| 95 |
), |
| 96 |
array( |
| 97 |
'id' => 'time_based_dark_start', |
| 98 |
'type' => 'datetime', |
| 99 |
'title' => esc_html__('Pick a Time', 'darkify'), |
| 100 |
'from_to' => true, |
| 101 |
'text_from' => esc_html__('Form', 'darkify'), |
| 102 |
'text_to' => esc_html__('To', 'darkify'), |
| 103 |
'settings' => array( |
| 104 |
'noCalendar' => true, |
| 105 |
'enableTime' => true, |
| 106 |
'dateFormat' => 'H:i', |
| 107 |
'time_24hr' => false, |
| 108 |
), |
| 109 |
'dependency' => array('enable_time_based_dark', '==', 'true'), |
| 110 |
), |
| 111 |
), |
| 112 |
), |
| 113 |
array( |
| 114 |
'id' => 'hide_on_desktop', |
| 115 |
'type' => 'switcher', |
| 116 |
'title' => esc_html__('Show or Hide Dark Mode Switch on Desktop', 'darkify'), |
| 117 |
'desc' => esc_html__('Switch to hide the Dark Mode Floating Switch if users’ are using desktop or laptop.', 'darkify'), |
| 118 |
'text_on' => esc_html__('Show', 'darkify-pro'), |
| 119 |
'text_off' => esc_html__('Hide', 'darkify-pro'), |
| 120 |
'text_width' => 80, |
| 121 |
), |
| 122 |
array( |
| 123 |
'id' => 'hide_on_mobile', |
| 124 |
'type' => 'fieldset', |
| 125 |
'fields' => array( |
| 126 |
array( |
| 127 |
'id' => 'hide_dark_mode_on_mobile', |
| 128 |
'type' => 'switcher', |
| 129 |
'title' => esc_html__('Show or Hide Dark Mode on Mobile', 'darkify'), |
| 130 |
'desc' => esc_html__('Switch to hide the Dark Mode Floating Switch if users’ are using mobile.', 'darkify'), |
| 131 |
'text_on' => esc_html__('Show', 'darkify-pro'), |
| 132 |
'text_off' => esc_html__('Hide', 'darkify-pro'), |
| 133 |
'text_width' => 80, |
| 134 |
), |
| 135 |
array( |
| 136 |
'id' => 'type_of_hide_by', |
| 137 |
'type' => 'select', |
| 138 |
'title' => esc_html__('Type of Hide By', 'darkify'), |
| 139 |
'options' => array( |
| 140 |
'user_agent' => esc_html__('Hide by User Agent', 'darkify'), |
| 141 |
'screen_size' => esc_html__('Hide by Screen Size', 'darkify'), |
| 142 |
'both' => esc_html__('Hide by Both', 'darkify'), |
| 143 |
), |
| 144 |
'default' => 'both', |
| 145 |
'dependency' => array('hide_dark_mode_on_mobile', '==', 'true'), |
| 146 |
), |
| 147 |
), |
| 148 |
), |
| 149 |
|
| 150 |
array( |
| 151 |
'id' => 'show_in_menu', |
| 152 |
'type' => 'fieldset', |
| 153 |
'fields' => array( |
| 154 |
array( |
| 155 |
'id' => 'enable_switch_in_menu', |
| 156 |
'type' => 'switcher', |
| 157 |
'title' => esc_html__('Show or Hide Switch in Menu', 'darkify'), |
| 158 |
'desc' => esc_html__('Show the dark mode toggle switch in specific menu.', 'darkify'), |
| 159 |
'text_on' => esc_html__('Show', 'darkify-pro'), |
| 160 |
'text_off' => esc_html__('Hide', 'darkify-pro'), |
| 161 |
'text_width' => 80, |
| 162 |
), |
| 163 |
array( |
| 164 |
'id' => 'switch_in_menu_location', |
| 165 |
'type' => 'select', |
| 166 |
'title' => esc_html__('Select Menu', 'darkify'), |
| 167 |
'options' => 'menus', |
| 168 |
'dependency' => array('enable_switch_in_menu', '==', 'true'), |
| 169 |
), |
| 170 |
array( |
| 171 |
'id' => 'darkify_menu_shortcode_helper', |
| 172 |
'type' => 'textarea', |
| 173 |
'title' => esc_html__('Short Code menu', 'darkify'), |
| 174 |
'desc' => esc_html__('You can generate customized switch shortcode from SWITCH STYLE > Advanced Customization.', 'darkify'), |
| 175 |
'dependency' => array('enable_switch_in_menu', '==', 'true'), |
| 176 |
'default' => '[darkify switch="1" width_height="60px" border_radius="7px" icon_size="40px" light_mode_bg="#121116" dark_mode_bg="#ffffff" light_mode_color="#ffffff" dark_mode_color="#121116"]' |
| 177 |
), |
| 178 |
), |
| 179 |
), |
| 180 |
), |
| 181 |
), |
| 182 |
); |
| 183 |
} |
| 184 |
} |
| 185 |
|