| 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/AdvancedSettings |
| 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 AdvancedSettings |
| 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($prefix, array( |
| 29 |
'title' => esc_html__('ADVANCED SETTINGS', 'darkify'), |
| 30 |
'icon' => 'icofont-settings', |
| 31 |
'fields' => array( |
| 32 |
|
| 33 |
// 'HTML/CSS Restriction |
| 34 |
|
| 35 |
array( |
| 36 |
'type' => 'heading', |
| 37 |
'content' => esc_html__('HTML/CSS Restriction', 'darkify'), |
| 38 |
), |
| 39 |
|
| 40 |
// ALLOWED ELEMENTS |
| 41 |
|
| 42 |
array( |
| 43 |
'id' => 'allowed_elements', |
| 44 |
'type' => 'textarea', |
| 45 |
'title' => esc_html__('Allow Only Elements', 'darkify'), |
| 46 |
'desc' => esc_html__('Dark mode will be applied only to these elements.', 'darkify'), |
| 47 |
'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class or CSS ids. Example: div, #site-header, .my-footer', 'darkify'), |
| 48 |
'class' => 'only_pro', |
| 49 |
), |
| 50 |
|
| 51 |
array( |
| 52 |
'id' => 'allowed_elements_force_to_correct', |
| 53 |
'type' => 'switcher', |
| 54 |
'title' => esc_html__('Force To Correct', 'darkify'), |
| 55 |
'desc' => esc_html__('Force to keep designs correct if background color or text color is changed on disallowed elements..', 'darkify'), |
| 56 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 57 |
'text_off' => esc_html__('No', 'darkify'), |
| 58 |
'default' => true, |
| 59 |
'class' => 'switcher_pro_only', |
| 60 |
), |
| 61 |
|
| 62 |
// DISALLOWED ELEMENTS |
| 63 |
array( |
| 64 |
'id' => 'disallowed_elements', |
| 65 |
'type' => 'textarea', |
| 66 |
'title' => esc_html__('Disallowed Elements', 'darkify'), |
| 67 |
'desc' => esc_html__('Dark mode will be applied only to these elements.', 'darkify'), |
| 68 |
'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class or CSS ids. Example: div, #site-header, .my-footer', 'darkify'), |
| 69 |
'class' => 'only_pro', |
| 70 |
), |
| 71 |
|
| 72 |
array( |
| 73 |
'id' => 'disallowed_elements_force_to_correct', |
| 74 |
'type' => 'switcher', |
| 75 |
'title' => esc_html__('Force To Correct', 'darkify'), |
| 76 |
'desc' => esc_html__('Force to keep designs correct if background color or text color is not working properly for allowed elements.', 'darkify'), |
| 77 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 78 |
'text_off' => esc_html__('No', 'darkify'), |
| 79 |
'class' => 'switcher_pro_only', |
| 80 |
'default' => true, |
| 81 |
), |
| 82 |
|
| 83 |
// Page Restriction |
| 84 |
|
| 85 |
array( |
| 86 |
'type' => 'heading', |
| 87 |
'content' => esc_html__('Page Restriction', 'darkify'), |
| 88 |
), |
| 89 |
|
| 90 |
array( |
| 91 |
'id' => 'allowed_pages', |
| 92 |
'type' => 'select', |
| 93 |
'title' => esc_html__('Allow Only Pages', 'darkify'), |
| 94 |
'help' => esc_html__('Dark mode will be applied only to these pages.', 'darkify'), |
| 95 |
'desc' => esc_html__('Choose the pages only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify'), |
| 96 |
'placeholder' => esc_html__('Select some pages', 'darkify'), |
| 97 |
'options' => 'pages', |
| 98 |
'chosen' => true, |
| 99 |
'multiple' => true, |
| 100 |
'class' => 'only_pro', |
| 101 |
), |
| 102 |
|
| 103 |
array( |
| 104 |
'id' => 'disallowed_pages', |
| 105 |
'type' => 'select', |
| 106 |
'title' => esc_html__('Disallowed Pages', 'darkify'), |
| 107 |
'help' => esc_html__('Dark mode will not be applied to these pages.', 'darkify'), |
| 108 |
'desc' => esc_html__('Choose the pages where dark mode and floating switch can not work. Other pages will be able to process dark mode.', 'darkify'), |
| 109 |
'placeholder' => esc_html__('Select some pages', 'darkify'), |
| 110 |
'options' => 'pages', |
| 111 |
'chosen' => true, |
| 112 |
'multiple' => true, |
| 113 |
'class' => 'only_pro', |
| 114 |
), |
| 115 |
|
| 116 |
// Post Restriction |
| 117 |
|
| 118 |
array( |
| 119 |
'type' => 'heading', |
| 120 |
'content' => esc_html__('Post Restriction', 'darkify'), |
| 121 |
), |
| 122 |
|
| 123 |
array( |
| 124 |
'id' => 'allowed_posts', |
| 125 |
'type' => 'select', |
| 126 |
'title' => esc_html__('Allow Only Posts', 'darkify'), |
| 127 |
'help' => esc_html__('Dark mode will be applied only to these posts.', 'darkify'), |
| 128 |
'desc' => esc_html__('Choose the posts only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify'), |
| 129 |
'placeholder' => esc_html__('Select some posts', 'darkify'), |
| 130 |
'options' => 'posts', |
| 131 |
'chosen' => true, |
| 132 |
'multiple' => true, |
| 133 |
'class' => 'only_pro', |
| 134 |
), |
| 135 |
|
| 136 |
array( |
| 137 |
'id' => 'disallowed_posts', |
| 138 |
'type' => 'select', |
| 139 |
'title' => esc_html__('Disallowed Posts', 'darkify'), |
| 140 |
'help' => esc_html__('Dark mode will not be applied to these posts.', 'darkify'), |
| 141 |
'desc' => esc_html__('Choose the posts where dark mode and floating switch can not work. Other pages will be able to process dark mode.', 'darkify'), |
| 142 |
'placeholder' => esc_html__('Select some posts', 'darkify'), |
| 143 |
'options' => 'posts', |
| 144 |
'chosen' => true, |
| 145 |
'multiple' => true, |
| 146 |
'class' => 'only_pro', |
| 147 |
), |
| 148 |
array( |
| 149 |
'type' => 'heading', |
| 150 |
'content' => esc_html__('Custom CSS', 'darkify'), |
| 151 |
), |
| 152 |
|
| 153 |
array( |
| 154 |
'id' => 'custom_css', |
| 155 |
'type' => 'code_editor', |
| 156 |
'title' => esc_html__('Dark Mode CSS', 'darkify'), |
| 157 |
'desc' => esc_html__('The CSS code will only be applied when dark mode is active.', 'darkify'), |
| 158 |
'settings' => array( |
| 159 |
'theme' => 'mbo', |
| 160 |
'mode' => 'css', |
| 161 |
), |
| 162 |
'class' => 'only_pro', |
| 163 |
), |
| 164 |
|
| 165 |
array( |
| 166 |
'id' => 'css_rules', |
| 167 |
'type' => 'switcher', |
| 168 |
'title' => esc_html__('CSS Rules', 'darkify'), |
| 169 |
'help' => esc_html__('CSS rules should be applied to all children of the CSS selectors.', 'darkify'), |
| 170 |
'desc' => esc_html__('Custom CSS selectors are automatically identified as Disallowed Elements, to ignore, use :not-disallowed pseudo class. i.e. body:not-disallowed{...}', 'darkify'), |
| 171 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 172 |
'text_off' => esc_html__('No', 'darkify'), |
| 173 |
'class' => 'switcher_pro_only', |
| 174 |
'default' => true, |
| 175 |
), |
| 176 |
|
| 177 |
array( |
| 178 |
'id' => 'normal_custom_css', |
| 179 |
'type' => 'code_editor', |
| 180 |
'title' => esc_html__('Normal Mode CSS', 'darkify'), |
| 181 |
'desc' => esc_html__('The CSS code will be applied on both normal mode and dark mode.', 'darkify'), |
| 182 |
'settings' => array( |
| 183 |
'theme' => 'mbo', |
| 184 |
'mode' => 'css', |
| 185 |
), |
| 186 |
'class' => 'only_pro', |
| 187 |
), |
| 188 |
) |
| 189 |
)); |
| 190 |
} |
| 191 |
} |
| 192 |
|