Unlock Exclusive Savings with Our Combo Deals!

Affordable Delivery Everywhere: Just Rs. 189 Flat Rate!

Shop for Rs.5000 or More and Enjoy FREE Delivery!

Common queries answered

Frequently asked Questions

Average delivery days are 4-5, Tribal areas will take sometime about 5-7 days. In major cities, the delivery will take 4-5 days approximately.

The product should be in original condition, the products will not returned if seal is broken.

Shipping & Billing address will not be changed, the consignment will be delivered to the customer at given address at the spot of checkout.

Johnson White Cosmetics PVT LTD will sent emails & SMS to the customer at every moment till delivered, so you have receive emails/SMS after placing the orders.

Please fill the form at the right menu, our support team will contact you as soon as possible. OR you can whatsapp us on chat area at the homepage of the webstore.

You can do email us or fill the contact form & we will update your shipping address.

We are currently working in Pakistan, if someone from other’s country wants to purchase, they can email us & we will ship via International shipping services.

Every order has unique ID of the order number, if everything includes in the order, then all items will receive you in one shipment.

Still need help?

Get in touch with us

This form is currently undergoing maintenance. Please try again later.
Express Nationwide shipping

On all orders

Easy 30 days returns

30 days money back guarantee

International Warranty

Offered in the country of usage

100% Secure Checkout

Cash on delivery / Visa / Union Pay

