Файловый менеджер - Редактировать - /home/ephorei/www/wp-includes/images/media/q2m9hb/bricks.tar
Назад
elements/form-widget.php 0000644 00000007656 15006206061 0011327 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 } } } service-provider.php 0000644 00000002115 15006206061 0010540 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; } }
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка