GhostManSec
Server: LiteSpeed
System: Linux premium197.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: parhudrw (1725)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/parhudrw/roflma.it/wp-content/plugins/lesya-plugin/elementor/widgets/title-section.php
<?php
	namespace Elementor;

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

	/**
	 * Lesya Title Widget.
	 *
	 * @since 1.0
	 */
	class Lesya_Title_Widget extends Widget_Base {

		public function get_name() {
			return 'lesya-title';
		}

		public function get_title() {
			return esc_html__( 'Title Section', 'lesya-plugin' );
		}

		public function get_icon() {
			return 'eicon-parallax';
		}

		public function get_categories() {
			return [ 'lesya-category' ];
		}

		/**
		 * Register widget controls.
		 *
		 * @since 1.0
		 */
		protected function register_controls() {

			$this->start_controls_section(
				'content_tab',
				[
					'label' => esc_html__( 'Content', 'lesya-plugin' ),
					'tab' => Controls_Manager::TAB_CONTENT,
				]
			);

			$this->add_responsive_control(
				'align',
				[
					'label' => __( 'Alignment', 'lesya-plugin' ),
					'type' => Controls_Manager::CHOOSE,
					'options' => [
						'left' => [
							'title' => __( 'Left', 'lesya-plugin' ),
							'icon' => 'eicon-text-align-left',
						],
						'center' => [
							'title' => __( 'Center', 'lesya-plugin' ),
							'icon' => 'eicon-text-align-center',
						],
						'right' => [
							'title' => __( 'Right', 'lesya-plugin' ),
							'icon' => 'eicon-text-align-right',
						],
					],
					'selectors' => [
						'{{WRAPPER}} .justify-content-center' => 'justify-content: {{VALUE}}!important;',
						'{{WRAPPER}} .text-center' => 'text-align: {{VALUE}}!important;',
						'{{WRAPPER}} .text-center .bg-text' => 'text-align: {{VALUE}}!important;',
					],
					'default'	=> 'center',
				]
			);

			$this->add_control(
				'title',
				[
					'label'       => esc_html__( 'Title', 'lesya-plugin' ),
					'type'        => Controls_Manager::TEXTAREA,
					'placeholder' => esc_html__( 'Enter title', 'lesya-plugin' ),
					'default'     => esc_html__( 'Title', 'lesya-plugin' ),
					'dynamic' => [
						'active' => true,
					],
				]
			);

			$this->add_control(
				'subtitle',
				[
					'label'       => esc_html__( 'Subtitle', 'lesya-plugin' ),
					'type'        => Controls_Manager::TEXTAREA,
					'placeholder' => esc_html__( 'Enter subtitle', 'lesya-plugin' ),
					'default'     => esc_html__( 'Subtitle', 'lesya-plugin' ),
					'dynamic' => [
						'active' => true,
					],
				]
			);

	    $this->add_control(
				'bg_text',
				[
					'label'       => esc_html__( 'Background Title', 'lesya-plugin' ),
	        'label_block' => true,
					'type'        => Controls_Manager::TEXT,
					'placeholder' => esc_html__( 'Enter title', 'lesya-plugin' ),
					'default'     => esc_html__( 'Title', 'lesya-plugin' ),
				]
			);

			$this->end_controls_section();

			$this->start_controls_section(
				'content_styling',
				[
					'label'     => esc_html__( 'Content Styling', 'lesya-plugin' ),
					'tab'       => Controls_Manager::TAB_STYLE,
				]
			);

			$this->add_control(
				'title_color',
				[
					'label'     => esc_html__( 'Title Color', 'lesya-plugin' ),
					'type'      => Controls_Manager::COLOR,
					'default'	=> '',
					'selectors' => [
						'{{WRAPPER}} .section-title h2' => 'color: {{VALUE}};',
					],
				]
			);

			$this->add_group_control(
				Group_Control_Typography::get_type(),
				[
					'name'     => 'title_typography',
					'label'     => esc_html__( 'Title Typography', 'lesya-plugin' ),
					'selector' => '{{WRAPPER}} .section-title h2',
				]
			);

      $this->add_control(
  			'subtitle_color',
  			[
  				'label'     => esc_html__( 'Subtitle Color', 'lesya-plugin' ),
  				'type'      => Controls_Manager::COLOR,
  				'default'	=> '',
  				'selectors' => [
  					'{{WRAPPER}} .section-title .sub-title' => 'color: {{VALUE}};',
  				],
  			]
  		);

  		$this->add_group_control(
  			Group_Control_Typography::get_type(),
  			[
  				'name'     => 'subtitle_typography',
  				'label'     => esc_html__( 'Subtitle Typography', 'lesya-plugin' ),
  				'selector' => '{{WRAPPER}} .section-title .sub-title',
  			]
  		);

	    $this->add_control(
				'bgtext_color',
				[
					'label'     => esc_html__( 'BG Text Color', 'lesya-plugin' ),
					'type'      => Controls_Manager::COLOR,
					'default'	=> '',
					'selectors' => [
						'{{WRAPPER}} .section-title .bg-text' => 'color: {{VALUE}};',
					],
				]
			);

			$this->add_group_control(
				Group_Control_Typography::get_type(),
				[
					'name'     => 'bgtext_typography',
					'label'     => esc_html__( 'BG Text Typography', 'lesya-plugin' ),
					'selector' => '{{WRAPPER}} .section-title .bg-text',
				]
			);

			$this->end_controls_section();
		}


		/**
		 * Render widget output on the frontend.
		 *
		 * @since 1.0
		 */
		protected function render() {
			$settings = $this->get_settings_for_display();

			$this->add_inline_editing_attributes( 'title', 'basic' );
	    $this->add_inline_editing_attributes( 'subtitle', 'basic' );
			$this->add_inline_editing_attributes( 'bg_text', 'none' );

			?>

      <!-- Title Section Start -->
      <section class="text-center">

        <?php if ( $settings['bg_text'] || $settings['title'] ) : ?>
      	<div class="container">
      		<div class="row justify-content-center">
      			<div class="col-xl-12 col-lg-12 col-md-12">
      				<div class="section-title mb-65">
                <?php if ( $settings['bg_text'] ) : ?>
                <span class="bg-text">
                  <span <?php echo $this->get_render_attribute_string( 'bg_text' ); ?>><?php echo wp_kses_post( $settings['bg_text'] ); ?></span>
                </span>
                <?php endif; ?>
                <?php if ( $settings['subtitle'] ) : ?>
                <span class="sub-title">
                  <span <?php echo $this->get_render_attribute_string( 'subtitle' ); ?>>
                    <?php echo wp_kses_post( $settings['subtitle'] ); ?>
                  </span>
                </span>
                <?php endif; ?>
                <?php if ( $settings['title'] ) : ?>
                <h2>
                  <span <?php echo $this->get_render_attribute_string( 'title' ); ?>><?php echo wp_kses_post( $settings['title'] ); ?></span>
                </h2>
                <?php endif; ?>
      				</div>
      			</div>
      		</div>
      	</div>
        <?php endif; ?>

      </section>
      <!-- Title Section End -->

<?php
	}

	/**
	 * Render widget output in the editor.
	 *
	 * Written as a Backbone JavaScript template and used to generate the live preview.
	 *
	 * @since 1.0.0
	 * @access protected
	 */
	/*protected function content_template() { ?>



<?php }*/

}

Plugin::instance()->widgets_manager->register_widget_type( new Lesya_Title_Widget() );