$16 GRAYBYTE WORDPRESS FILE MANAGER $95

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/contact.malloca.com/wp-content/plugins/jetformbuilder/includes/admin/

HOME
Current File : /home/bqrcodec/contact.malloca.com/wp-content/plugins/jetformbuilder/includes/admin//editor.php
<?php

namespace Jet_Form_Builder\Admin;

use Jet_Form_Builder\Actions\Conditions\Condition_Manager as Action_Condition_Manager;
use Jet_Form_Builder\Admin\Pages\Pages_Manager;
use Jet_Form_Builder\Admin\Tabs_Handlers\Tab_Handler_Manager;
use Jet_Form_Builder\Blocks\Validation;
use Jet_Form_Builder\Classes\Arguments\Form_Arguments;
use Jet_Form_Builder\Classes\Http\Utm_Url;
use Jet_Form_Builder\Classes\Tools;
use Jet_Form_Builder\Gateways\Gateway_Manager;
use Jet_Form_Builder\Plugin;
use Jet_Form_Builder\Blocks\Conditional_Block\Condition_Manager as Block_Condition_Manager;
use Jet_Form_Builder\Post_Meta\Messages_Meta;

/**
 * Form editor class
 * Thanks Tom J Nowell for initial editor idea and inspiration!
 */

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

/**
 * Define Editor class
 */
class Editor {

	const EDITOR_HANDLE         = 'jet-form-builder-editor';
	const EDITOR_PACKAGE_HANDLE = 'jet-form-builder-editor-package';

	public function __construct() {
		add_action( 'enqueue_block_editor_assets', array( $this, 'admin_assets' ) );
	}

	/**
	 * Register admin assets
	 *
	 * @return void [type] [description]
	 */
	public function admin_assets() {
		if ( jet_form_builder()->post_type->is_form_editor ) {
			$this->enqueue_assets();
		} else {
			$this->enqueue_form_assets();
		}
	}

	/**
	 * Returns taxonomies list for the config
	 *
	 * @return [type] [description]
	 */
	public function get_taxonomies_list() {

		$taxonomies = get_taxonomies( array(), 'objects' );

		$result = array();

		foreach ( $taxonomies as $tax ) {
			$result[] = array(
				'value' => $tax->name,
				'label' => sprintf( '%1$s (%2$s)', $tax->label, $tax->name ),
			);
		}

		return $result;

	}

