| @@ -1,271 +1,273 @@ | ||
| 1 | 1 | <?php |
| 2 | - /** | |
| 3 | - * Factory Forms | |
| 4 | - * | |
| 5 | - * @author Alex Kovalev <alex.kovalevv@gmail.com> | |
| 6 | - * @copyright (c) 2018, Webcraftic Ltd | |
| 7 | - * | |
| 8 | - * @package factory-forms | |
| 9 | - * @since 1.0.1 | |
| 10 | - */ | |
| 2 | +/** | |
| 3 | + * Factory Forms | |
| 4 | + * | |
| 5 | + * @author Alex Kovalev <alex.kovalevv@gmail.com> | |
| 6 | + * @since 1.0.1 | |
| 7 | + * @package factory-forms | |
| 8 | + * @copyright (c) 2018, Webcraftic Ltd | |
| 9 | + * | |
| 10 | + */ | |
| 11 | 11 | |
| 12 | - // Exit if accessed directly | |
| 13 | - if( !defined('ABSPATH') ) { | |
| 14 | - exit; | |
| 15 | - } | |
| 12 | +// Exit if accessed directly | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; | |
| 15 | +} | |
| 16 | 16 | |
| 17 | - // the module provides function for the admin area only | |
| 17 | +// the module provides function for the admin area only | |
| 18 | 18 | |
| 19 | - if( !is_admin() ) { | |
| 20 | - return; | |
| 21 | - } | |
| 19 | +if ( ! is_admin() ) { | |
| 20 | + return; | |
| 21 | +} | |
| 22 | 22 | |
| 23 | - // checks if the module is already loaded in order to | |
| 24 | - // prevent loading the same version of the module twice. | |
| 25 | - if( defined('FACTORY_FORMS_402_LOADED') ) { | |
| 26 | - return; | |
| 27 | - } | |
| 23 | +// checks if the module is already loaded in order to | |
| 24 | +// prevent loading the same version of the module twice. | |
| 25 | +if ( defined( 'FACTORY_FORMS_417_LOADED' ) ) { | |
| 26 | + return; | |
| 27 | +} | |
| 28 | 28 | |
| 29 | - define('FACTORY_FORMS_402_LOADED', true); | |
| 29 | +define( 'FACTORY_FORMS_417_LOADED', true ); | |
| 30 | 30 | |
| 31 | - // absolute path and URL to the files and resources of the module. | |
| 32 | - define('FACTORY_FORMS_402_DIR', dirname(__FILE__)); | |
| 33 | - define('FACTORY_FORMS_402_URL', plugins_url(null, __FILE__)); | |
| 31 | +define( 'FACTORY_FORMS_417_VERSION', '4.1.7' ); | |
| 34 | 32 | |
| 35 | - #comp merge | |
| 36 | - require_once(FACTORY_FORMS_402_DIR . '/includes/providers/value-provider.interface.php'); | |
| 37 | - require_once(FACTORY_FORMS_402_DIR . '/includes/providers/meta-value-provider.class.php'); | |
| 38 | - require_once(FACTORY_FORMS_402_DIR . '/includes/providers/options-value-provider.class.php'); | |
| 33 | +// absolute path and URL to the files and resources of the module. | |
| 34 | +define( 'FACTORY_FORMS_417_DIR', dirname( __FILE__ ) ); | |
| 35 | +define( 'FACTORY_FORMS_417_URL', plugins_url( null, __FILE__ ) ); | |
| 39 | 36 | |
| 40 | - require_once(FACTORY_FORMS_402_DIR . '/includes/form.class.php'); | |
| 41 | - #endcomp | |
| 37 | +#comp merge | |
| 38 | +require_once( FACTORY_FORMS_417_DIR . '/includes/providers/value-provider.interface.php' ); | |
| 39 | +require_once( FACTORY_FORMS_417_DIR . '/includes/providers/meta-value-provider.class.php' ); | |
| 40 | +require_once( FACTORY_FORMS_417_DIR . '/includes/providers/options-value-provider.class.php' ); | |
| 42 | 41 | |
| 43 | - load_plugin_textdomain('wbcr_factory_forms_402', false, dirname(plugin_basename(__FILE__)) . '/langs'); | |
| 42 | +require_once( FACTORY_FORMS_417_DIR . '/includes/form.class.php' ); | |
| 43 | +#endcomp | |
| 44 | 44 | |
| 45 | +load_plugin_textdomain( 'wbcr_factory_forms_417', false, dirname( plugin_basename( __FILE__ ) ) . '/langs' ); | |
| 46 | + | |
| 47 | +/** | |
| 48 | + * We add this code into the hook because all these controls quite heavy. So in order to get better perfomance, | |
| 49 | + * we load the form controls only on pages where the forms are created. | |
| 50 | + * | |
| 51 | + * @since 3.0.7 | |
| 52 | + * @see the 'wbcr_factory_forms_417_register_controls' hook | |
| 53 | + * | |
| 54 | + */ | |
| 55 | +if ( ! function_exists( 'wbcr_factory_forms_417_register_default_controls' ) ) { | |
| 56 | + | |
| 45 | 57 | /** |
| 46 | - * We add this code into the hook because all these controls quite heavy. So in order to get better perfomance, | |
| 47 | - * we load the form controls only on pages where the forms are created. | |
| 58 | + * @param Wbcr_Factory419_Plugin $plugin | |
| 48 | 59 | * |
| 49 | - * @see the 'wbcr_factory_forms_402_register_controls' hook | |
| 50 | - * | |
| 51 | - * @since 3.0.7 | |
| 60 | + * @throws Exception | |
| 52 | 61 | */ |
| 53 | - if( !function_exists('wbcr_factory_forms_402_register_default_controls') ) { | |
| 62 | + function wbcr_factory_forms_417_register_default_controls( Wbcr_Factory419_Plugin $plugin ) { | |
| 54 | 63 | |
| 55 | - /** | |
| 56 | - * @param Wbcr_Factory401_Plugin $plugin | |
| 57 | - * @throws Exception | |
| 58 | - */ | |
| 59 | - function wbcr_factory_forms_402_register_default_controls(Wbcr_Factory401_Plugin $plugin) | |
| 60 | - { | |
| 64 | + if ( $plugin && ! isset( $plugin->forms ) ) { | |
| 65 | + throw new Exception( "The module Factory Forms is not loaded for the plugin '{$plugin->getPluginName()}'." ); | |
| 66 | + } | |
| 61 | 67 | |
| 62 | - if( $plugin && !isset($plugin->forms) ) { | |
| 63 | - throw new Exception("The module Factory Forms is not loaded for the plugin '{$plugin->getPluginName()}'."); | |
| 64 | - } | |
| 68 | + require_once( FACTORY_FORMS_417_DIR . '/includes/html-builder.class.php' ); | |
| 69 | + require_once( FACTORY_FORMS_417_DIR . '/includes/form-element.class.php' ); | |
| 70 | + require_once( FACTORY_FORMS_417_DIR . '/includes/control.class.php' ); | |
| 71 | + require_once( FACTORY_FORMS_417_DIR . '/includes/complex-control.class.php' ); | |
| 72 | + require_once( FACTORY_FORMS_417_DIR . '/includes/holder.class.php' ); | |
| 73 | + require_once( FACTORY_FORMS_417_DIR . '/includes/control-holder.class.php' ); | |
| 74 | + require_once( FACTORY_FORMS_417_DIR . '/includes/custom-element.class.php' ); | |
| 75 | + require_once( FACTORY_FORMS_417_DIR . '/includes/form-layout.class.php' ); | |
| 65 | 76 | |
| 66 | - require_once(FACTORY_FORMS_402_DIR . '/includes/html-builder.class.php'); | |
| 67 | - require_once(FACTORY_FORMS_402_DIR . '/includes/form-element.class.php'); | |
| 68 | - require_once(FACTORY_FORMS_402_DIR . '/includes/control.class.php'); | |
| 69 | - require_once(FACTORY_FORMS_402_DIR . '/includes/complex-control.class.php'); | |
| 70 | - require_once(FACTORY_FORMS_402_DIR . '/includes/holder.class.php'); | |
| 71 | - require_once(FACTORY_FORMS_402_DIR . '/includes/control-holder.class.php'); | |
| 72 | - require_once(FACTORY_FORMS_402_DIR . '/includes/custom-element.class.php'); | |
| 73 | - require_once(FACTORY_FORMS_402_DIR . '/includes/form-layout.class.php'); | |
| 77 | + // registration of controls | |
| 78 | + $plugin->forms->registerControls( [ | |
| 79 | + [ | |
| 80 | + 'type' => 'checkbox', | |
| 81 | + 'class' => 'Wbcr_FactoryForms417_CheckboxControl', | |
| 82 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/checkbox.php' | |
| 83 | + ], | |
| 84 | + [ | |
| 85 | + 'type' => 'list', | |
| 86 | + 'class' => 'Wbcr_FactoryForms417_ListControl', | |
| 87 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/list.php' | |
| 88 | + ], | |
| 89 | + [ | |
| 90 | + 'type' => 'dropdown', | |
| 91 | + 'class' => 'Wbcr_FactoryForms417_DropdownControl', | |
| 92 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/dropdown.php' | |
| 93 | + ], | |
| 94 | + [ | |
| 95 | + 'type' => 'dropdown-and-colors', | |
| 96 | + 'class' => 'Wbcr_FactoryForms417_DropdownAndColorsControl', | |
| 97 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/dropdown-and-colors.php' | |
| 98 | + ], | |
| 99 | + [ | |
| 100 | + 'type' => 'hidden', | |
| 101 | + 'class' => 'Wbcr_FactoryForms417_HiddenControl', | |
| 102 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/hidden.php' | |
| 103 | + ], | |
| 104 | + [ | |
| 105 | + 'type' => 'hidden', | |
| 106 | + 'class' => 'Wbcr_FactoryForms417_HiddenControl', | |
| 107 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/hidden.php' | |
| 108 | + ], | |
| 109 | + [ | |
| 110 | + 'type' => 'radio', | |
| 111 | + 'class' => 'Wbcr_FactoryForms417_RadioControl', | |
| 112 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/radio.php' | |
| 113 | + ], | |
| 114 | + [ | |
| 115 | + 'type' => 'radio-colors', | |
| 116 | + 'class' => 'Wbcr_FactoryForms417_RadioColorsControl', | |
| 117 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/radio-colors.php' | |
| 118 | + ], | |
| 119 | + [ | |
| 120 | + 'type' => 'textarea', | |
| 121 | + 'class' => 'Wbcr_FactoryForms417_TextareaControl', | |
| 122 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/textarea.php' | |
| 123 | + ], | |
| 124 | + [ | |
| 125 | + 'type' => 'textbox', | |
| 126 | + 'class' => 'Wbcr_FactoryForms417_TextboxControl', | |
| 127 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/textbox.php' | |
| 128 | + ], | |
| 129 | + [ | |
| 130 | + 'type' => 'multiple-textbox', | |
| 131 | + 'class' => 'Wbcr_FactoryForms417_MultipleTextboxControl', | |
| 132 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/multiple-textbox.php' | |
| 133 | + ], | |
| 134 | + [ | |
| 135 | + 'type' => 'datetimepicker-range', | |
| 136 | + 'class' => 'Wbcr_FactoryForms417_DatepickerRangeControl', | |
| 137 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/datepicker-range.php' | |
| 138 | + ], | |
| 139 | + [ | |
| 140 | + 'type' => 'url', | |
| 141 | + 'class' => 'Wbcr_FactoryForms417_UrlControl', | |
| 142 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/url.php' | |
| 143 | + ], | |
| 144 | + [ | |
| 145 | + 'type' => 'wp-editor', | |
| 146 | + 'class' => 'Wbcr_FactoryForms417_WpEditorControl', | |
| 147 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/wp-editor.php' | |
| 148 | + ], | |
| 149 | + [ | |
| 150 | + 'type' => 'color', | |
| 151 | + 'class' => 'Wbcr_FactoryForms417_ColorControl', | |
| 152 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/color.php' | |
| 153 | + ], | |
| 154 | + [ | |
| 155 | + 'type' => 'color-and-opacity', | |
| 156 | + 'class' => 'Wbcr_FactoryForms417_ColorAndOpacityControl', | |
| 157 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/color-and-opacity.php' | |
| 158 | + ], | |
| 159 | + [ | |
| 160 | + 'type' => 'gradient', | |
| 161 | + 'class' => 'Wbcr_FactoryForms417_GradientControl', | |
| 162 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/gradient.php' | |
| 163 | + ], | |
| 164 | + [ | |
| 165 | + 'type' => 'font', | |
| 166 | + 'class' => 'Wbcr_FactoryForms417_FontControl', | |
| 167 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/font.php' | |
| 168 | + ], | |
| 169 | + [ | |
| 170 | + 'type' => 'google-font', | |
| 171 | + 'class' => 'Wbcr_FactoryForms417_GoogleFontControl', | |
| 172 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/google-font.php' | |
| 173 | + ], | |
| 174 | + [ | |
| 175 | + 'type' => 'pattern', | |
| 176 | + 'class' => 'Wbcr_FactoryForms417_PatternControl', | |
| 177 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/pattern.php' | |
| 178 | + ], | |
| 179 | + [ | |
| 180 | + 'type' => 'integer', | |
| 181 | + 'class' => 'Wbcr_FactoryForms417_IntegerControl', | |
| 182 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/integer.php' | |
| 183 | + ], | |
| 184 | + [ | |
| 185 | + 'type' => 'control-group', | |
| 186 | + 'class' => 'Wbcr_FactoryForms417_ControlGroupHolder', | |
| 187 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/control-group.php' | |
| 188 | + ], | |
| 189 | + [ | |
| 190 | + 'type' => 'paddings-editor', | |
| 191 | + 'class' => 'Wbcr_FactoryForms417_PaddingsEditorControl', | |
| 192 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/paddings-editor.php' | |
| 193 | + ], | |
| 194 | + ] ); | |
| 74 | 195 | |
| 75 | - // registration of controls | |
| 76 | - $plugin->forms->registerControls(array( | |
| 77 | - array( | |
| 78 | - 'type' => 'checkbox', | |
| 79 | - 'class' => 'Wbcr_FactoryForms402_CheckboxControl', | |
| 80 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/checkbox.php' | |
| 81 | - ), | |
| 82 | - array( | |
| 83 | - 'type' => 'list', | |
| 84 | - 'class' => 'Wbcr_FactoryForms402_ListControl', | |
| 85 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/list.php' | |
| 86 | - ), | |
| 87 | - array( | |
| 88 | - 'type' => 'dropdown', | |
| 89 | - 'class' => 'Wbcr_FactoryForms402_DropdownControl', | |
| 90 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/dropdown.php' | |
| 91 | - ), | |
| 92 | - array( | |
| 93 | - 'type' => 'dropdown-and-colors', | |
| 94 | - 'class' => 'Wbcr_FactoryForms402_DropdownAndColorsControl', | |
| 95 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/dropdown-and-colors.php' | |
| 96 | - ), | |
| 97 | - array( | |
| 98 | - 'type' => 'hidden', | |
| 99 | - 'class' => 'Wbcr_FactoryForms402_HiddenControl', | |
| 100 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/hidden.php' | |
| 101 | - ), | |
| 102 | - array( | |
| 103 | - 'type' => 'hidden', | |
| 104 | - 'class' => 'Wbcr_FactoryForms402_HiddenControl', | |
| 105 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/hidden.php' | |
| 106 | - ), | |
| 107 | - array( | |
| 108 | - 'type' => 'radio', | |
| 109 | - 'class' => 'Wbcr_FactoryForms402_RadioControl', | |
| 110 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/radio.php' | |
| 111 | - ), | |
| 112 | - array( | |
| 113 | - 'type' => 'radio-colors', | |
| 114 | - 'class' => 'Wbcr_FactoryForms402_RadioColorsControl', | |
| 115 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/radio-colors.php' | |
| 116 | - ), | |
| 117 | - array( | |
| 118 | - 'type' => 'textarea', | |
| 119 | - 'class' => 'Wbcr_FactoryForms402_TextareaControl', | |
| 120 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/textarea.php' | |
| 121 | - ), | |
| 122 | - array( | |
| 123 | - 'type' => 'textbox', | |
| 124 | - 'class' => 'Wbcr_FactoryForms402_TextboxControl', | |
| 125 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/textbox.php' | |
| 126 | - ), | |
| 127 | - array( | |
| 128 | - 'type' => 'multiple-textbox', | |
| 129 | - 'class' => 'Wbcr_FactoryForms402_MultipleTextboxControl', | |
| 130 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/multiple-textbox.php' | |
| 131 | - ), | |
| 132 | - array( | |
| 133 | - 'type' => 'datetimepicker-range', | |
| 134 | - 'class' => 'Wbcr_FactoryForms402_DatepickerRangeControl', | |
| 135 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/datepicker-range.php' | |
| 136 | - ), | |
| 137 | - array( | |
| 138 | - 'type' => 'url', | |
| 139 | - 'class' => 'Wbcr_FactoryForms402_UrlControl', | |
| 140 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/url.php' | |
| 141 | - ), | |
| 142 | - array( | |
| 143 | - 'type' => 'wp-editor', | |
| 144 | - 'class' => 'Wbcr_FactoryForms402_WpEditorControl', | |
| 145 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/wp-editor.php' | |
| 146 | - ), | |
| 147 | - array( | |
| 148 | - 'type' => 'color', | |
| 149 | - 'class' => 'Wbcr_FactoryForms402_ColorControl', | |
| 150 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/color.php' | |
| 151 | - ), | |
| 152 | - array( | |
| 153 | - 'type' => 'color-and-opacity', | |
| 154 | - 'class' => 'Wbcr_FactoryForms402_ColorAndOpacityControl', | |
| 155 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/color-and-opacity.php' | |
| 156 | - ), | |
| 157 | - array( | |
| 158 | - 'type' => 'gradient', | |
| 159 | - 'class' => 'Wbcr_FactoryForms402_GradientControl', | |
| 160 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/gradient.php' | |
| 161 | - ), | |
| 162 | - array( | |
| 163 | - 'type' => 'font', | |
| 164 | - 'class' => 'Wbcr_FactoryForms402_FontControl', | |
| 165 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/font.php' | |
| 166 | - ), | |
| 167 | - array( | |
| 168 | - 'type' => 'google-font', | |
| 169 | - 'class' => 'Wbcr_FactoryForms402_GoogleFontControl', | |
| 170 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/google-font.php' | |
| 171 | - ), | |
| 172 | - array( | |
| 173 | - 'type' => 'pattern', | |
| 174 | - 'class' => 'Wbcr_FactoryForms402_PatternControl', | |
| 175 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/pattern.php' | |
| 176 | - ), | |
| 177 | - array( | |
| 178 | - 'type' => 'integer', | |
| 179 | - 'class' => 'Wbcr_FactoryForms402_IntegerControl', | |
| 180 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/integer.php' | |
| 181 | - ), | |
| 182 | - array( | |
| 183 | - 'type' => 'control-group', | |
| 184 | - 'class' => 'Wbcr_FactoryForms402_ControlGroupHolder', | |
| 185 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/control-group.php' | |
| 186 | - ), | |
| 187 | - array( | |
| 188 | - 'type' => 'paddings-editor', | |
| 189 | - 'class' => 'Wbcr_FactoryForms402_PaddingsEditorControl', | |
| 190 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/paddings-editor.php' | |
| 191 | - ), | |
| 192 | - )); | |
| 196 | + // registration of control holders | |
| 197 | + $plugin->forms->registerHolders( [ | |
| 198 | + [ | |
| 199 | + 'type' => 'tab', | |
| 200 | + 'class' => 'Wbcr_FactoryForms417_TabHolder', | |
| 201 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/tab.php' | |
| 202 | + ], | |
| 203 | + [ | |
| 204 | + 'type' => 'tab-item', | |
| 205 | + 'class' => 'Wbcr_FactoryForms417_TabItemHolder', | |
| 206 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/tab-item.php' | |
| 207 | + ], | |
| 208 | + [ | |
| 209 | + 'type' => 'accordion', | |
| 210 | + 'class' => 'Wbcr_FactoryForms417_AccordionHolder', | |
| 211 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/accordion.php' | |
| 212 | + ], | |
| 213 | + [ | |
| 214 | + 'type' => 'accordion-item', | |
| 215 | + 'class' => 'Wbcr_FactoryForms417_AccordionItemHolder', | |
| 216 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/accordion-item.php' | |
| 217 | + ], | |
| 218 | + [ | |
| 219 | + 'type' => 'control-group', | |
| 220 | + 'class' => 'Wbcr_FactoryForms417_ControlGroupHolder', | |
| 221 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/control-group.php' | |
| 222 | + ], | |
| 223 | + [ | |
| 224 | + 'type' => 'control-group-item', | |
| 225 | + 'class' => 'Wbcr_FactoryForms417_ControlGroupItem', | |
| 226 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/control-group-item.php' | |
| 227 | + ], | |
| 228 | + [ | |
| 229 | + 'type' => 'form-group', | |
| 230 | + 'class' => 'Wbcr_FactoryForms417_FormGroupHolder', | |
| 231 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/form-group.php' | |
| 232 | + ], | |
| 233 | + [ | |
| 234 | + 'type' => 'more-link', | |
| 235 | + 'class' => 'Wbcr_FactoryForms417_MoreLinkHolder', | |
| 236 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/more-link.php' | |
| 237 | + ], | |
| 238 | + [ | |
| 239 | + 'type' => 'div', | |
| 240 | + 'class' => 'Wbcr_FactoryForms417_DivHolder', | |
| 241 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/div.php' | |
| 242 | + ], | |
| 243 | + [ | |
| 244 | + 'type' => 'columns', | |
| 245 | + 'class' => 'Wbcr_FactoryForms417_ColumnsHolder', | |
| 246 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/holders/columns.php' | |
| 247 | + ] | |
| 248 | + ] ); | |
| 193 | 249 | |
| 194 | - // registration of control holders | |
| 195 | - $plugin->forms->registerHolders(array( | |
| 196 | - array( | |
| 197 | - 'type' => 'tab', | |
| 198 | - 'class' => 'Wbcr_FactoryForms402_TabHolder', | |
| 199 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/tab.php' | |
| 200 | - ), | |
| 201 | - array( | |
| 202 | - 'type' => 'tab-item', | |
| 203 | - 'class' => 'Wbcr_FactoryForms402_TabItemHolder', | |
| 204 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/tab-item.php' | |
| 205 | - ), | |
| 206 | - array( | |
| 207 | - 'type' => 'accordion', | |
| 208 | - 'class' => 'Wbcr_FactoryForms402_AccordionHolder', | |
| 209 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/accordion.php' | |
| 210 | - ), | |
| 211 | - array( | |
| 212 | - 'type' => 'accordion-item', | |
| 213 | - 'class' => 'Wbcr_FactoryForms402_AccordionItemHolder', | |
| 214 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/accordion-item.php' | |
| 215 | - ), | |
| 216 | - array( | |
| 217 | - 'type' => 'control-group', | |
| 218 | - 'class' => 'Wbcr_FactoryForms402_ControlGroupHolder', | |
| 219 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/control-group.php' | |
| 220 | - ), | |
| 221 | - array( | |
| 222 | - 'type' => 'control-group-item', | |
| 223 | - 'class' => 'Wbcr_FactoryForms402_ControlGroupItem', | |
| 224 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/control-group-item.php' | |
| 225 | - ), | |
| 226 | - array( | |
| 227 | - 'type' => 'form-group', | |
| 228 | - 'class' => 'Wbcr_FactoryForms402_FormGroupHolder', | |
| 229 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/form-group.php' | |
| 230 | - ), | |
| 231 | - array( | |
| 232 | - 'type' => 'more-link', | |
| 233 | - 'class' => 'Wbcr_FactoryForms402_MoreLinkHolder', | |
| 234 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/more-link.php' | |
| 235 | - ), | |
| 236 | - array( | |
| 237 | - 'type' => 'div', | |
| 238 | - 'class' => 'Wbcr_FactoryForms402_DivHolder', | |
| 239 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/div.php' | |
| 240 | - ), | |
| 241 | - array( | |
| 242 | - 'type' => 'columns', | |
| 243 | - 'class' => 'Wbcr_FactoryForms402_ColumnsHolder', | |
| 244 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/holders/columns.php' | |
| 245 | - ) | |
| 246 | - )); | |
| 250 | + // registration custom form elements | |
| 251 | + $plugin->forms->registerCustomElements( [ | |
| 252 | + [ | |
| 253 | + 'type' => 'html', | |
| 254 | + 'class' => 'Wbcr_FactoryForms417_Html', | |
| 255 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/customs/html.php', | |
| 256 | + ], | |
| 257 | + [ | |
| 258 | + 'type' => 'separator', | |
| 259 | + 'class' => 'Wbcr_FactoryForms417_Separator', | |
| 260 | + 'include' => FACTORY_FORMS_417_DIR . '/controls/customs/separator.php', | |
| 261 | + ], | |
| 262 | + ] ); | |
| 247 | 263 | |
| 248 | - // registration custom form elements | |
| 249 | - $plugin->forms->registerCustomElements(array( | |
| 250 | - array( | |
| 251 | - 'type' => 'html', | |
| 252 | - 'class' => 'Wbcr_FactoryForms402_Html', | |
| 253 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/customs/html.php', | |
| 254 | - ), | |
| 255 | - array( | |
| 256 | - 'type' => 'separator', | |
| 257 | - 'class' => 'Wbcr_FactoryForms402_Separator', | |
| 258 | - 'include' => FACTORY_FORMS_402_DIR . '/controls/customs/separator.php', | |
| 259 | - ), | |
| 260 | - )); | |
| 264 | + // registration of form layouts | |
| 265 | + $plugin->forms->registerFormLayout( [ | |
| 266 | + 'name' => 'bootstrap-3', | |
| 267 | + 'class' => 'Wbcr_FactoryForms417_Bootstrap3FormLayout', | |
| 268 | + 'include' => FACTORY_FORMS_417_DIR . '/layouts/bootstrap-3/bootstrap-3.php' | |
| 269 | + ] ); | |
| 270 | + } | |
| 261 | 271 | |
| 262 | - // registration of form layouts | |
| 263 | - $plugin->forms->registerFormLayout(array( | |
| 264 | - 'name' => 'bootstrap-3', | |
| 265 | - 'class' => 'Wbcr_FactoryForms402_Bootstrap3FormLayout', | |
| 266 | - 'include' => FACTORY_FORMS_402_DIR . '/layouts/bootstrap-3/bootstrap-3.php' | |
| 267 | - )); | |
| 268 | - } | |
| 269 | - | |
| 270 | - add_action('wbcr_factory_forms_402_register_controls', 'wbcr_factory_forms_402_register_default_controls'); | |
| 271 | - } | |
| 272 | + add_action( 'wbcr_factory_forms_417_register_controls', 'wbcr_factory_forms_417_register_default_controls' ); | |
| 273 | +} | |