GRAYBYTE WORDPRESS FILE MANAGER8534

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/essential-blocks/includes/Blocks/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/essential-blocks/includes/Blocks//Form.php
<?php

namespace EssentialBlocks\Blocks;

use EssentialBlocks\Core\Block;
use EssentialBlocks\Utils\Helper;

class Form extends Block
{
    protected $frontend_scripts = [ 'essential-blocks-form-frontend' ];
    protected $frontend_styles  = [ 'essential-blocks-fontawesome' ];

    /**
     * Default attributes
     *
     * @var array
     */
    protected $default_attributes;

    public function __construct()
    {
        $this->default_attributes = [
            'btnAddIcon'   => false,
            'iconPosition' => 'right',
            'buttonText'   => __( 'Submit', 'essential-blocks' ),
            'icon'         => 'fas fa-chevron-right',
            'formLayout'   => 'block',
            'formStyle'    => 'form-style-classic',
            'enableMultistepForm' => false,
            'stepIndecator' => true,
            'stepNavigationStyle' => 'progress-bar',
            'enableStepCount' => false,
            'enableStepIcon' => true,
            'enableStepSubtitle' => false,
            'nextBtnText' => 'Next',
            'prevBtnText' => 'Previous',
         ];
    }

    /**
     * Unique name of the block.
     * @return string
     */
    public function get_name()
    {
        return 'form';
    }

    /**
     * Initialize the InnerBlocks for Accordion
     * @return array<Block>
     */
    public function inner_blocks()
    {
        return [
            FormTextField::get_instance()
         ];
    }

    /**
     * Register all other scripts
     * @return void
     */
    public function register_scripts()
    {
        $this->assets_manager->register(
            'form-frontend',
            $this->path() . '/frontend.js',
            [ 'essential-blocks-babel-bundle' ]
        );
    }

