SILENT KILLERPanel

Current Path: > home > transcarter > > > > www > wp-content > plugins > elementskit-lite > modules > controls


Operation   : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Software     : Apache
Server IP    : 198.54.126.42 | Your IP: 216.73.216.8
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/transcarter////www/wp-content/plugins/elementskit-lite/modules/controls

NameTypeSizeLast ModifiedActions
assets Directory - -
ajax-select2-api.php File 5660 bytes July 17 2025 21:06:24.
ajax-select2.php File 2529 bytes July 17 2025 21:06:24.
control-manager.php File 486 bytes July 17 2025 21:06:24.
image-choose.php File 3013 bytes July 17 2025 21:06:24.
init.php File 2817 bytes July 17 2025 21:06:24.
widget-area-modal.php File 2409 bytes July 17 2025 21:06:24.
widget-area-utils.php File 4712 bytes July 17 2025 21:06:24.
widget-area.php File 2338 bytes July 17 2025 21:06:24.

Reading File: /home/transcarter////www/wp-content/plugins/elementskit-lite/modules/controls/widget-area-utils.php

<?php 
namespace ElementsKit_Lite\Modules\Controls;

defined( 'ABSPATH' ) || exit;

class Widget_Area_Utils {

	function init() {
		add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'modal_content' ) );

		add_action( 'wp_ajax_ekit_widgetarea_content', array( $this, 'ekit_widgetarea_content' ) );
		add_action( 'wp_ajax_nopriv_ekit_widgetarea_content', array( $this, 'ekit_widgetarea_content' ) );
	}

	public function ekit_widgetarea_content() {
		
		if ( !isset($_POST['nonce']) || !wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'ekit_pro' ) ) {
			wp_die();
		}

		$post_id = isset($_POST['post_id']) ? intval( $_POST['post_id'] ) : 0;

		if ( 'publish' !== get_post_status( $post_id ) ) {
			wp_die();
		}
		
		if ( isset( $post_id ) ) {
			$elementor = \Elementor\Plugin::instance();
			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --  Displaying with Elementor content rendering
			echo str_replace( '#elementor', '', \ElementsKit_Lite\Utils::render_tab_content( $elementor->frontend->get_builder_content_for_display( $post_id ), $post_id ) );
		} else {
            echo esc_html__( 'Click on the Edit Content button to edit/add the content.', 'elementskit-lite' );
		}
		
		wp_die();
	}

	public function modal_content() { 
		ob_start(); ?>
		<div class="widgetarea_iframe_modal">
			<?php include 'widget-area-modal.php'; ?>
		</div>
		<?php
			$output = ob_get_contents();
			ob_end_clean();
	
			echo \ElementsKit_Lite\Utils::render( $output ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --  Already escaped inside of the buffering content
	}

	/**
	 * $index for old version & data support
	 */
	public static function parse( $content, $widget_key, $tab_id = 1, $isAjax = '', $index = null ) {
		$key         = ( $content == '' ) ? $widget_key : $content;
		$extract_key = explode( '***', $key );
		$extract_key = $extract_key[0];
		ob_start(); 
		?>

		<div class="widgetarea_warper widgetarea_warper_editable" data-elementskit-widgetarea-key="<?php echo esc_attr( $extract_key ); ?>"  data-elementskit-widgetarea-index="<?php echo esc_attr( $tab_id ); ?>">
			<div class="widgetarea_warper_edit" data-elementskit-widgetarea-key="<?php echo esc_attr( $extract_key ); ?>" data-elementskit-widgetarea-index="<?php echo esc_attr( $tab_id ); ?>">
				<i class="eicon-edit" aria-hidden="true"></i>
				<span><?php esc_html_e( 'Edit Content', 'elementskit-lite' ); ?></span>
			</div>

			<?php
				$builder_post_title = 'dynamic-content-widget-' . $extract_key . '-' . $tab_id;
				$builder_post       = \ElementsKit_Lite\Utils::get_page_by_title( $builder_post_title, 'elementskit_content' );
				$elementor          = \Elementor\Plugin::instance();

				/**
				 * this checking for already existing content of tab.
				 */
				$post_id = isset( $builder_post->ID ) ? $builder_post->ID : null;
			if ( ! $post_id ) {
				$builder_post_title = 'dynamic-content-widget-' . $extract_key . '-' . $index;
				$builder_post       = \ElementsKit_Lite\Utils::get_page_by_title( $builder_post_title, 'elementskit_content' );
			}

			if ( $isAjax === 'yes' ) {
				$post_id = isset( $builder_post->ID ) ? $builder_post->ID : '';
				echo '<div class="ekit-widget-area-container" data-ajax-post-id="' . esc_attr($post_id). '"></div>';
			} else {
				?>
					<div class="ekit-widget-area-container">
					<?php
					if ( isset( $builder_post->ID ) ) {
						$builder_post_id = $builder_post->ID;

						// if wpml is active, get the post id from wpml
						if( defined( 'ICL_SITEPRESS_VERSION' ) ) {
							$language_details = apply_filters( 'wpml_post_language_details', NULL, get_the_ID() );
							if( !is_wp_error($language_details) ) {
								$builder_post_id = apply_filters( 'wpml_object_id', $builder_post_id, 'elementskit_content', true, $language_details['language_code'] );
							}
						}
						
						$builder_content = $elementor->frontend->get_builder_content_for_display($builder_post_id);
						$rendered_tab_content = \ElementsKit_Lite\Utils::render_tab_content($builder_content, $builder_post_id);
						// Remove '#elementor' from the rendered content, except when it's part of 'href="#elementor"'
						$final_content = preg_replace('/(?<!href=")#elementor/', '', $rendered_tab_content);

						// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --  Displaying with Elementor content rendering
						echo $final_content;
					} else {
                        echo esc_html__( 'Click on the Edit Content button to edit/add the content.', 'elementskit-lite' );
					}
					?>
					</div>
				<?php
			}
			?>
		</div>
		<?php
		$output = ob_get_contents();
		ob_end_clean();

		return $output;
	}
}

SILENT KILLER Tool