# darkify/1.3.0/src/Admin/Views/Control.php

Darkify – Dark Mode &amp; Night Mode for Website &amp; Admin (Dark Theme Included), version 1.3.0. 185 lines.

- Page: https://pluginprobe.com/plugins/darkify/1.3.0/code/src/Admin/Views/Control.php
- Raw: https://pluginprobe.com/plugins/darkify/1.3.0/raw/src/Admin/Views/Control.php
- Modified: 2025-03-21T01:44:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/darkify/1.3.0/code/src/Admin/Views/Control.php#L10-L20`.

```php
<?php

/**
 * Views class for Shortcode generator options.
 *
 * @link       https://themeatelier.net
 * @since      1.0.0
 *
 * @package darkify
 * @subpackage darkify/src/Admin/Views/Control
 * @author     ThemeAtelier<themeatelierbd@gmail.com>
 */

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__('CONTROL', 'darkify'),
                'icon'        => 'icofont-ui-settings',
                'fields'      => array(
                    array(
                        'type'    => 'heading',
                        'content' => esc_html__('Basic Control', 'darkify'),
                    ),
                    array(
                        'id'      => 'enable_dark_mode_switch',
                        'type'    => 'switcher',
                        'title'   => esc_html__('Enable or Disable Frontend Dark Mode Switch', 'darkify'),
                        'desc'    => esc_html__('Switch to show the Dark Mode Floating Switch in your Websites frontend.', 'darkify'),
                        'text_on'    => esc_html__('Enabled', 'darkify-pro'),
                        'text_off'    => esc_html__('Disabled', 'darkify-pro'),
                        'text_width' => 100,
                        'default' => true,
                    ),
                    array(
                        'id'      => 'enable_default_dark_mode',
                        'type'    => 'switcher',
                        'title'   => esc_html__('Enable or Disable Default Dark Mode', 'darkify'),
                        'desc'    => esc_html__('Switch to automatically turn your website dark by default.', 'darkify'),
                        'text_on'    => esc_html__('Enabled', 'darkify-pro'),
                        'text_off'    => esc_html__('Disabled', 'darkify-pro'),
                        'text_width' => 100,
                    ),
                    array(
                        'id'      => 'enable_os_aware',
                        'type'    => 'switcher',
                        'title'   => esc_html__('Enable or Disable OS Aware Dark Mode', 'darkify'),
                        'desc'    => esc_html__('Switch to enable or disable dark mode automatically according to users’ device preference.', 'darkify'),
                        'text_on'    => esc_html__('Enabled', 'darkify-pro'),
                        'text_off'    => esc_html__('Disabled', 'darkify-pro'),
                        'text_width' => 100,
                        'default' => true,
                    ),
                    array(
                        'id'      => 'enable_keyboard_shortcut',
                        'type'    => 'switcher',
                        'title'   => esc_html__('Enable or Disable Keyboard Shortcut', 'darkify'),
                        'desc'    => esc_html__('Switch to turn ON or OFF dark mode by pressing Ctrl+Alt+D on keyboard.', 'darkify'),
                        'text_on'    => esc_html__('Enabled', 'darkify-pro'),
                        'text_off'    => esc_html__('Disabled', 'darkify-pro'),
                        'text_width' => 100,
                        'default' => true,
                    ),
                    array(
                        'type'    => 'heading',
                        'content' => 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__('Enable or Disable Time Based Auto Dark Mode', 'darkify'),
                                'desc'  => esc_html__('Automatically turn dark mode ON based on users’ localtime.', 'darkify'),
                                'text_on'    => esc_html__('Enabled', 'darkify-pro'),
                                'text_off'    => esc_html__('Disabled', 'darkify-pro'),
                                'text_width' => 100,
                            ),
                            array(
                                'id'        => 'time_based_dark_start',
                                'type'      => 'datetime',
                                'title'     => esc_html__('Pick a Time', '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__('Show or Hide Dark Mode Switch on Desktop', 'darkify'),
                        'desc'    => esc_html__('Switch to hide the Dark Mode Floating Switch if users’ are using desktop or laptop.', 'darkify'),
                        'text_on'    => esc_html__('Show', 'darkify-pro'),
                        'text_off'    => esc_html__('Hide', 'darkify-pro'),
                        'text_width' => 80,
                    ),
                    array(
                        'id'     => 'hide_on_mobile',
                        'type'   => 'fieldset',
                        'fields' => array(
                            array(
                                'id'      => 'hide_dark_mode_on_mobile',
                                'type'    => 'switcher',
                                'title'   => esc_html__('Show or Hide Dark Mode on Mobile', 'darkify'),
                                'desc'    => esc_html__('Switch to hide the Dark Mode Floating Switch if users’ are using mobile.', 'darkify'),
                                'text_on'    => esc_html__('Show', 'darkify-pro'),
                                'text_off'    => esc_html__('Hide', 'darkify-pro'),
                                'text_width' => 80,
                            ),
                            array(
                                'id'      => 'type_of_hide_by',
                                'type'    => 'select',
                                'title'   => esc_html__('Type of Hide By', 'darkify'),
                                'options' => array(
                                    'user_agent'  => esc_html__('Hide by User Agent', 'darkify'),
                                    'screen_size' => esc_html__('Hide by Screen Size', 'darkify'),
                                    'both'        => esc_html__('Hide by 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 or Hide Switch in Menu', 'darkify'),
                                'desc'    => esc_html__('Show the dark mode toggle switch in specific menu.', 'darkify'),
                                'text_on'    => esc_html__('Show', 'darkify-pro'),
                                'text_off'    => esc_html__('Hide', 'darkify-pro'),
                                'text_width' => 80,
                            ),
                            array(
                                'id'          => 'switch_in_menu_location',
                                'type'        => 'select',
                                'title'       => esc_html__('Select Menu', 'darkify'),
                                'options'     => 'menus',
                                'dependency'  => array('enable_switch_in_menu', '==', 'true'),
                            ),
                            array(
                                'id'          => 'darkify_menu_shortcode_helper',
                                'type'        => 'textarea',
                                'title'       => esc_html__('Short Code menu', 'darkify'),
                                'desc'        => esc_html__('You can generate customized switch shortcode from SWITCH STYLE > Advanced Customization.', 'darkify'),
                                'dependency'  => array('enable_switch_in_menu', '==', 'true'),
                                '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"]'
                            ),
                        ),
                    ),
                ),
            ),
        );
    }
}

```
