初始化6.2.2

Signed-off-by: HITSword <admin@huayizhiyun.com>
This commit is contained in:
HITSword
2020-04-16 16:26:24 +08:00
commit 26e6687c3f
1630 changed files with 144200 additions and 0 deletions
@@ -0,0 +1,151 @@
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link https://www.themepunch.com/
* @copyright 2019 ThemePunch
*/
if(!defined('ABSPATH')) exit();
class RevSliderElementorWidget extends \Elementor\Widget_Shortcode {
public function get_name() {
return 'slider_revolution';
}
public function get_title() {
return 'Slider Revolution 6';
}
public function get_icon() {
return 'eicon-sync';
}
public function get_categories() {
return array('general');
}
protected function _register_controls() {
/*Fallback
$shortcode = $this->get_settings_for_display( 'text' );
if(empty($shortcode)) $shortcode = $this->get_settings_for_display( 'shortcode' );
$revslidertitle = $this->get_settings_for_display( 'sliderTitle' );
if(empty($revslidertitle)) $revslidertitle = $this->get_settings_for_display( 'revslidertitle' );
var_dump($revslidertitle);
*/
$this->start_controls_section(
'content_section',
array(
'label' => 'Slider Revolution 6',
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
)
);
$this->add_control(
'revslidertitle',
array(
'label' => __( 'Selected Module:', 'revslider' ),
'type' => \Elementor\Controls_Manager::TEXT,
'render_type' => 'none',
'placeholder' => '',
'default' => '',
'event' => 'themepunch.selectslider',
)
);
$this->add_control(
'shortcode',
array(
//'type' => \Elementor\Controls_Manager::HIDDEN,
'type' => \Elementor\Controls_Manager::TEXT,
'label' => __( 'Shortcode', 'revslider' ),
'dynamic' => ['active' => true],
'placeholder' => '',
'default' => '',
)
);
// Advanced
$this->add_control(
'select_slider',
array(
'type' => \Elementor\Controls_Manager::BUTTON,
'button_type' => 'default',
'text' => __( '<i type="button" class="material-icons">cached</i> Select Module', 'revslider' ),
'event' => 'themepunch.selectslider',
)
);
$this->add_control(
'edit_slider',
array(
'type' => \Elementor\Controls_Manager::BUTTON,
'button_type' => 'default',
'text' => __( '<i type="button" class="material-icons">edit</i> Edit Module', 'revslider' ),
'event' => 'themepunch.editslider',
)
);
$this->add_control(
'settings_slider',
array(
'type' => \Elementor\Controls_Manager::BUTTON,
'button_type' => 'default',
'text' => __( '<i type="button" class="material-icons">tune</i> Block Settings', 'revslider' ),
'event' => 'themepunch.settingsslider',
)
);
$this->add_control(
'optimize_slider',
array(
'type' => \Elementor\Controls_Manager::BUTTON,
'button_type' => 'default',
'text' => __( '<i type="button" class="material-icons">flash_on</i> Optimize File Sizes', 'revslider' ),
'event' => 'themepunch.optimizeslider',
)
);
$this->end_controls_section();
}
protected function render() {
$shortcode = $this->get_settings_for_display( 'shortcode' );
$shortcode = do_shortcode( shortcode_unautop( $shortcode ) );
$zindex = $this->get_settings_for_display( 'zindex' );
$style = $zindex ? ' style="z-index:'.$zindex.';"' : '';
/*if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
//EDIT
} else {
//FRONTEND
}*/
// hack to make sure object library only opens when the user manually adds a slider to the page
if(empty($shortcode)) {
?>
<script type="text/javascript">window.parent.elementorSelectRevSlider();</script>
<?php
}
?>
<div class="wp-block-themepunch-revslider"<?php echo $style;?>><?php echo $shortcode; ?></div>
<?php
}
}
@@ -0,0 +1,52 @@
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link https://www.themepunch.com/
* @copyright 2019 ThemePunch
*/
if(!defined('ABSPATH')) exit();
class RevSliderElementor {
public static function init() {
$min_elementor_version = '2.0.0';
$min_php_version = '7.0';
// Check if Elementor installed and activated
if(!did_action('elementor/loaded')) return;
// Check for required Elementor version
if(!version_compare(ELEMENTOR_VERSION, $min_elementor_version, '>=' )) return;
// Check for required PHP version
if(version_compare(PHP_VERSION, $min_php_version, '<')) return;
// Add Plugin actions
add_action('elementor/widgets/widgets_registered', array('RevSliderElementor', 'init_elementor_widgets'));
// Register Widget Styles/Scripts
add_action('elementor/editor/after_enqueue_styles', array('RevSliderShortcodeWizard', 'add_styles'));
add_action('elementor/editor/after_enqueue_scripts', array('RevSliderElementor', 'add_scripts'));
}
public static function add_scripts() {
RevSliderShortcodeWizard::add_scripts(true);
}
public static function init_elementor_widgets() {
// Include Widget files
require_once(plugin_dir_path( __FILE__) . 'elementor-widget.class.php');
// Register widget
$widgets_manager = \Elementor\Plugin::instance()->widgets_manager;
$widgets_manager->register_widget_type( new RevSliderElementorWidget() );
}
}