File: //var/www/intranet.kauko.lt/wp-content/plugins/woffice-core/elementor-widgets/widgets/welcome.php
<?php
/**
* Woffice - Welcome Widget.
*
* This widget is for Elementor users. Which helps users to build site using elementor
*
* @since 1.0.0
*/
use Elementor\Controls_Manager;
use Elementor\Controls_Stack;
use Elementor\Modules\DynamicTags\Module as TagsModule;
use Elementor\Group_Control_Typography;
use Elementor\Core\Schemes\Typography;
use Elementor\Group_Control_Border;
use Elementor\Scheme_Border;
use Elementor\Utils;
class Woffice_Welcome_Widget extends \Elementor\Widget_Base {
/**
* Get widget name.
*
* Retrieve Woffice Welcome widget name.
*
* @since 1.0.0
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'woffice-welcome';
}
/**
* Get widget title.
*
* Retrieve Woffice Welcome widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return __( 'Welcome', 'woffice' );
}
/**
* Get widget icon.
*
* Retrieve Woffice Welcome widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'wof-icon-welcome';
}
/**
* Get widget categories.
*
* Retrieve the list of categories the Woffice Welcome widget belongs to.
*
* @since 1.0.0
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'woffice' ];
}
/**
* Register Woffice Welcome content widget controls.
*
* Adds different input fields to allow the user to change and customize the content settings for
* the WPJM [jobs] shortcode.
*
* @since 1.0.0
* @access protected
*/
protected function register_controls() {
$this->start_controls_section(
'woffice_welcome_section',
[
'label' => esc_html__( 'Content', 'woffice' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'woffice_welcome_title_tag',
[
'label' => esc_html__( 'Title Tag', 'woffice' ),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'div' => 'div',
'span' => 'span',
'p' => 'p',
],
'default' => 'h3',
]
);
$this->add_control(
'woffice_welcome_title',
[
'label' => esc_html__( 'Title', 'woffice' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__( 'Welcome', 'woffice' ),
'placeholder' => esc_html__( 'Welcome', 'woffice' ),
]
);
$this->add_control(
'woffice_welcome_content',
[
'label' => esc_html__( 'Description', 'woffice' ),
'type' => \Elementor\Controls_Manager::WYSIWYG,
'default' => esc_html__( 'Good morning, this is the dashboard a complete widgetized page where you can pick in all widgets you want.', 'woffice' ),
'placeholder' => esc_html__( 'Good morning, this is the dashboard a complete widgetized page where you can pick in all widgets you want.', 'woffice' ),
]
);
$this->end_controls_section();
}
/**
* Render [Job] output from WP Job Manager on the frontend.
*
* Written in PHP and used to generate the final HTML.
*
* @since 1.0.0
* @access protected
*/
protected function render() {
$settings = $this->get_settings_for_display();
$title = $settings['woffice_welcome_title'];
?>
<div class="widget_woffice_welcome">
<div class="box">
<div class="intern-padding">
<div class="intern-box box-title">
<?php
echo sprintf( '<%1$s %2$s>%3$s</%1$s>', Utils::validate_html_tag( $settings['woffice_welcome_title_tag'] ), $this->get_render_attribute_string( 'title' ), $title );
?>
</div>
<div class="textwidget">
<?php echo $settings['woffice_welcome_content']; ?>
</div>
</div>
</div>
</div>
<?php
}
protected function content_template() {
?>
<div class="widget_woffice_welcome">
<div class="box">
<div class="intern-padding">
<div class="intern-box box-title">
<{{{ settings.woffice_welcome_title_tag }}}>{{{ settings.woffice_welcome_title }}}</{{{ settings.woffice_welcome_title_tag }}}>
</div>
<div class="textwidget">
{{{ settings.woffice_welcome_content }}}
</div>
</div>
</div>
</div>
<?php
}
}