	public function get_preset_config() {
		return apply_filters(
			'jet-form-builder/editor/preset-config',
			array(
				'global_fields' => array(
					array(
						'name'    => 'from',
						'label'   => __( 'Source:', 'jet-form-builder' ),
						'type'    => 'select',
						'options' => Tools::with_placeholder(
							array(
								array(
									'value' => 'post',
									'label' => __( 'Post', 'jet-form-builder' ),
								),
								array(
									'value' => 'user',
									'label' => __( 'User', 'jet-form-builder' ),
								),
								array(
									'value' => 'query_var',
									'label' => __( 'URL Query Variable', 'jet-form-builder' ),
								),
							)
						),
					),
					array(
						'name'      => 'post_from',
						'label'     => __( 'Get post ID from:', 'jet-form-builder' ),
						'type'      => 'select',
						'options'   => Tools::with_placeholder(
							array(
								array(
									'value' => 'current_post',
									'label' => __( 'Current post', 'jet-form-builder' ),
								),
								array(
									'value' => 'query_var',
									'label' => __( 'URL Query Variable', 'jet-form-builder' ),
								),
							)
						),
						'condition' => array(
							'field' => 'from',
							'value' => 'post',
						),
					),
					array(
						'name'      => 'user_from',
						'label'     => __( 'Get user ID from:', 'jet-form-builder' ),
						'type'      => 'select',
						'options'   => Tools::with_placeholder(
							array(
								array(
									'value' => 'current_user',
									'label' => __( 'Current user', 'jet-form-builder' ),
								),
								array(
									'value' => 'queried_user',
									'label' => __( 'Queried user', 'jet-form-builder' ),
								),
								array(
									'value' => 'query_var',
									'label' => __( 'URL Query Variable', 'jet-form-builder' ),
								),
							)
						),
						'condition' => array(
							'field' => 'from',
							'value' => 'user',
						),
					),
					array(
						'name'             => 'query_var',
						'label'            => __( 'Query variable name:', 'jet-form-builder' ),
						'type'             => 'text',
						'custom_condition' => 'query_var',
						'position'         => 'dynamic',
					),
				),
				'map_fields'    => array(
					array(
						'name'             => 'key',
						'label'            => __( 'Query variable key', 'jet-form-builder' ),
						'type'             => 'text',
						'position'         => 'general',
						'parent_condition' => array(
							'field' => 'from',
							'value' => 'query_var',
						),
					),
					array(
						'name'             => 'prop',
						'label'            => __( 'Post property', 'jet-form-builder' ),
						'type'             => 'select',
						'options'          => Tools::with_placeholder(
							array(
								array(
									'value' => 'ID',
									'label' => __( 'Post ID', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_title',
									'label' => __( 'Post Title', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_content',
									'label' => __( 'Post Content', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_status',
									'label' => __( 'Post Status', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_author',
									'label' => __( 'Post Author', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_excerpt',
									'label' => __( 'Post Excerpt', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_date',
									'label' => __( 'Post Date', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_date_gmt',
									'label' => __( 'Post Date GMT', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_thumb',
									'label' => __( 'Post Thumbnail', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_meta',
									'label' => __( 'Post Meta', 'jet-form-builder' ),
								),
								array(
									'value' => 'post_terms',
									'label' => __( 'Post Terms', 'jet-form-builder' ),
								),
							)
						),
						'parent_condition' => array(
							'field' => 'from',
							'value' => 'post',
						),
					),
					array(
						'name'             => 'key',
						'label'            => __( 'Taxonomy', 'jet-form-builder' ),
						'type'             => 'select',
						'options'          => Tools::with_placeholder( $this->get_taxonomies_list() ),
						'parent_condition' => array(
							'field' => 'from',
							'value' => 'post',
						),
						'condition'        => array(
							'field' => 'prop',
							'value' => 'post_terms',
						),
					),
					array(
						'name'             => 'key',
						'label'            => __( 'Meta field key', 'jet-form-builder' ),
						'type'             => 'text',
						'parent_condition' => array(
							'field' => 'from',
							'value' => 'post',
						),
						'condition'        => array(
							'field' => 'prop',
							'value' => 'post_meta',
						),
					),
					array(
						'name'             => 'prop',
						'label'            => __( 'User field', 'jet-form-builder' ),
						'type'             => 'select',
						'options'          => Tools::with_placeholder(
							array(
								array(
									'value' => 'ID',
									'label' => __( 'User ID', 'jet-form-builder' ),
								),
								array(
									'value' => 'user_login',
									'label' => __( 'User Login', 'jet-form-builder' ),
								),
								array(
									'value' => 'user_email',
									'label' => __( 'Email', 'jet-form-builder' ),
								),
								array(
									'value' => 'password',
									'label' => __( 'Password', 'jet-form-builder' ),
								),
								array(
									'value' => 'first_name',
									'label' => __( 'First Name', 'jet-form-builder' ),
								),
								array(
									'value' => 'last_name',
									'label' => __( 'Last Name', 'jet-form-builder' ),
								),
								array(
									'value' => 'user_url',
									'label' => __( 'User URL', 'jet-form-builder' ),
								),
								array(
									'value' => 'user_meta',
									'label' => __( 'User Meta', 'jet-form-builder' ),
								),
							)
						),
						'parent_condition' => array(
							'field' => 'from',
							'value' => 'user',
						),
					),
					array(
						'name'             => 'key',
						'label'            => __( 'Meta field key', 'jet-form-builder' ),
						'type'             => 'text',
						'parent_condition' => array(
							'field' => 'from',
							'value' => 'user',
						),
						'condition'        => array(
							'field' => 'prop',
							'value' => 'user_meta',
						),
					),
				),
			)
		);
	}

	/**
	 * Enqueue editor assets
	 *
	 * @return void
	 */
	public function enqueue_assets() {
		do_action( 'jet-form-builder/editor-package/before', $this, self::EDITOR_PACKAGE_HANDLE );

		wp_enqueue_script(
			self::EDITOR_PACKAGE_HANDLE,
			Plugin::instance()->plugin_url( 'assets/js/editor/package{min}.js' ),
			array(
				'wp-editor',
				'wp-core-data',
				'wp-data',
				'wp-block-library',
				'wp-format-library',
				'wp-api-fetch',
			),
			JET_FORM_BUILDER_VERSION,
			true
		);

		wp_localize_script(
			self::EDITOR_PACKAGE_HANDLE,
			'jetFormEvents',
			jet_fb_events()->to_array()
		);

		wp_localize_script(
			self::EDITOR_PACKAGE_HANDLE,
			'jetFormValidation',
			Validation::instance()->to_array()
		);

		wp_localize_script(
			self::EDITOR_PACKAGE_HANDLE,
			'jetFormBlockConditions',
			Block_Condition_Manager::instance()->to_array()
		);

		wp_set_script_translations(
			self::EDITOR_PACKAGE_HANDLE,
			'jet-form-builder',
			Plugin::instance()->plugin_dir( 'languages' )
		);

		do_action( 'jet-form-builder/editor-assets/before', $this, self::EDITOR_HANDLE );

		wp_enqueue_script(
			self::EDITOR_HANDLE,
			Plugin::instance()->plugin_url( 'assets/js/editor/form.builder{min}.js' ),
			array(),
			JET_FORM_BUILDER_VERSION,
			true
		);

		wp_enqueue_style(
			self::EDITOR_HANDLE,
			JET_FORM_BUILDER_URL . 'assets/css/editor.css',
			array(
				'media',
				'l10n',
				'buttons',
				'wp-edit-blocks',
				'wp-editor',
			),
			JET_FORM_BUILDER_VERSION,
			'all'
		);

		$conditions_settings = ( new Action_Condition_Manager() )->get_settings();

		/** @var Messages_Meta $messages_meta */
		$messages_meta = jet_form_builder()->post_type->get_meta( Messages_Meta::class );

		$utm     = new Utm_Url( 'wp-admin/editor-jet-form' );
		$addons  = JET_FORM_BUILDER_SITE . '/addons/';
		$pricing = JET_FORM_BUILDER_SITE . '/pricing/';

		wp_localize_script(
			self::EDITOR_PACKAGE_HANDLE,
			'JetFormEditorData',
			array(
				'presetConfig'            => $this->get_preset_config(),
				'messagesDefault'         => $messages_meta->messages(),
				'gateways'                => Gateway_Manager::instance()->editor_data(),
				'helpForRepeaters'        => $this->get_help_for_repeaters(),
				'global_settings'         => Tab_Handler_Manager::instance()->all(),
				'global_settings_url'     => Pages_Manager::instance()->get_stable_url( 'jfb-settings' ),
				'jetEngineVersion'        => Tools::get_jet_engine_version(),
				'actionConditionSettings' => $conditions_settings,
				'argumentsSource'         => Form_Arguments::get_options(),
				'utmLinks'                => array(
					'allProActions'  => $utm->set_campaign( 'pro-actions' )->add_query( $addons ),
					'limitResponses' => $utm->set_campaign( 'responses-pricing' )->add_query( $pricing ),
					'scheduleForm'   => $utm->set_campaign( 'schedule-pricing' )->add_query( $pricing ),
				),
				'isActivePro'             => jet_form_builder()->addons_manager->is_active(),
			)
		);

		do_action( 'jet-form-builder/editor-assets/after', $this, self::EDITOR_HANDLE );
	}

	private function get_help_for_repeaters() {
		return array(
			'conditional_block'     => array(
				'label' => __( 'With many conditions for the block, they are checked with the AND operator', 'jet-form-builder' ),
			),
			'conditional_block_or'  => array(
				'label' => __( 'With many conditions for the block, they are checked with the OR operator', 'jet-form-builder' ),
			),
			'conditional_action'    => array(
				'label' => __( 'With many conditions for the action, they are checked with the AND operator', 'jet-form-builder' ),
			),
			'conditional_action_or' => array(
				'label' => __( 'With many conditions for the action, they are checked with the OR operator', 'jet-form-builder' ),
			),
		);
	}

	public function enqueue_form_assets() {

		$handle = 'jet-form-builder/form';

		do_action( 'jet-form-builder/other-editor-assets/before', $this, $handle );

		wp_register_script(
			$handle,
			Plugin::instance()->plugin_url( 'assets/js/editor/default.builder{min}.js' ),
			array(
				'wp-core-data',
				'wp-data',
				'wp-block-library',
				'wp-format-library',
				'wp-api-fetch',
			),
			JET_FORM_BUILDER_VERSION,
			true
		);

		wp_register_style(
			'jet-form-builder-others',
			Plugin::instance()->plugin_url( 'assets/css/frontend.css' ),
			array(),
			Plugin::instance()->get_version()
		);

		do_action( 'jet-form-builder/other-editor-assets/after', $this, $handle );

	}

}

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
buttons
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
exceptions
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
notices
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
pages
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
single-pages
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
table-views
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
tabs-handlers
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
vui-boxes
--
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0755
admin-page-interface.php
0.734 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
admin-page-trait.php
1.52 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
editor.php
13.052 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
table-advanced-record-prepare-trait.php
1.658 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644
table-record-prepare-trait.php
2.868 KB
29 Jan 2024 10.33 AM
bqrcodec / bqrcodec
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF