*/
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') . '',
'class' => 'only_pro',
'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class or CSS ids. Example: div, #site-header, .my-footer', 'darkify'),
),
array(
'id' => 'allowed_elements_force_to_correct',
'type' => 'switcher',
'title' => esc_html__('Force To Correct', 'darkify'),
'title_help' => '' . __('Force to keep designs correct if background color or text color is changed on allowed elements.', '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',
'title' => esc_html__('Disallowed Elements', 'darkify'),
'title_help' => '' . __('Dark mode will be applied only to these elements.', 'darkify') . '
',
'class' => 'only_pro',
'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class 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 to keep designs correct if background color or text color is not working properly for disallowed elements.', '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 these pages.', 'darkify') . '
' . __('Choose the pages only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '',
'class' => 'only_pro',
'placeholder' => esc_html__('Select some pages', 'darkify'),
'options' => 'pages',
'query_args' => array(
'posts_per_page' => -1,
),
'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 floating switch can not work. Other pages will be able to process dark mode.', 'darkify') . '
',
'class' => 'only_pro',
'placeholder' => esc_html__('Select some pages', 'darkify'),
'options' => 'pages',
'query_args' => array(
'posts_per_page' => -1,
),
'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 the posts only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify') . '
',
'class' => 'only_pro',
'placeholder' => esc_html__('Select some posts', 'darkify'),
'options' => 'posts',
'query_args' => array(
'posts_per_page' => -1,
),
'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 floating switch can not work. Other pages will be able to process dark mode.', 'darkify') . '
',
'class' => 'only_pro',
'placeholder' => esc_html__('Select some posts', 'darkify'),
'options' => 'posts',
'query_args' => array(
'posts_per_page' => -1,
),
'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' => 'mbo',
'mode' => 'css',
),
),
array(
'id' => 'custom_css_rules',
'type' => 'switcher',
'title' => esc_html__('CSS Rules', 'darkify'),
'title_help' => '' . __('CSS rules should be applied to all children of the CSS selectors.', 'darkify') . '
' . __('Custom CSS selectors are automatically identified as Disallowed Elements, to ignore, use :not-disallowed pseudo class. i.e. body:not-disallowed{...}', 'darkify') . '
',
'class' => 'switcher_pro_only',
'text_on' => esc_html__('Yes', 'darkify'),
'text_off' => esc_html__('No', 'darkify'),
),
array(
'id' => 'normal_custom_css',
'type' => 'code_editor',
'title' => esc_html__('Normal Mode CSS', 'darkify'),
'title_help' => '' . __('The CSS code will be applied on both normal mode and dark mode.', 'darkify') . '
',
'settings' => array(
'theme' => 'mbo',
'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__('Check this box if you would like Darkify plugin to completely remove all of its data when the plugin is deleted.', 'darkify') . '
',
),
array(
'type' => 'heading',
'title' => esc_html__('Backup', 'darkify'),
),
array(
'title' => esc_html__('Backup and Restore Settings', 'darkify'),
'title_help' => '' . esc_html__('Use the options to backup your settings for safekeeping or restore them when needed. Simply export your current settings as a .json file, and import it whenever you want to restore your configuration.', 'darkify') . '
' . __('Live Demo', 'darkify') . '' . __('Open Docs', 'darkify') . '',
'type' => 'backup',
),
)
),
)
),
),
));
}
}