*/
namespace ThemeAtelier\Darkify\Admin\Views;
use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify;
class Control
{
/**
* Create Option fields for the setting options.
*
* @param string $prefix Option setting key prefix.
* @return void
*/
public static function options($prefix)
{
Darkify::createSection(
$prefix,
array(
'title' => esc_html__('CONTROLS', 'darkify'),
'icon' => 'icofont-ui-settings',
'fields' => array(
array(
'type' => 'section_tab',
'tabs' => array(
array(
'title' => esc_html__('Frontend', 'darkify'),
'icon' => 'icofont-computer',
'fields' => array(
array(
'type' => 'heading',
'content' => esc_html__('Basic Control', 'darkify'),
),
array(
'id' => 'enable_dark_mode_switch',
'type' => 'switcher',
'title' => esc_html__('Frontend Dark Mode', 'darkify'),
'title_help' => '
' . __('Show the dark mode floating switch in your Website\'s frontend.', 'darkify') . '
' . __('Live Demo', 'darkify') . ' ' . __('Open Docs', 'darkify') . ' ',
'text_on' => esc_html__('Enabled', 'darkify'),
'text_off' => esc_html__('Disabled', 'darkify'),
'text_width' => 100,
'default' => true,
),
array(
'id' => 'enable_default_dark_mode',
'type' => 'switcher',
'title' => esc_html__('Default Dark Mode', 'darkify'),
'title_help' => '' . __('Automatically turn your website dark by default.', 'darkify') . '
',
'text_on' => esc_html__('Enabled', 'darkify'),
'text_off' => esc_html__('Disabled', 'darkify'),
'text_width' => 100,
// 'title_video' => '
//
//
//
//
Auto Convert Dropdowns to Button
',
),
array(
'id' => 'enable_os_aware',
'type' => 'switcher',
'title' => esc_html__('OS Aware Dark Mode', 'darkify'),
'title_video' => '
Dark Mode toggling based on OS setting
',
'text_on' => esc_html__('Enabled', 'darkify'),
'text_off' => esc_html__('Disabled', 'darkify'),
'text_width' => 100,
'default' => true,
),
array(
'id' => 'enable_keyboard_shortcut',
'type' => 'switcher',
'title' => esc_html__('Keyboard Shortcut', 'darkify'),
'title_help' => '' . __('Enable to dark mode by pressing Ctrl+Alt+D on windows keyboard & Ctrl+Opt|Start+D on mac.', 'darkify') . '
',
'text_on' => esc_html__('Enabled', 'darkify'),
'text_off' => esc_html__('Disabled', 'darkify'),
'text_width' => 100,
'default' => true,
),
array(
'type' => 'heading',
'title' => esc_html__('Advanced Control', 'darkify'),
),
// Enable Time Based Auto Dark Mode
array(
'id' => 'enable_time',
'type' => 'fieldset',
'fields' => array(
array(
'id' => 'enable_time_based_dark',
'type' => 'switcher',
'title' => esc_html__('Time Based Auto Dark Mode', 'darkify'),
'title_help' => '' . __('Automatically turn dark mode ON based on users’ localtime.', 'darkify') . '
',
'text_on' => esc_html__('Enabled', 'darkify'),
'text_off' => esc_html__('Disabled', 'darkify'),
'text_width' => 100,
),
array(
'id' => 'time_based_dark_start',
'type' => 'datetime',
'title' => esc_html__('Pick a Time', 'darkify'),
'title_help' => '' . __('Set the exact start and end times when dark mode should automatically be enabled or disabled.', 'darkify') . '
',
'from_to' => true,
'text_from' => esc_html__('Form', 'darkify'),
'text_to' => esc_html__('To', 'darkify'),
'settings' => array(
'noCalendar' => true,
'enableTime' => true,
'dateFormat' => 'H:i',
'time_24hr' => false,
),
'dependency' => array('enable_time_based_dark', '==', 'true'),
),
),
),
array(
'id' => 'hide_on_desktop',
'type' => 'switcher',
'title' => esc_html__('Hide Dark Mode Switch On Desktop', 'darkify'),
'title_help' => '' . __('Hide the Dark Mode Floating Switch if users’ are using desktop or laptop.', 'darkify') . '
',
'text_on' => esc_html__('Yes', 'darkify'),
'text_off' => esc_html__('No', 'darkify'),
),
array(
'id' => 'hide_on_mobile',
'type' => 'fieldset',
'fields' => array(
array(
'id' => 'hide_dark_mode_on_mobile',
'type' => 'switcher',
'title' => esc_html__('Hide Dark Mode On Mobile', 'darkify'),
'title_help' => '' . __('Hide the Dark Mode Floating Switch if user(s) are using mobile.', 'darkify') . '
',
'text_on' => esc_html__('Yes', 'darkify'),
'text_off' => esc_html__('No', 'darkify'),
),
array(
'id' => 'type_of_hide_by',
'type' => 'button_set',
'title' => esc_html__('Hide By', 'darkify'),
'title_help' => '' . __('Choose the method to detect mobile devices: by User Agent, by Screen Size, or use Both for maximum accuracy.', 'darkify') . '
',
'options' => array(
'user_agent' => esc_html__('User Agent', 'darkify'),
'screen_size' => esc_html__('Screen Size', 'darkify'),
'both' => esc_html__('Both', 'darkify'),
),
'default' => 'both',
'dependency' => array('hide_dark_mode_on_mobile', '==', 'true'),
),
),
),
array(
'id' => 'show_in_menu',
'type' => 'fieldset',
'fields' => array(
array(
'id' => 'enable_switch_in_menu',
'type' => 'switcher',
'title' => esc_html__('Show Switch In Menu', 'darkify'),
'title_help' => '' . __('Show the dark mode toggle switch in specific menu.', 'darkify') . '
',
'text_on' => esc_html__('Yes', 'darkify'),
'text_off' => esc_html__('No', 'darkify'),
),
array(
'id' => 'select_menus',
'type' => 'group',
'title' => esc_html__('Menu Switch Settings', 'darkify'),
'title_help' => '' . __('Configure menu switch options and placement for your site.', 'darkify') . '
' . __('Live Demo', 'darkify') . ' ' . __('Open Docs', 'darkify') . ' ',
'accordion_title_number' => true,
'accordion_title_auto' => true,
'class' => 'select_menus',
'max' => '1',
'add_more_text' => __('Want to use switch in unlimited number of menus? Upgrade To Pro! ', 'darkify'),
'fields' => array(
array(
'id' => 'switch_in_menu_location',
'type' => 'select',
'class' => 'select_menu_location',
'title' => esc_html__('Select Menu', 'darkify'),
'title_help' => '' . esc_html__('Choose an option from the dropdown menu', 'darkify') . '
',
'options' => 'menus',
'empty_message' => esc_html__('You haven\'t created a menu yet. If you\'re using an FSE theme, copy the shortcode below and paste it where you want the switch to appear.', 'darkify'),
),
array(
'id' => 'darkify_menu_shortcode_helper',
'type' => 'textarea',
'title' => esc_html__('Shortcode To Add On Menu', 'darkify'),
'title_help' => '' . __('You can change shortcode options value based on your pereference.', 'darkify') . '
',
'default' => '[darkify switch="1" width="60px" height="60px" icon_size="40px" light_mode_bg="#121116" dark_mode_bg="#ffffff" light_mode_color="#ffffff" dark_mode_color="#121116" border="0px" border_light_color="#121119" border_dark_color="#ffffff" border_radius="7px"]'
),
array(
'id' => 'select_menu_position',
'type' => 'button_set',
'title' => esc_html__('Select Menu Position', 'darkify'),
'title_help' => '' . esc_html__('Choose the position for the select menu', 'darkify') . '
',
'options' => array(
'after' => esc_html__('After', 'darkify'),
'before' => esc_html__('Before', 'darkify'),
),
'default' => 'after',
),
),
'dependency' => array('enable_switch_in_menu', '==', 'true'),
),
),
),
),
),
array(
'title' => esc_html__('Admin', 'darkify'),
'icon' => 'icofont-dashboard-web',
'fields' => array(
array(
'id' => 'enable_admin_panel_dark_mode',
'type' => 'switcher',
'title' => esc_html__('Admin Panel Dark Mode', 'darkify'),
'title_help' => '' . __('Switch to enable Dark Mode in WordPress Admin Panel.', 'darkify') . '
' . __('Live Demo', 'darkify') . ' ' . __('Open Docs', 'darkify') . ' ',
'default' => false,
'text_on' => esc_html__('Enabled', 'darkify'),
'text_off' => esc_html__('Disabled', 'darkify'),
'text_width' => 100,
),
array(
'id' => 'disallowed_admin_pages',
'type' => 'textarea',
'title' => esc_html__('Disallowed Pages', 'darkify'),
'title_help' => '' . __('If the admin page URL is like http://example.com/wp-admin/admin.php?page=darkify then darkify is it\'s page slug.', 'darkify') . '
',
'placeholder' => esc_html__('Enter comma separated page slugs. Example: darkify-dashboard, elementor', 'darkify'),
'dependency' => array('enable_admin_panel_dark_mode', '==', 'true'),
'class' => 'only_pro'
),
),
),
),
),
),
),
);
}
}