Controls
2 weeks ago
Tabs
2 weeks ago
CFF_Builder_Customizer.php
2 weeks ago
CFF_Db.php
2 weeks ago
CFF_Feed_Builder.php
2 weeks ago
CFF_Feed_Saver.php
2 weeks ago
CFF_Feed_Saver_Manager.php
2 weeks ago
CFF_Post_Set.php
2 weeks ago
CFF_Source.php
2 weeks ago
CFF_Theme_CSS.php
2 weeks ago
CFF_Tooltip_Wizard.php
2 weeks ago
index.php
2 weeks ago
CFF_Builder_Customizer.php
97 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Customizer Builder |
| 5 | * |
| 6 | * @since 4.0 |
| 7 | */ |
| 8 | |
| 9 | namespace CustomFacebookFeed\Builder; |
| 10 | |
| 11 | if (!defined('ABSPATH')) { |
| 12 | exit; |
| 13 | } |
| 14 | |
| 15 | class CFF_Builder_Customizer |
| 16 | { |
| 17 | /** |
| 18 | * Controls Classes Array |
| 19 | * |
| 20 | * @since 4.0 |
| 21 | * @access private |
| 22 | * |
| 23 | * @var array |
| 24 | */ |
| 25 | public static $controls_classes = []; |
| 26 | |
| 27 | |
| 28 | /** |
| 29 | * Get controls list. |
| 30 | * |
| 31 | * Getting controls list |
| 32 | * |
| 33 | * @since 4.0 |
| 34 | * @access public |
| 35 | * |
| 36 | * @return array |
| 37 | */ |
| 38 | public static function get_controls_list() |
| 39 | { |
| 40 | return [ |
| 41 | 'actionbutton', |
| 42 | 'checkbox', |
| 43 | 'checkboxsection', |
| 44 | 'datepicker', |
| 45 | 'colorpicker', |
| 46 | 'number', |
| 47 | 'select', |
| 48 | 'switcher', |
| 49 | 'text', |
| 50 | 'textarea', |
| 51 | 'toggle', |
| 52 | 'toggleset', |
| 53 | 'heading', |
| 54 | 'separator', |
| 55 | 'customview', |
| 56 | 'coloroverride', |
| 57 | 'togglebutton', |
| 58 | 'hidden' |
| 59 | ]; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Register Controls |
| 64 | * |
| 65 | * Including Control |
| 66 | * |
| 67 | * @since 4.0 |
| 68 | * @access public |
| 69 | */ |
| 70 | public static function register_controls() |
| 71 | { |
| 72 | $controls_list = self::get_controls_list(); |
| 73 | foreach ($controls_list as $control) { |
| 74 | $controlClassName = 'CFF_' . ucfirst($control) . '_Control'; |
| 75 | $cls_name = __NAMESPACE__ . '' . '\Controls\\' . $controlClassName; |
| 76 | $control_class = new $cls_name(); |
| 77 | self::$controls_classes[$control] = $control_class; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Print Controls Vue JS Tempalte |
| 83 | * |
| 84 | * Including Control |
| 85 | * |
| 86 | * @since 4.0 |
| 87 | * @access public |
| 88 | */ |
| 89 | public static function get_controls_templates($editingType) |
| 90 | { |
| 91 | $controls_list = self::get_controls_list(); |
| 92 | foreach ($controls_list as $control) { |
| 93 | self::$controls_classes[$control]->print_control_wrapper($editingType); |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 |