*/ namespace ThemeAtelier\Darkify\Admin\Views; use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify; class AdvancedSettings { /** * 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__('ADVANCED', 'darkify'), 'icon' => 'icofont-settings', 'fields' => array( array( 'type' => 'section_tab', 'tabs' => array( array( 'title' => esc_html__('HTML/CSS Restriction', 'darkify'), 'icon' => 'icofont-code-alt', 'fields' => array( // ALLOWED ELEMENTS array( 'id' => 'allowed_elements', 'type' => 'textarea', 'title' => esc_html__('Allow Only Elements', 'darkify'), 'title_help' => '
' . __('Dark mode will be applied only to these elements.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'placeholder' => esc_html__( 'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer', 'darkify' ), 'class' => 'only_pro', ), array( 'id' => 'allowed_elements_force_to_correct', 'type' => 'switcher', 'title' => esc_html__('Force Design Correction', 'darkify'), 'title_help' => '
' . __('Force Darkify to preserve layout and readability when background or text colors are modified on allowed elements.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'class' => 'switcher_pro_only', 'text_on' => esc_html__('Yes', 'darkify'), 'text_off' => esc_html__('No', 'darkify'), 'default' => true, ), // DISALLOWED ELEMENTS array( 'id' => 'disallowed_elements', 'type' => 'textarea', 'class' => 'only_pro', 'title' => esc_html__('Disallowed Elements', 'darkify'), 'title_help' => '
' . esc_html__('Dark mode will NOT be applied to the elements.', 'darkify') . '
' . esc_html__('Live Demo', 'darkify') . '' . esc_html__('Open Docs', 'darkify') . '', 'placeholder' => esc_html__( 'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer', 'darkify' ), ), array( 'id' => 'disallowed_elements_force_to_correct', 'type' => 'switcher', 'title' => esc_html__('Force To Correct', 'darkify'), 'title_help' => '
' . __('Force Darkify to keep the design correct when background or text colors do not work properly for disallowed elements.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'class' => 'switcher_pro_only', 'text_on' => esc_html__('Yes', 'darkify'), 'text_off' => esc_html__('No', 'darkify'), 'default' => true, ), ) ), array( 'title' => esc_html__('Page/Posts Restriction', 'darkify'), 'icon' => 'icofont-eye-blocked', 'fields' => array( array( 'type' => 'heading', 'title' => esc_html__('Pages Restriction', 'darkify'), ), array( 'id' => 'allowed_pages', 'type' => 'select', 'title' => esc_html__('Allow Only Pages', 'darkify'), 'title_help' => '
' . __('Dark mode will be applied only to the selected pages.', 'darkify') . '
' . __('Choose only the pages where dark mode and the floating switch should work. Dark mode will not be applied to any other pages.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'placeholder' => esc_html__('Select pages', 'darkify'), 'class' => 'only_pro', 'options' => 'pages', 'chosen' => true, 'multiple' => true, ), array( 'id' => 'disallowed_pages', 'type' => 'select', 'title' => esc_html__('Disallowed Pages', 'darkify'), 'title_help' => '
' . __('Dark mode will not be applied to these pages.', 'darkify') . '
' . __('Choose the pages where dark mode and the floating switch should not work. Dark mode will work on all other pages.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'class' => 'only_pro', 'placeholder' => esc_html__('Select pages', 'darkify'), 'options' => 'pages', 'chosen' => true, 'multiple' => true, 'dependency' => array('allowed_pages', '==', ''), ), array( 'type' => 'heading', 'title' => esc_html__('Posts Restriction', 'darkify'), ), array( 'id' => 'allowed_posts', 'type' => 'select', 'title' => esc_html__('Allow Only Posts', 'darkify'), 'title_help' => '
' . __('Dark mode will be applied only to these posts.', 'darkify') . '
' . __('Choose only the posts where dark mode and the floating switch should work. Dark mode will not be applied to any other posts.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'placeholder' => esc_html__('Select posts', 'darkify'), 'class' => 'only_pro', 'options' => 'posts', 'chosen' => true, 'multiple' => true, ), array( 'id' => 'disallowed_posts', 'type' => 'select', 'title' => esc_html__('Disallowed Posts', 'darkify'), 'title_help' => '
' . __('Dark mode will not be applied to these posts.', 'darkify') . '
' . __('Choose the posts where dark mode and the floating switch cannot work. Other posts will be able to process dark mode.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'placeholder' => esc_html__('Select posts', 'darkify'), 'class' => 'only_pro', 'options' => 'posts', 'chosen' => true, 'multiple' => true, 'dependency' => array('allowed_posts', '==', ''), ), ) ), array( 'title' => esc_html__('Custom CSS', 'darkify'), 'icon' => 'icofont-file-css', 'fields' => array( array( 'id' => 'custom_css', 'type' => 'code_editor', 'title' => esc_html__('Dark Mode CSS', 'darkify'), 'title_help' => '
' . __('The CSS code will only be applied when dark mode is active.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'settings' => array( 'theme' => 'default', 'mode' => 'css', ), ), array( 'id' => 'custom_css_rules', 'type' => 'switcher', 'title' => esc_html__('CSS Rules', 'darkify'), 'title_help' => '
' . __('CSS rules will be applied to all child elements of the specified CSS selectors.', 'darkify') . '
' . '
' . __('Custom CSS selectors are automatically treated as Disallowed Elements. To override this behavior, use the :not-disallowed pseudo-class. Example: body:not-disallowed { ... }', 'darkify') . '
' . '' . __('Live Demo', 'darkify') . '' . '' . __('Open Docs', 'darkify') . '', 'text_on' => esc_html__('Yes', 'darkify'), 'text_off' => esc_html__('No', 'darkify'), 'class' => 'switcher_pro_only', ), array( 'id' => 'normal_custom_css', 'type' => 'code_editor', 'title' => esc_html__('Normal Mode CSS', 'darkify'), 'title_help' => '
' . __('The CSS code will be applied in both normal mode and dark mode.', 'darkify') . '
' . '' . __('Live Demo', 'darkify') . '' . '' . __('Open Docs', 'darkify') . '', 'settings' => array( 'theme' => 'default', 'mode' => 'css', ), ), ) ), array( 'title' => esc_html__('Extras', 'darkify'), 'icon' => 'icofont-holding-hands', 'fields' => array( // Enable Tooltip On Floating Switch array( 'id' => 'darkify_data_remove', 'type' => 'checkbox', 'title' => esc_html__('Clean-up Data on Deletion', 'darkify'), 'title_help' => '
' . esc_html__('Enable this option to completely remove all Darkify data when the plugin is deleted.', 'darkify') . '
' . esc_html__('Live Demo', 'darkify') . '' . esc_html__('Open Docs', 'darkify') . '', ), array( 'type' => 'heading', 'title' => esc_html__('Backup', 'darkify'), ), array( 'title' => esc_html__('Backup and Restore Settings', 'darkify'), 'title_help' => '
' . 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') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '', 'type' => 'backup', ), ) ), ) ), ), )); } }