HEX
Server: Apache
System: Linux webm003.cluster111.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: assotraipi (849654)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/assotraipi/www/wp-content/plugins/download-monitor/src/Admin/Settings/Fields/LazySelect.php
<?php

class DLM_Admin_Fields_Field_Lazy_Select extends DLM_Admin_Fields_Field {

	/** @var array */
	private $options;

	/**
	 * DLM_Admin_Fields_Field constructor.
	 *
	 * @param String $name
	 * @param String $value
	 * @param array $options
	 */
	public function __construct( $name, $value, $options ) {
		$this->options = $options;
		parent::__construct( $name, $value, '' );
	}

	/**
	 * @return array
	 */
	public function get_options() {
		return $this->options;
	}

	/**
	 * @param array $options
	 */
	public function set_options( $options ) {
		$this->options = $options;
	}

	/**
	 * Renders field
	 */
	public function render() {
		// Polylang plugin selected page compatibility.
		if ( function_exists( 'pll_current_language' ) && '' != $this->get_value() ) {
			$polylang_lang = pll_current_language();
			$translations  = pll_get_post_translations( absint( $this->get_value() ) );

			// If a translation for selected page exists, set it as the page id.
			if ( isset( $translations[ $polylang_lang ] ) ) {
				$this->set_value( absint( $translations[ $polylang_lang ] ) );
			}
		}

		if ( function_exists( 'icl_object_id' ) && '' != $this->get_value() ) {
			$wpml_lang          = apply_filters( 'wpml_current_language', null );
			$translated_page_id = icl_object_id( absint( $this->get_value() ), 'page', true, $wpml_lang );

			// If a translation for selected page exists, set it as the page id.
			if ( $translated_page_id ) {
				$this->set_value( absint( $translated_page_id ) );
			}
		}
		?>
		<select id="setting-<?php echo esc_attr( $this->get_name() ); ?>" class="regular-text dlm-lazy-select"
				name="<?php echo esc_attr( $this->get_name() ); ?>" data-selected="<?php echo esc_attr( $this->get_value() ); ?>">
			<option value="0"><?php echo esc_html__( 'Loading', 'download-monitor' ); ?>...</option>
		</select>
		<?php
	}
}