    /**
     * Render callback
     */
    public function render_callback( $attributes, $content )
    {
        if ( is_admin() ) {
            return;
        }

        //Modify wp_kses rules for Form Block kses
        add_filter( 'wp_kses_allowed_html', [ new Helper, 'eb_allowed_html' ], 99, 2 );

        $_essential_attributes = [
            'formType'         => 'contact_form',
            'preset'           => 'contact_form_1',
            'confirmationType' => 'message',
            'successMessage'   => __( 'Your form has been submitted Successfully!', 'essential-blocks' ),
            'errorMessage'     => __( 'Your form couldn\'t been submitted! Please try again', 'essential-blocks' )
         ];

        foreach ( $_essential_attributes as $key => $value ) {
            if ( isset( $attributes[ $key ] ) && is_bool( $attributes[ $key ] ) ) {
                $_essential_attributes[ $key ] = $attributes[ $key ];
            } elseif ( ! empty( $attributes[ $key ] ) ) {
                $_essential_attributes[ $key ] = $attributes[ $key ];
            } else {
                $_essential_attributes[ $key ] = $value;
            }
        }


        $attributes = wp_parse_args( $attributes, $this->default_attributes );

        if ( empty( $attributes[ 'formType' ] ) ) {
            return '';
        }
        if ( empty( $content ) ) {
            return '';
        }
        $classHook = isset( $attributes[ 'classHook' ] ) ? $attributes[ 'classHook' ] : '';

        $submit_btn_attr = apply_filters( 'eb_form_submit_btn_attr', [
            'data-id'      => $attributes[ 'blockId' ],
            'data-form-id' => $attributes[ 'formId' ]
         ] );

        $submit_btn_classes = apply_filters( 'eb_form_submit_btn_classes', 'btn btn-primary eb-form-submit-button' );

        $submit_button_icon = sprintf(
            '%1$s',
            Helper::eb_render_icon( Helper::eb_get_icon_type( $attributes[ 'icon' ] ), 'eb-button-icon', $attributes[ 'icon' ] )
        );

        $submit_button_html = sprintf(
            '<button type="submit" class="%1$s" %2$s>
                %4$s%3$s%5$s
                <img class="eb-form-submit-loader" src="%6$sassets/images/loading.svg" />
            </button>',
            $submit_btn_classes,
            http_build_query( $submit_btn_attr, '', ' ' ),
            $attributes[ 'buttonText' ],
            $attributes[ 'btnAddIcon' ] && $attributes[ 'iconPosition' ] === 'left' ? $submit_button_icon : '',
            $attributes[ 'btnAddIcon' ] && $attributes[ 'iconPosition' ] === 'right' ? $submit_button_icon : '',
            ESSENTIAL_BLOCKS_URL
        );

        $confirmation_div_attr = apply_filters( 'eb_form_confirmation_div_attr', [
            'data-confirmation-type' => esc_attr( $_essential_attributes[ 'confirmationType' ] ),
            'data-success'           => esc_html( $_essential_attributes[ 'successMessage' ] ),
            'data-error'             => esc_html( $_essential_attributes[ 'errorMessage' ] )
         ], $attributes );

        $attributes_html = '';
        foreach ( $confirmation_div_attr as $key => $value ) {
            $attributes_html .= sprintf( '%s="%s" ', esc_attr( $key ), esc_attr( $value ) );
        }

        $confirmation_div_html = sprintf(
            '<div class="eb_form_submit_response" %1$s></div>',
            trim( $attributes_html )
        );

        // $confirmation_div_html = sprintf(
        //     '<div class="eb_form_submit_response" %1$s></div>',
        //     http_build_query( $confirmation_div_attr, '', ' ' )
        // );

        ob_start();
        Helper::views( 'form-block', array_merge( $attributes, [
            'essentialAttr'         => $_essential_attributes,
            'classHook'             => $classHook,
            'submit_button_html'    => $submit_button_html,
            'confirmation_div_html' => $confirmation_div_html,
            'content'               => $content,
            'nonce'                 => wp_create_nonce( $attributes[ 'blockId' ] . '-nonce' )

         ] ) );

        return ob_get_clean();
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:25
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:25
giriqfky / giriqfky
0644
Accordion.php
1.034 KB
February 26 2025 16:22:10
giriqfky / giriqfky
0644
AccordionItem.php
0.327 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
AddToCart.php
3.433 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
AdvancedHeading.php
4.59 KB
December 24 2024 15:38:54
giriqfky / giriqfky
0644
AdvancedImage.php
1.937 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
AdvancedNavigation.php
0.687 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
AdvancedTabs.php
0.865 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
AdvancedVideo.php
0.997 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Breadcrumbs.php
11.373 KB
January 12 2025 17:13:54
giriqfky / giriqfky
0644
Button.php
0.343 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
CallToAction.php
0.356 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Column.php
0.215 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
CountDown.php
0.591 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
DualButton.php
0.65 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
FeatureList.php
0.324 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
FlipBox.php
0.633 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
FluentForms.php
3.774 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Form.php
5.722 KB
June 29 2025 14:07:42
giriqfky / giriqfky
0644
FormTextField.php
0.24 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
GoogleMap.php
2.554 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Icon.php
0.315 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ImageComparison.php
0.605 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
ImageGallery.php
2.264 KB
December 24 2024 17:17:58
giriqfky / giriqfky
0644
InfoBox.php
0.365 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
InstagramFeed.php
5.891 KB
February 26 2025 16:22:10
giriqfky / giriqfky
0644
InteractivePromo.php
0.313 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
LottieAnimation.php
0.594 KB
February 18 2025 14:31:10
giriqfky / giriqfky
0644
NftGallery.php
0.634 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Notice.php
0.566 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
NumberCounter.php
0.584 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
Openverse.php
0.469 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ParallaxSlider.php
0.648 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
PopUp.php
0.61 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
PostBlock.php
1.572 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
PostCarousel.php
4.623 KB
May 19 2025 15:07:08
giriqfky / giriqfky
0644
PostGrid.php
5.75 KB
January 12 2025 17:13:54
giriqfky / giriqfky
0644
PostMeta.php
3.512 KB
December 24 2024 15:38:54
giriqfky / giriqfky
0644
PricingTable.php
0.325 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ProductDetails.php
3.514 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ProductImages.php
2.835 KB
May 08 2025 15:01:12
giriqfky / giriqfky
0644
ProductPrice.php
4.752 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ProductRating.php
2.97 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ProgressBar.php
0.59 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Row.php
0.444 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ShapeDivider.php
0.588 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Slider.php
0.973 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Social.php
0.344 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
SocialShare.php
3.889 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Tab.php
0.209 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
TableOfContents.php
16.936 KB
June 01 2025 14:07:44
giriqfky / giriqfky
0644
Taxonomy.php
4.897 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
TeamMember.php
0.353 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Testimonial.php
0.364 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
Text.php
2.48 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
ToggleContent.php
0.599 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
TypingText.php
0.58 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
WPForms.php
2.921 KB
October 30 2024 16:05:38
giriqfky / giriqfky
0644
WooProductGrid.php
8.389 KB
March 24 2025 12:57:24
giriqfky / giriqfky
0644
Wrapper.php
0.351 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644
price.php
0.233 KB
August 27 2024 16:37:06
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF