if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
if( ! Avia_Config_LayerSlider()->is_active() )
{
return;
}
if ( ! class_exists( 'avia_sc_layerslider' ) )
{
class avia_sc_layerslider extends aviaShortcodeTemplate
{
static $slide_count = 0;
/**
* Create the config array for the shortcode button
*/
public function shortcode_insert_button()
{
$this->config['self_closing'] = 'yes';
$this->config['forced_load_objects'] = array('layerslider'); // Lnea corregida
$this->config['name'] = __('Advanced Layerslider', 'avia_framework');
$this->config['tab'] = __('Media Elements', 'avia_framework');
$this->config['icon'] = AviaBuilder::$path['imagesURL'] . "sc-slideshow-layer.png";
$this->config['order'] = 10;
$this->config['target'] = 'avia-target-insert';
$this->config['shortcode']= 'av_layerslider';
$this->config['tooltip'] = __('Display a Layerslider Slideshow', 'avia_framework');
$this->config['tinyMCE'] = array('disable' => "true");
$this->config['drag-level'] = 1;
}
function extra_assets()
{
//load css
wp_enqueue_style( 'avia-module-slideshow-ls' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/slideshow_layerslider/slideshow_layerslider.css' , array('avia-layout'), false );
//load js
wp_enqueue_script( 'avia-module-slideshow-ls' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/slideshow_layerslider/slideshow_layerslider.js' , array('avia-shortcodes'), false, TRUE );
}
/**
* Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
* Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
* Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
*
*
* @param array $params this array holds the default values for $content and $args.
* @return $params the return array usually holds an innerHtml key that holds item specific markup.
*/
public function editor_element($params)
{
//fetch all registered slides and save them to the slides array
$slides = Avia_Config_LayerSlider()->find_layersliders( true );
if(empty($params['args']['id']) && is_array($slides)) $params['args']['id'] = reset($slides);
if(empty($params['args']['id'])) $params['args']['id'] = "";
$element = array(
'subtype' => $slides,
'type'=>'select',
'std' => $params['args']['id'],
'class' => 'avia-recalc-shortcode',
'data' => array('attr'=>'id')
);
$inner = "";
if(empty($slides))
{
$inner.= "
[vc_row full_width=\u00bbstretch_row\u00bb content_placement=\u00bbmiddle\u00bb bg_type=\u00bbimage\u00bb parallax_style=\u00bbvcpb-animated\u00bb bg_image_new=\u00bbid^3831|url^https:\/\/covamsa.com\/inicio\/wp-content\/uploads\/2019\/06\/slider_wall.jpg|caption^null|alt^null|title^slider_wall|description^null\u00bb css=\u00bb.vc_custom_1559609903643{margin-top: -50px !important;}\u00bb][vc_column][vc_row_inner equal_height=\u00bbyes\u00bb content_placement=\u00bbmiddle\u00bb css=\u00bb.vc_custom_1559602377691{padding-top: 30px !important;padding-bottom: 30px !important;}\u00bb][vc_column_inner width=\u00bb1\/2″][vc_single_image image=\u00bb3871″ img_size=\u00bbfull\u00bb][\/vc_column_inner][vc_column_inner width=\u00bb1\/2″ offset=\u00bbvc_hidden-xs\u00bb][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row][vc_row][vc_column][vc_row_inner equal_height=\u00bbyes\u00bb content_placement=\u00bbmiddle\u00bb][vc_column_inner width=\u00bb1\/2″][vc_column_text]<\/p>\n
[\/vc_column_text][vc_column_text el_class=\u00bblead\u00bb]En COVAMSA <\/strong>el servicio que tenemos es de excelencia, contamos con personal especializado para cubrir los requerimientos de tornillos<\/strong> y muelles<\/strong> que se presenten entre nuestros clientes. Te aseguramos que cubriremos tus necesidades de torniller\u00eda<\/strong>, fijaci\u00f3n<\/strong> y herramientas<\/strong>. Tenemos los mejores precios al tener el m\u00e1s grande almac\u00e9n de la regi\u00f3n<\/strong>.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=\u00bb1\/2″ offset=\u00bbvc_hidden-xs\u00bb][vc_single_image image=\u00bb3797″ img_size=\u00bbfull\u00bb alignment=\u00bbcenter\u00bb css=\u00bb.vc_custom_1559929877872{margin-top: -150px !important;}\u00bb][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row][vc_row][vc_column offset=\u00bbvc_hidden-lg vc_hidden-md vc_hidden-sm\u00bb][vc_single_image image=\u00bb3797″ img_size=\u00bbfull\u00bb alignment=\u00bbcenter\u00bb][\/vc_column][\/vc_row][vc_row][vc_column width=\u00bb1\/2″]