start_controls_section( 'hello_footer_section', [ 'tab' => 'hello-settings-footer', 'label' => esc_html__( 'Footer', 'hello-elementor' ), ] ); $this->add_control( 'hello_footer_logo_display', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Site Logo', 'hello-elementor' ), 'default' => 'yes', 'label_on' => esc_html__( 'Show', 'hello-elementor' ), 'label_off' => esc_html__( 'Hide', 'hello-elementor' ), 'selector' => '.site-footer .site-branding', ] ); $this->add_control( 'hello_footer_tagline_display', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Tagline', 'hello-elementor' ), 'default' => 'yes', 'label_on' => esc_html__( 'Show', 'hello-elementor' ), 'label_off' => esc_html__( 'Hide', 'hello-elementor' ), 'selector' => '.site-footer .site-description', ] ); $this->add_control( 'hello_footer_menu_display', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Menu', 'hello-elementor' ), 'default' => 'yes', 'label_on' => esc_html__( 'Show', 'hello-elementor' ), 'label_off' => esc_html__( 'Hide', 'hello-elementor' ), 'selector' => '.site-footer .site-navigation', ] ); $this->add_control( 'hello_footer_copyright_display', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Copyright', 'hello-elementor' ), 'default' => 'yes', 'label_on' => esc_html__( 'Show', 'hello-elementor' ), 'label_off' => esc_html__( 'Hide', 'hello-elementor' ), 'selector' => '.site-footer .copyright', ] ); $this->add_control( 'hello_footer_layout', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Layout', 'hello-elementor' ), 'options' => [ 'default' => esc_html__( 'Default', 'hello-elementor' ), 'inverted' => esc_html__( 'Inverted', 'hello-elementor' ), 'stacked' => esc_html__( 'Centered', 'hello-elementor' ), ], 'selector' => '.site-footer', 'default' => 'default', ] ); $this->add_control( 'hello_footer_width', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Width', 'hello-elementor' ), 'options' => [ 'boxed' => esc_html__( 'Boxed', 'hello-elementor' ), 'full-width' => esc_html__( 'Full Width', 'hello-elementor' ), ], 'selector' => '.site-footer', 'default' => 'boxed', ] ); $this->add_responsive_control( 'hello_footer_custom_width', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Content Width', 'hello-elementor' ), 'size_units' => [ '%', 'px', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'max' => 2000, ], 'em' => [ 'max' => 100, ], 'rem' => [ 'max' => 100, ], ], 'condition' => [ 'hello_footer_width' => 'boxed', ], 'selectors' => [ '.site-footer .footer-inner' => 'width: {{SIZE}}{{UNIT}}; max-width: 100%;', ], ] ); $this->add_responsive_control( 'hello_footer_gap', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Gap', 'hello-elementor' ), 'size_units' => [ '%', 'px', 'em ', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'max' => 100, ], 'em' => [ 'max' => 5, ], 'rem' => [ 'max' => 5, ], ], 'selectors' => [ '.site-footer' => 'padding-inline-end: {{SIZE}}{{UNIT}}; padding-inline-start: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'hello_footer_layout!' => 'stacked', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'hello_footer_background', 'label' => esc_html__( 'Background', 'hello-elementor' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '.site-footer', ] ); $this->end_controls_section(); $this->start_controls_section( 'hello_footer_logo_section', [ 'tab' => 'hello-settings-footer', 'label' => esc_html__( 'Site Logo', 'hello-elementor' ), 'condition' => [ 'hello_footer_logo_display!' => '', ], ] ); $this->add_control( 'hello_footer_logo_type', [ 'label' => esc_html__( 'Type', 'hello-elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'logo', 'options' => [ 'logo' => esc_html__( 'Logo', 'hello-elementor' ), 'title' => esc_html__( 'Title', 'hello-elementor' ), ], 'frontend_available' => true, ] ); $this->add_responsive_control( 'hello_footer_logo_width', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Logo Width', 'hello-elementor' ), 'description' => sprintf( /* translators: %s: Link that opens Elementor's "Site Identity" panel. */ __( 'Go to Site Identity to manage your site\'s logo', 'hello-elementor' ), "javascript:\$e.route('panel/global/settings-site-identity')" ), 'size_units' => [ '%', 'px', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'max' => 1000, ], 'em' => [ 'max' => 100, ], 'rem' => [ 'max' => 100, ], ], 'condition' => [ 'hello_footer_logo_display' => 'yes', 'hello_footer_logo_type' => 'logo', ], 'selectors' => [ '.site-footer .site-branding .site-logo img' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'hello_footer_title_color', [ 'label' => esc_html__( 'Text Color', 'hello-elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'hello_footer_logo_display' => 'yes', 'hello_footer_logo_type' => 'title', ], 'selectors' => [ '.site-footer h4.site-title a' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'hello_footer_title_typography', 'label' => esc_html__( 'Typography', 'hello-elementor' ), 'condition' => [ 'hello_footer_logo_display' => 'yes', 'hello_footer_logo_type' => 'title', ], 'selector' => '.site-footer h4.site-title', ] ); $this->add_control( 'hello_footer_title_link', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => sprintf( /* translators: %s: Link that opens Elementor's "Site Identity" panel. */ __( 'Go to Site Identity to manage your site\'s title', 'hello-elementor' ), "javascript:\$e.route('panel/global/settings-site-identity')" ), 'content_classes' => 'elementor-control-field-description', 'condition' => [ 'hello_footer_logo_display' => 'yes', 'hello_footer_logo_type' => 'title', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'hello_footer_tagline', [ 'tab' => 'hello-settings-footer', 'label' => esc_html__( 'Tagline', 'hello-elementor' ), 'condition' => [ 'hello_footer_tagline_display' => 'yes', ], ] ); $this->add_control( 'hello_footer_tagline_color', [ 'label' => esc_html__( 'Text Color', 'hello-elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'hello_footer_tagline_display' => 'yes', ], 'selectors' => [ '.site-footer .site-description' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'hello_footer_tagline_typography', 'label' => esc_html__( 'Typography', 'hello-elementor' ), 'condition' => [ 'hello_footer_tagline_display' => 'yes', ], 'selector' => '.site-footer .site-description', ] ); $this->add_control( 'hello_footer_tagline_link', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => sprintf( /* translators: %s: Link that opens Elementor's "Site Identity" panel. */ __( 'Go to Site Identity to manage your site\'s tagline', 'hello-elementor' ), "javascript:\$e.route('panel/global/settings-site-identity')" ), 'content_classes' => 'elementor-control-field-description', ] ); $this->end_controls_section(); $this->start_controls_section( 'hello_footer_menu_tab', [ 'tab' => 'hello-settings-footer', 'label' => esc_html__( 'Menu', 'hello-elementor' ), 'condition' => [ 'hello_footer_menu_display' => 'yes', ], ] ); $available_menus = wp_get_nav_menus(); $menus = [ '0' => esc_html__( '— Select a Menu —', 'hello-elementor' ) ]; foreach ( $available_menus as $available_menu ) { $menus[ $available_menu->term_id ] = $available_menu->name; } if ( 1 === count( $menus ) ) { $this->add_control( 'hello_footer_menu_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => '' . esc_html__( 'There are no menus in your site.', 'hello-elementor' ) . '
' . sprintf( __( 'Go to Menus screen to create one.', 'hello-elementor' ), admin_url( 'nav-menus.php?action=edit&menu=0' ) ), 'separator' => 'after', 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', ] ); } else { $this->add_control( 'hello_footer_menu', [ 'label' => esc_html__( 'Menu', 'hello-elementor' ), 'type' => Controls_Manager::SELECT, 'options' => $menus, 'default' => array_keys( $menus )[0], 'description' => sprintf( __( 'Go to the Menus screen to manage your menus.', 'hello-elementor' ), admin_url( 'nav-menus.php' ) ), ] ); $this->add_control( 'hello_footer_menu_warning', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => esc_html__( 'Changes will be reflected in the preview only after the page reloads.', 'hello-elementor' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', ] ); $this->add_control( 'hello_footer_menu_color', [ 'label' => esc_html__( 'Color', 'hello-elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ 'footer .footer-inner .site-navigation a' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'hello_footer_menu_typography', 'label' => esc_html__( 'Typography', 'hello-elementor' ), 'selector' => 'footer .footer-inner .site-navigation a', ] ); } $this->end_controls_section(); $this->start_controls_section( 'hello_footer_copyright_section', [ 'tab' => 'hello-settings-footer', 'label' => esc_html__( 'Copyright', 'hello-elementor' ), 'conditions' => [ 'relation' => 'and', 'terms' => [ [ 'name' => 'hello_footer_copyright_display', 'operator' => '=', 'value' => 'yes', ], ], ], ] ); $this->add_control( 'hello_footer_copyright_text', [ 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__( 'All rights reserved', 'hello-elementor' ), ] ); $this->add_control( 'hello_footer_copyright_color', [ 'label' => esc_html__( 'Text Color', 'hello-elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'hello_footer_copyright_display' => 'yes', ], 'selectors' => [ '.site-footer .copyright p' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'hello_footer_copyright_typography', 'label' => esc_html__( 'Typography', 'hello-elementor' ), 'condition' => [ 'hello_footer_copyright_display' => 'yes', ], 'selector' => '.site-footer .copyright p', ] ); $this->end_controls_section(); } public function on_save( $data ) { // Save chosen footer menu to the WP settings. if ( isset( $data['settings']['hello_footer_menu'] ) ) { $menu_id = $data['settings']['hello_footer_menu']; $locations = get_theme_mod( 'nav_menu_locations' ); $locations['menu-2'] = (int) $menu_id; set_theme_mod( 'nav_menu_locations', $locations ); } } public function get_additional_tab_content() { if ( ! defined( 'ELEMENTOR_PRO_VERSION' ) ) { return sprintf( '

%1$s

%2$s

%3$s
', esc_html__( 'Create a custom footer with multiple options', 'hello-elementor' ), esc_html__( 'Upgrade to Elementor Pro and enjoy free design and many more features', 'hello-elementor' ), esc_html__( 'Upgrade', 'hello-elementor' ), get_template_directory_uri() . '/assets/images/go-pro.svg' ); } else { return sprintf( '

%1$s

%2$s

%3$s
', esc_html__( 'Create a custom footer with the new Theme Builder', 'hello-elementor' ), esc_html__( 'With the new Theme Builder you can jump directly into each part of your site', 'hello-elementor' ), esc_html__( 'Create Footer', 'hello-elementor' ), get_template_directory_uri() . '/assets/images/go-pro.svg', get_admin_url( null, 'admin.php?page=elementor-app#/site-editor/templates/footer' ) ); } } } * @copyright (c) 2018, Webcraftic Ltd * * @package factory-forms * @since 1.0.0 */ // Exit if accessed directly if( !defined('ABSPATH') ) { exit; } // creating a license manager for each plugin created via the factory add_action('wbcr_factory_forms_474_plugin_created', 'wbcr_factory_forms_474_plugin_created'); function wbcr_factory_forms_474_plugin_created($plugin) { $plugin->forms = new Wbcr_FactoryForms474_Manager($plugin); } if( !class_exists('Wbcr_FactoryForms474_Manager') ) { class Wbcr_FactoryForms474_Manager { // ---------------------------------------------------- // Static fields and methods // ---------------------------------------------------- /** * This array contains data to use a respective control. * * @since 1.0.0 * @var array */ public static $registered_controls = array(); /** * Registers a new control. * * @since 1.0.0 * @param mixed[] $item Control data having the following format: * type => a control type * class => a control php class * include => a path to include control code * @return void */ public function registerControl($item) { self::$registered_controls[$item['type']] = $item; require_once $item['include']; } /** * Registers a set of new controls. * * @see FactoryForms474_Form::registerControl() * * @since 1.0.0 * @return void */ public function registerControls($data) { foreach($data as $item) $this->registerControl($item); } /** * This array contains holder data to use a respective control holder. * * @since 1.0.0 * @var array */ public static $registered_holders = array(); /** * Registers a new holder. * * @since 1.0.0 * @param mixed[] $item Holder data having the follwoin format: * type => a control holder type * class => a control holder php class * include => a path to include control holder code * @return void */ public function registerHolder($item) { self::$registered_holders[$item['type']] = $item; require_once $item['include']; } /** * Registers a set of new holder controls. * * @see FactoryForms474_Form::registerHolder() * * @since 1.0.0 * @return void */ public function registerHolders($data) { foreach($data as $item) $this->registerHolder($item); } /** * This array contains custom form element data to use a respective elements. * * @since 1.0.0 * @var array */ public static $registered_custom_elements = array(); /** * Registers a new custom form element. * * @since 1.0.0 * @return void */ public function registerCustomElement($item) { self::$registered_custom_elements[$item['type']] = $item; require_once $item['include']; } /** * Registers a set of new custom form elements. * * @see FactoryForms474_Form::registerCustomElement() * * @since 1.0.0 * @return void */ public function registerCustomElements($data) { foreach($data as $item) $this->registerCustomElement($item); } /** * Contains a set of layouts registered for forms. * * @since 1.0.0 * @var mixed[] */ public static $form_layouts = array(); /** * Registers a new layout for forms. * * @since 1.0.0 * @param array $data A layout data. Has the following format: * name => a name of the layout * class => a layout php class * include => a path to include layout code * @return void */ public function registerFormLayout($data) { self::$form_layouts[$data['name']] = $data; } /** * Extra propery that determines which UI is used in the admin panel. * * @since 1.0.0 * @var string */ public static $temper; /** * A flat to register control only once. * * @since 3.0.7 * @var bool */ public static $controls_registered = false; } } if( !class_exists('Wbcr_FactoryForms474_Form') ) { /** * An abstraction for forms. */ class Wbcr_FactoryForms474_Form { // ---------------------------------------------------- // Object fields and methods // ---------------------------------------------------- /** * A value provider of the form that is used to save and load values. * * @since 1.0.0 * @var Wbcr_IFactoryForms474_ValueProvider */ private $provider; /** * A prefix that will be used for names of input fields in the form. * * @since 1.0.0 * @var string */ public $scope; /** * A form name that is used to call hooks and filter data. * * @since 1.0.0 * @var string */ public $name = 'default'; /** * It's not yet input controls. The array contains names of input controls and their * options that are used to render and process input controls. * * @since 1.0.0 * @var mixed[] */ protected $items = array(); /** * Full set of input controls available after building the form. * * The array contains objects. * * @since 1.0.0 * @var array */ private $controls = array(); /** * A layout for the form. * * @since 1.0.0 * @var string */ public $form_layout; /** * A current form layout used to render a form. * * @since 1.0.0 * @var Wbcr_FactoryForms474_FormLayout */ public $layout; /** * Creates a new instance of a form. * * @since 1.0.0 * @param string $options Contains form options to setup. */ /** * Creates a new instance of a form. * * @since 1.0.0 * @param array $options * @param Wbcr_Factory474_Plugin $plugin */ public function __construct(array $options, Wbcr_Factory474_Plugin $plugin) { // register controls once, when the first form is created if( !Wbcr_FactoryForms474_Manager::$controls_registered ) { do_action('wbcr_factory_forms_474_register_controls', $plugin); //if( !empty($plugin) ) { do_action('wbcr_factory_forms_474_register_controls_' . $plugin->getPluginName(), $plugin); //} Wbcr_FactoryForms474_Manager::$controls_registered = true; } $this->scope = isset($options['scope']) ? $options['scope'] : null; $this->name = isset($options['name']) ? $options['name'] : $this->name; /*$this->all_sites = isset($options['all_sites']) ? $options['all_sites'] : false;*/ if( isset($options['formLayout']) ) { $this->form_layout = $options['formLayout']; } else { $this->form_layout = 'bootstrap-3'; } Wbcr_FactoryForms474_Manager::$temper = 'flat'; } /** * Sets a provider for the control. * * @since 1.0.0 * @param Wbcr_IFactoryForms474_ValueProvider $provider * @return void */ public function setProvider($provider) { $this->provider = $provider; } /** * Adds items into the form. * * It's base method to use during configuration form. * * @since 1.0.0 * @param array $array An array of items. */ public function add($array) { if( (bool)count(array_filter(array_keys($array), 'is_string')) ) { $this->items[] = $array; } else { $this->items = array_merge($this->items, $array); } } /** * Returns items to render. * * Has the follwoing hooks: * 'factory_form_items' ( $formName, $items ) to filter form controls before building. * * @since 1.0.0 * @return mixed[] Items to render. */ public function getItems() { return apply_filters('wbcr_factory_474_form_items', $this->items, $this->name); } /** * Returns form controls (control objects). * * @since 1.0.0 * @return Wbcr_FactoryForms474_Control[] */ public function getControls() { if( !empty($this->controls) ) { return $this->controls; } $this->createControls(); return $this->controls; } /** * Builds a form items to the control objects ready to use. * * @param null $holder * @return Wbcr_FactoryForms474_Control[] */ public function createControls($holder = null) { $items = ($holder == null) ? $this->getItems() : $holder['items']; foreach($items as $item) { if( $this->isControlHolder($item) && $this->isControl($item) ) { $this->controls[] = $this->createControl($item); $this->createControls($item); // if a current item is a control holder } elseif( $this->isControlHolder($item) ) { $this->createControls($item); // if a current item is an input control } elseif( $this->isControl($item) ) { $this->controls[] = $this->createControl($item); // if a current item is an input control } elseif( $this->isCustomElement($item) ) { // nothing // otherwise, show the error } else { die('[ERROR] Invalid item.'); } } return $this->controls; } /** * Create an element. * * @since 1.0.0 * @param array $item Item data. * @return Wbcr_FactoryForms474_FormElement|null A form element. */ public function createElement($item) { if( $this->isControl($item) ) { return $this->createControl($item); } elseif( $this->isControlHolder($item) ) { return $this->createHolder($item); } elseif( $this->isCustomElement($item) ) { return $this->createCustomElement($item); } else { printf('[ERROR] The element with the type %s was not found.', $item['type']); exit; } } /** * Creates a set of elements. * * @since 1.0.0 * @param mixed[] $item Data of items. * @return Wbcr_FactoryForms474_FormElement[] Created elements. */ public function createElements($items = array()) { $objects = array(); foreach($items as $item) $objects[] = $this->createElement($item); return $objects; } /** * Create a control. * * @since 1.0.0 * @param array $item Item data. * @return Wbcr_FactoryForms474_Control A control object. */ public function createControl($item) { $object = null; if( is_array($item) ) { $control_data = Wbcr_FactoryForms474_Manager::$registered_controls[$item['type']]; require_once($control_data['include']); $options = $item; $options['scope'] = $this->scope; $object = new $control_data['class']($options, $this); } elseif( gettype($item) == 'object' ) { $object = $item; } else { die('[ERROR] Invalid input control.'); } $object->setProvider($this->provider); return $object; } /** * Create a control holder. * * @since 1.0.0 * @param array $item Item data. * @return Wbcr_FactoryForms474_Holder A control holder object. */ public function createHolder($item) { $object = null; if( is_array($item) ) { $holderData = Wbcr_FactoryForms474_Manager::$registered_holders[$item['type']]; require_once($holderData['include']); $object = new $holderData['class']($item, $this); } elseif( gettype($item) == 'object' ) { $object = $item; } else { die('[ERROR] Invalid control holder.'); } return $object; } /** * Create a custom form element. * * @since 1.0.0 * @param mixed $item Item data. * @return Wbcr_FactoryForms474_FormElement A custom form element object. */ public function createCustomElement($item) { $object = null; if( is_array($item) ) { $data = Wbcr_FactoryForms474_Manager::$registered_custom_elements[$item['type']]; require_once($data['include']); $options = $item; $object = new $data['class']($options, $this); } elseif( gettype($item) == 'object' ) { $object = $item; } else { die('[ERROR] Invalid custom form element.'); } return $object; } /** * Renders a form. * * @since 1.0.0 * @param mixed[] $options Options for a form layout. * @return void */ public function html($options = array()) { if( !isset(Wbcr_FactoryForms474_Manager::$form_layouts[$this->form_layout]) ) { die(sprintf('[ERROR] The form layout %s was not found.', $this->form_layout)); } // include a render code $layout_data = Wbcr_FactoryForms474_Manager::$form_layouts[$this->form_layout]; require_once($layout_data['include']); $this->connectAssets(); if( $this->provider ) { $this->provider->init(); } $layout = new $layout_data['class']($options, $this); $this->layout = $layout; $this->layout->render(); } /** * Connects assets (css and js). * * @since 1.0.0 * @param mixed[] $options Options for a form layout. * @return void */ private function connectAssets() { $this->connectAssetsForItems(); $layout_data = Wbcr_FactoryForms474_Manager::$form_layouts[$this->form_layout]; if( $layout_data['name'] == 'default' ) { if( isset($layout_data['style']) ) { wp_enqueue_style('wbcr-factory-form-000-default-layout', $layout_data['style']); } if( isset($layout_data['script']) ) { wp_enqueue_script('wbcr-factory-form-000-default-layout-', $layout_data['script']); } } else { if( isset($layout_data['style']) ) { wp_enqueue_style('wbcr-factory-form-layout-' . $layout_data['name'], $layout_data['style']); } if( isset($layout_data['script']) ) { wp_enqueue_script('wbcr-factory-form-layout-' . $layout_data['name'], $layout_data['script']); } } } /** * Connects scripts and styles of form items. * * @since 1.0.0 * @param mixed[] $items Items for which it's nessesary to connect scripts and styles. * @return void */ public static function connectAssetsForItems($items = array()) { foreach($items as $item) self::connectAssetsForItem($item); } /** * Connects scripts and styles of form item. * * @since 1.0.0 * @param mixed[] $item Item for which it's nessesary to connect scripts and styles. * @return void */ public static function connectAssetsForItem($item) { if( !is_array($item) ) { return; } $type = $item['type']; $haystack = array(); if( self::isControl($type) ) { $haystack = Wbcr_FactoryForms474_Manager::$registered_controls; } elseif( self::isControlHolder($type) ) { $haystack = Wbcr_FactoryForms474_Manager::$registered_holders; } if( isset($haystack[$type]) ) { if( isset($haystack[$type]['style']) ) { $style = $haystack[$type]['style']; if( !wp_style_is($style) ) { wp_enqueue_style('factory-form-control-' . $type, $style); } } if( isset($haystack[$type]['script']) ) { $script = $haystack[$type]['script']; if( !wp_script_is($script) ) { wp_enqueue_script('factory-form-control-' . $type, $script, array('jquery')); } } } if( isset($item['items']) ) { self::connectAssetsForItem($item['items']); } } /** * Saves form data by using a specified value provider. * * @since 1.0.0 */ public function save() { if( !$this->provider ) { return null; } $controls = $this->getControls(); foreach($controls as $control) { $values = $control->getValuesToSave(); foreach($values as $key_to_save => $value_to_save) { $this->provider->setValue($key_to_save, $value_to_save); } } $this->provider->saveChanges(); } /** * Returns true if a given item is an input control item. * * @since 1.0.0 * @param mixed[] $item * @return bool */ public static function isControl($item) { return isset(Wbcr_FactoryForms474_Manager::$registered_controls[$item['type']]); } /** * Returns true if a given item is an control holder item. * * @since 1.0.0 * @param mixed[] $item * @return bool */ public static function isControlHolder($item) { return isset(Wbcr_FactoryForms474_Manager::$registered_holders[$item['type']]); } /** * Returns true if a given item is html markup. * * @since 1.0.0 * @param mixed[] $item * @return bool */ public static function isCustomElement($item) { return isset(Wbcr_FactoryForms474_Manager::$registered_custom_elements[$item['type']]); } } }