[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.12.71.235: ~ $
<?php
/**
 * Integration file for Elementor widgets-related stuff.
 *
 * @package LearnDash\Elementor
 */

namespace LearnDash\Elementor;

use Elementor\Widgets_Manager;

/**
 * Widgets integration class.
 *
 * @since 1.0.5
 */
class Widgets {
	/**
	 * Typography scheme key.
	 *
	 * Elementor typography scheme key used in the plugin. It accepts number string range from '1' - '4'.
	 *
	 * @see Elementor\Core\Kits\Manager::map_scheme_to_global()
	 *
	 * @since 1.0.7
	 *
	 * @var string
	 */
	public static $typography_scheme_key = '2';

	/**
	 * Register Elementor editor widgets.
	 *
	 * @since 1.0.5
	 *
	 * @param Widgets_Manager $widgets_manager Instance of Widgets_Manager class.
	 */
	public function register( $widgets_manager ) {
		if (
			! function_exists( 'learndash_is_active_theme' )
			|| ! learndash_is_active_theme( 'ld30' )
		) {
			return;
		}

		$template_type = learndash_elementor_get_template_type();

		if (
			! $template_type
			|| in_array( $template_type, learndash_get_post_types( 'course' ), true )
		) {
			if ( learndash_get_post_type_slug( 'quiz' ) !== $template_type ) {
				$widgets_manager->register( new Widgets\Course_Content() );
			} elseif ( learndash_get_post_type_slug( 'quiz' ) === $template_type ) {
				$widgets_manager->register( new Widgets\Quiz() );
			}

			$widgets_manager->register( new Widgets\Course_Infobar() );

			if (
				! $template_type
				|| learndash_get_post_type_slug( 'course' ) === $template_type
			) {
				$widgets_manager->register( new Widgets\Course_Certificate() );
			}
		}

		$widgets_manager->register( new Widgets\Login() );
		$widgets_manager->register( new Widgets\Profile() );
		$widgets_manager->register( new Widgets\Course_List() );
		$widgets_manager->register( new Widgets\Lesson_List() );
		$widgets_manager->register( new Widgets\Topic_List() );
		$widgets_manager->register( new Widgets\Quiz_List() );
	}

	/**
	 * Filter 'elementor/widget/render_content' hook to check for LearnDash
	 * completed step.
	 *
	 * @since 1.0.5
	 *
	 * @param string                 $content Original widget content.
	 * @param \Elementor\Widget_Base $widget  Widget base object.
	 *
	 * @return string Widget content.
	 */
	public function filter_render_content( $content, $widget ): string {
		$post = learndash_elementor_get_learndash_post();

		if ( $post ) {
			$checked_widgets = [
				'ld-course-certificate',
				'ld-course-content',
				'ld-course-infobar',
				'ld-course-list',
				'ld-course-progress',
				'ld-lesson-list',
				'ld-login',
				'ld-payment-buttons',
				'ld-profile',
				'ld-quiz-list',
				'ld-quiz',
				'ld-topic-list',
				'ld-video',
			];

			$allowed_widgets = apply_filters(
				'learndash_elementor_not_completed_step_allowed_widgets',
				array(
					'ld-course-infobar',
					'ld-course-content',
					'ld-course-list',
					'ld-lesson-list',
					'ld-login',
					'ld-payment-buttons',
					'ld-profile',
					'ld-quiz',
					'ld-quiz-list',
					'ld-topic-list',
				),
				$widget,
				$post
			);

			if (
				in_array( $widget->get_name(), $checked_widgets, true )
				&& ! learndash_elementor_is_previous_step_completed()
				&& ! in_array( $widget->get_name(), $allowed_widgets, true )
			) {
				$content = '';
			}
		}

		return $content;
	}
}

Filemanager

Name Type Size Permission Actions
Admin Folder 0755
Documents Folder 0755
Settings Folder 0755
Shortcodes Folder 0755
Utilities Folder 0755
Widgets Folder 0755
App.php File 238 B 0644
Compatibility.php File 521 B 0644
Container.php File 244 B 0644
Dependency_Checker.php File 6.84 KB 0644
Documents.php File 1.2 KB 0644
Editor.php File 525 B 0644
Elements.php File 650 B 0644
Frontend.php File 6.78 KB 0644
Plugin.php File 2.56 KB 0644
Provider.php File 327 B 0644
Step.php File 696 B 0644
Templates.php File 3.63 KB 0644
Utilities.php File 1.32 KB 0644
Widgets.php File 3.19 KB 0644