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