Advertisement
Guenni007

testimonials

Jan 16th, 2023 (edited)
882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 39.39 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Testimonials
  4.  * Edited to have Dotnavigation - changed lines : 1072, 1082ff
  5.  * Creates a Testimonial Grid
  6.  */
  7. if( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
  8.  
  9.  
  10. if( ! class_exists( 'avia_sc_testimonial' ) )
  11. {
  12.     class avia_sc_testimonial extends aviaShortcodeTemplate
  13.     {
  14.         use \aviaBuilder\traits\scSlideshowUIControls;
  15.  
  16.         /**
  17.          * @since < 4.0
  18.          * @var int
  19.          */
  20.         static protected $rows = 0;
  21.  
  22.         /**
  23.          * @since < 4.0
  24.          * @var int
  25.          */
  26.         static protected $counter = 0;
  27.  
  28.         /**
  29.          * Used to store last counter value after adding element styles
  30.          *
  31.          * @since 4.8.4
  32.          * @var int
  33.          */
  34.         static protected $counter_prev = 0;
  35.  
  36.         /**
  37.          * flag if we need to close container
  38.          *
  39.          * @since 4.8.8
  40.          * @var boolean
  41.          */
  42.         static protected $section_printed = false;
  43.  
  44.         /**
  45.          * @since < 4.0
  46.          * @var int
  47.          */
  48.         static protected $columns = 0;
  49.  
  50.         /**
  51.          * @since < 4.0
  52.          * @var string
  53.          */
  54.         static protected $style = '';
  55.  
  56.         /**
  57.          * @since < 4.0
  58.          * @var string
  59.          */
  60.         static protected $grid_style = '';
  61.  
  62.         /**
  63.          *
  64.          * @since 4.8.8
  65.          * @var array
  66.          */
  67.         protected $in_sc_exec;
  68.  
  69.         /**
  70.          *
  71.          * @since 4.5.5
  72.          * @param AviaBuilder $builder
  73.          */
  74.         public function __construct( $builder )
  75.         {
  76.             $this->in_sc_exec = false;
  77.  
  78.             parent::__construct( $builder );
  79.         }
  80.  
  81.         /**
  82.          * @since 4.5.5
  83.          */
  84.         public function __destruct()
  85.         {
  86.             parent::__destruct();
  87.         }
  88.  
  89.         /**
  90.          * Create the config array for the shortcode button
  91.          */
  92.         protected function shortcode_insert_button()
  93.         {
  94.             $this->config['version']        = '1.0';
  95.             $this->config['self_closing']   = 'no';
  96.             $this->config['base_element']   = 'yes';
  97.  
  98.             $this->config['name']           = __( 'Testimonials', 'avia_framework' );
  99.             $this->config['tab']            = __( 'Content Elements', 'avia_framework' );
  100.             $this->config['icon']           = AviaBuilder::$path['imagesURL'] . 'sc-testimonials.png';
  101.             $this->config['order']          = 20;
  102.             $this->config['target']         = 'avia-target-insert';
  103.             $this->config['shortcode']      = 'av_testimonials';
  104.             $this->config['shortcode_nested'] = array( 'av_testimonial_single' );
  105.             $this->config['tooltip']        = __( 'Creates a Testimonial Grid', 'avia_framework' );
  106.             $this->config['preview']        = 'xlarge';
  107.             $this->config['disabling_allowed'] = true;
  108.             $this->config['id_name']        = 'id';
  109.             $this->config['id_show']        = 'yes';
  110.             $this->config['alb_desc_id']    = 'alb_description';
  111.             $this->config['name_item']      = __( 'Testimonial Item', 'avia_framework' );
  112.             $this->config['tooltip_item']   = __( 'A Testimonial Element Item', 'avia_framework' );
  113.         }
  114.  
  115.         protected function extra_assets()
  116.         {
  117.             $ver = Avia_Builder()->get_theme_version();
  118.             $min_js = avia_minify_extension( 'js' );
  119.             $min_css = avia_minify_extension( 'css' );
  120.  
  121.             //load css
  122.             wp_enqueue_style( 'avia-module-slideshow', AviaBuilder::$path['pluginUrlRoot'] . "avia-shortcodes/slideshow/slideshow{$min_css}.css", array( 'avia-layout' ), $ver );
  123.             wp_enqueue_style( 'avia-module-testimonials', AviaBuilder::$path['pluginUrlRoot'] . "avia-shortcodes/testimonials/testimonials{$min_css}.css", array( 'avia-layout' ), $ver );
  124.  
  125.             //load js
  126.             wp_enqueue_script( 'avia-module-slideshow', AviaBuilder::$path['pluginUrlRoot'] . "avia-shortcodes/slideshow/slideshow{$min_js}.js", array( 'avia-shortcodes' ), $ver, true );
  127.             wp_enqueue_script( 'avia-module-testimonials', AviaBuilder::$path['pluginUrlRoot'] . "avia-shortcodes/testimonials/testimonials{$min_js}.js", array( 'avia-shortcodes' ), $ver, true );
  128.         }
  129.  
  130.         /**
  131.          * Popup Elements
  132.          *
  133.          * If this function is defined in a child class the element automatically gets an edit button, that, when pressed
  134.          * opens a modal window that allows to edit the element properties
  135.          *
  136.          * @return void
  137.          */
  138.         protected function popup_elements()
  139.         {
  140.             $this->elements = array(
  141.  
  142.                 array(
  143.                         'type'  => 'tab_container',
  144.                         'nodescription' => true
  145.                     ),
  146.  
  147.                 array(
  148.                         'type'  => 'tab',
  149.                         'name'  => __( 'Content', 'avia_framework' ),
  150.                         'nodescription' => true
  151.                     ),
  152.  
  153.                     array(
  154.                             'type'          => 'template',
  155.                             'template_id'   => $this->popup_key( 'content_testemonial' )
  156.                         ),
  157.  
  158.                 array(
  159.                         'type'  => 'tab_close',
  160.                         'nodescription' => true
  161.                     ),
  162.  
  163.                 array(
  164.                         'type'  => 'tab',
  165.                         'name'  => __( 'Styling', 'avia_framework' ),
  166.                         'nodescription' => true
  167.                     ),
  168.  
  169.                     array(
  170.                             'type'          => 'template',
  171.                             'template_id'   => 'toggle_container',
  172.                             'templates_include' => array(
  173.                                                     $this->popup_key( 'styling_general' ),
  174.                                                     $this->popup_key( 'styling_controls' ),
  175.                                                     $this->popup_key( 'styling_nav_colors' ),
  176.                                                     $this->popup_key( 'styling_fonts' ),
  177.                                                     $this->popup_key( 'styling_colors' )
  178.                                                 ),
  179.                             'nodescription' => true
  180.                         ),
  181.  
  182.                 array(
  183.                         'type'  => 'tab_close',
  184.                         'nodescription' => true
  185.                     ),
  186.  
  187.                 array(
  188.                         'type'  => 'tab',
  189.                         'name'  => __( 'Advanced', 'avia_framework' ),
  190.                         'nodescription' => true
  191.                     ),
  192.  
  193.                     array(
  194.                             'type'  => 'toggle_container',
  195.                             'nodescription' => true
  196.                         ),
  197.  
  198.                         array(
  199.                                 'type'          => 'template',
  200.                                 'template_id'   => $this->popup_key( 'advanced_animation_slider' )
  201.                             ),
  202.  
  203.                         array(
  204.                                 'type'          => 'template',
  205.                                 'template_id'   => 'screen_options_toggle',
  206.                                 'lockable'      => true
  207.                             ),
  208.  
  209.                         array(
  210.                                 'type'          => 'template',
  211.                                 'template_id'   => 'developer_options_toggle',
  212.                                 'args'          => array( 'sc' => $this )
  213.                             ),
  214.  
  215.                     array(
  216.                             'type'  => 'toggle_container_close',
  217.                             'nodescription' => true
  218.                         ),
  219.  
  220.                 array(
  221.                         'type'  => 'tab_close',
  222.                         'nodescription' => true
  223.                     ),
  224.  
  225.                 array(
  226.                         'type'          => 'template',
  227.                         'template_id'   => 'element_template_selection_tab',
  228.                         'args'          => array( 'sc' => $this )
  229.                     ),
  230.  
  231.                 array(
  232.                         'type'  => 'tab_container_close',
  233.                         'nodescription' => true
  234.                     )
  235.  
  236.             );
  237.  
  238.         }
  239.  
  240.         /**
  241.          * Create and register templates for easier maintainance
  242.          *
  243.          * @since 4.6.4
  244.          */
  245.         protected function register_dynamic_templates()
  246.         {
  247.  
  248.             $this->register_modal_group_templates();
  249.  
  250.             /**
  251.              * Content Tab
  252.              * ===========
  253.              */
  254.  
  255.             $c = array(
  256.                         array(
  257.                             'name'          => __( 'Add/Edit Testimonial', 'avia_framework' ),
  258.                             'desc'          => __( 'Here you can add, remove and edit your Testimonials.', 'avia_framework' ),
  259.                             'type'          => 'modal_group',
  260.                             'id'            => 'content',
  261.                             'modal_title'   => __( 'Edit Testimonial', 'avia_framework' ),
  262.                             'editable_item' => true,
  263.                             'lockable'      => true,
  264.                             'tmpl_set_default'  => false,
  265.                             'std'           => array(
  266.                                                     array(
  267.                                                         'name'      => __( 'Name', 'avia_framework' ),
  268.                                                         'Subtitle'  => '',
  269.                                                         'check'     => 'is_empty'
  270.                                                     ),
  271.                                                 ),
  272.                             'subelements'   => $this->create_modal()
  273.                         )
  274.  
  275.                 );
  276.  
  277.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'content_testemonial' ), $c );
  278.  
  279.             /**
  280.              * Styling Tab
  281.              * ===========
  282.              */
  283.  
  284.             $c = array(
  285.                         array(
  286.                             'name'      => __( 'Testimonial Style', 'avia_framework' ),
  287.                             'desc'      => __( 'Here you can select how to display the testimonials. You can either create a testimonial slider or a testimonial grid with multiple columns', 'avia_framework' ),
  288.                             'id'        => 'style',
  289.                             'type'      => 'select',
  290.                             'std'       => 'grid',
  291.                             'lockable'  => true,
  292.                             'subtype'   => array(
  293.                                                 __( 'Testimonial Grid', 'avia_framework' )              => 'grid',
  294.                                                 __( 'Testimonial Slider (Compact)', 'avia_framework' )  => 'slider',
  295.                                                 __( 'Testimonial Slider (Large)', 'avia_framework' )    => 'slider_large',
  296.                             )
  297.                         ),
  298.  
  299.                         array(
  300.                             'name'      => __( 'Testimonial Grid Columns', 'avia_framework' ),
  301.                             'desc'      => __( 'How many columns do you want to display', 'avia_framework' ),
  302.                             'id'        => 'columns',
  303.                             'type'      => 'select',
  304.                             'std'       => '2',
  305.                             'lockable'  => true,
  306.                             'required'  => array( 'style', 'equals', 'grid' ),
  307.                             'subtype'   => AviaHtmlHelper::number_array( 1, 4, 1 )
  308.                         ),
  309.  
  310.                         array(
  311.                             'name'      => __( 'Testimonial Grid Style', 'avia_framework' ),
  312.                             'desc'      => __( 'Set the styling for the testimonial grid', 'avia_framework' ),
  313.                             'id'        => 'grid_style',
  314.                             'type'      => 'select',
  315.                             'std'       => '',
  316.                             'lockable'  => true,
  317.                             'required'  => array( 'style', 'equals', 'grid' ),
  318.                             'subtype'   => array(
  319.                                                 __( 'Default Grid', 'avia_framework' )  => '',
  320.                                                 __( 'Minimal Grid', 'avia_framework' )  => 'av-minimal-grid-style',
  321.                                                 __( 'Boxed Grid', 'avia_framework' )    => 'av-minimal-grid-style av-boxed-grid-style',
  322.                                             )
  323.                         )
  324.  
  325.                 );
  326.  
  327.             $template = array(
  328.                             array(
  329.                                 'type'          => 'template',
  330.                                 'template_id'   => 'toggle',
  331.                                 'title'         => __( 'Slider Or Grid', 'avia_framework' ),
  332.                                 'content'       => $c
  333.                             ),
  334.                     );
  335.  
  336.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_general' ), $template );
  337.  
  338.             $c = array(
  339.  
  340.                         array(
  341.                             'type'          => 'template',
  342.                             'template_id'   => 'slideshow_controls',
  343.                             'include'       => array( 'arrows' ),
  344.                             'lockable'      => true,
  345.                             'required'      => array( 'style', 'contains', 'slider' )
  346.                         )
  347.  
  348.                 );
  349.  
  350.             $template = array(
  351.                             array(
  352.                                 'type'          => 'template',
  353.                                 'template_id'   => 'toggle',
  354.                                 'title'         => __( 'Navigation Controls', 'avia_framework' ),
  355.                                 'content'       => $c
  356.                             ),
  357.                     );
  358.  
  359.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_controls' ), $template );
  360.  
  361.             $c = array(
  362.  
  363.                         array(
  364.                             'type'          => 'template',
  365.                             'template_id'   => 'slideshow_navigation_colors',
  366.                             'include'       => array( 'arrows' ),
  367.                             'lockable'      => true,
  368.                             'required'      => array( 'control_layout', 'parent_in_array', ',av-control-default' ),
  369.                         )
  370.  
  371.                 );
  372.  
  373.             $template = array(
  374.                             array(
  375.                                 'type'          => 'template',
  376.                                 'template_id'   => 'toggle',
  377.                                 'title'         => __( 'Navigation Control Colors', 'avia_framework' ),
  378.                                 'content'       => $c
  379.                             )
  380.                     );
  381.  
  382.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_nav_colors' ), $template );
  383.  
  384.  
  385.             $c = array(
  386.                         array(
  387.                             'name'          => __( 'Testimonial Name Font Sizes', 'avia_framework' ),
  388.                             'desc'          => __( 'Select a custom font size for the testimonial name.', 'avia_framework' ),
  389.                             'type'          => 'template',
  390.                             'template_id'   => 'font_sizes_icon_switcher',
  391.                             'lockable'      => true,
  392.                             'textfield'     => true,
  393.                             'subtype'       => array(
  394.                                                 'default'   => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '' ), 'px' ),
  395.                                                 'desktop'   => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '' ), 'px' ),
  396.                                                 'medium'    => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' ),
  397.                                                 'small'     => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' ),
  398.                                                 'mini'      => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' )
  399.                                             ),
  400.                             'id_sizes'      => array(
  401.                                                 'default'   => 'size-name',
  402.                                                 'desktop'   => 'av-desktop-font-size-name',
  403.                                                 'medium'    => 'av-medium-font-size-name',
  404.                                                 'small'     => 'av-small-font-size-name',
  405.                                                 'mini'      => 'av-mini-font-size-name'
  406.                                             )
  407.                         ),
  408.  
  409.                         array(
  410.                             'name'          => __( 'Testimonial Subtitle Font Sizes', 'avia_framework' ),
  411.                             'desc'          => __( 'Select a custom font size for the testimonial subtitle.', 'avia_framework' ),
  412.                             'type'          => 'template',
  413.                             'template_id'   => 'font_sizes_icon_switcher',
  414.                             'lockable'      => true,
  415.                             'textfield'     => true,
  416.                             'subtype'       => array(
  417.                                                 'default'   => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '' ), 'px' ),
  418.                                                 'desktop'   => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '' ), 'px' ),
  419.                                                 'medium'    => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' ),
  420.                                                 'small'     => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' ),
  421.                                                 'mini'      => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' )
  422.                                             ),
  423.                             'id_sizes'      => array(
  424.                                                 'default'   => 'size-subtitle',
  425.                                                 'desktop'   => 'av-desktop-font-size-subtitle',
  426.                                                 'medium'    => 'av-medium-font-size-subtitle',
  427.                                                 'small'     => 'av-small-font-size-subtitle',
  428.                                                 'mini'      => 'av-mini-font-size-subtitle'
  429.                                             )
  430.                         ),
  431.  
  432.                         array(
  433.                             'name'          => __( 'Testimonial Content Font Sizes', 'avia_framework' ),
  434.                             'desc'          => __( 'Select a custom font size for the testimonial content.', 'avia_framework' ),
  435.                             'type'          => 'template',
  436.                             'template_id'   => 'font_sizes_icon_switcher',
  437.                             'lockable'      => true,
  438.                             'textfield'     => true,
  439.                             'subtype'       => array(
  440.                                                 'default'   => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '' ), 'px' ),
  441.                                                 'desktop'   => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '' ), 'px' ),
  442.                                                 'medium'    => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' ),
  443.                                                 'small'     => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' ),
  444.                                                 'mini'      => AviaHtmlHelper::number_array( 10, 50, 1, array( __( 'Use Default', 'avia_framework' ) => '', __( 'Hidden', 'avia_framework' ) => 'hidden' ), 'px' )
  445.                                             ),
  446.                             'id_sizes'      => array(
  447.                                                 'default'   => 'size-content',
  448.                                                 'desktop'   => 'av-desktop-font-size-content',
  449.                                                 'medium'    => 'av-medium-font-size-content',
  450.                                                 'small'     => 'av-small-font-size-content',
  451.                                                 'mini'      => 'av-mini-font-size-content'
  452.                                             )
  453.                         )
  454.  
  455.                 );
  456.  
  457.             $template = array(
  458.                             array(
  459.                                 'type'          => 'template',
  460.                                 'template_id'   => 'toggle',
  461.                                 'title'         => __( 'Font Sizes', 'avia_framework' ),
  462.                                 'content'       => $c
  463.                             ),
  464.                     );
  465.  
  466.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_fonts' ), $template );
  467.  
  468.             $c = array(
  469.                         array(
  470.                             'name'      => __( 'Font Colors', 'avia_framework' ),
  471.                             'desc'      => __( 'Either use the themes default colors or apply some custom ones', 'avia_framework' ),
  472.                             'id'        => 'font_color',
  473.                             'type'      => 'select',
  474.                             'std'       => '',
  475.                             'lockable'  => true,
  476.                             'subtype'   => array(
  477.                                                 __( 'Default', 'avia_framework' )               => '',
  478.                                                 __( 'Define Custom Colors', 'avia_framework' )  => 'custom'
  479.                                             ),
  480.                         ),
  481.  
  482.                         array(
  483.                             'name'      => __( 'Name Font Color', 'avia_framework' ),
  484.                             'desc'      => __( 'Select a custom font color. Leave empty to use the default', 'avia_framework' ),
  485.                             'id'        => 'custom_title',
  486.                             'type'      => 'colorpicker',
  487.                             'std'       => '',
  488.                             'rgba'      => true,
  489.                             'container_class' => 'av_half av_half_first',
  490.                             'lockable'  => true,
  491.                             'required'  => array( 'font_color', 'equals', 'custom' )
  492.                         ),
  493.  
  494.                         array(
  495.                             'name'      => __( 'Subtitle Font Color', 'avia_framework' ),
  496.                             'desc'      => __( 'Select a custom font color. Leave empty to use &quot;Name Font Color&quot;', 'avia_framework' ),
  497.                             'id'        => 'custom_sub',
  498.                             'type'      => 'colorpicker',
  499.                             'std'       => '',
  500.                             'rgba'      => true,
  501.                             'container_class' => 'av_half',
  502.                             'lockable'  => true,
  503.                             'required'  => array( 'font_color', 'equals', 'custom' )
  504.                         ),
  505.  
  506.                         array(
  507.                             'name'      => __( 'Content Font Color', 'avia_framework' ),
  508.                             'desc'      => __( 'Select a custom font color. Leave empty to use the default', 'avia_framework' ),
  509.                             'id'        => 'custom_content',
  510.                             'type'      => 'colorpicker',
  511.                             'std'       => '',
  512.                             'rgba'      => true,
  513.                             'container_class' => 'av_half av_half_first',
  514.                             'lockable'  => true,
  515.                             'required'  => array( 'font_color', 'equals', 'custom' )
  516.                         )
  517.                 );
  518.  
  519.             $template = array(
  520.                             array(
  521.                                 'type'          => 'template',
  522.                                 'template_id'   => 'toggle',
  523.                                 'title'         => __( 'Colors', 'avia_framework' ),
  524.                                 'content'       => $c
  525.                             ),
  526.                     );
  527.  
  528.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_colors' ), $template );
  529.  
  530.             /**
  531.              * Advanced Tab
  532.              * ===========
  533.              */
  534.  
  535.             $c = array(
  536.  
  537.                         array(
  538.                             'type'          => 'template',
  539.                             'template_id'   => 'slideshow_transition',
  540.                             'desc'          => __( 'Select the transition for your testimonials', 'avia_framework' ),
  541.                             'required'      => array( 'style', 'contains', 'slider' ),
  542.                             'select_trans'  => array( 'fade', 'slide' ),
  543.                             'std_trans'     => 'fade',
  544.                             'lockable'      => true
  545.                         ),
  546.  
  547.                         array(
  548.                             'type'              => 'template',
  549.                             'template_id'       => 'slideshow_rotation',
  550.                             'desc'              => __( 'Select if the testimonials slider should rotate by default', 'avia_framework' ),
  551.                             'std'               => 'true',
  552.                             'required'          => array( 'style', 'contains', 'slider' ),
  553.                             'required_manual'   => array( 'style', 'contains', 'slider' ),
  554.                             'stop_id'           => 'autoplay_stopper',
  555.                             'lockable'          => true
  556.                         )
  557.                 );
  558.  
  559.             $template = array(
  560.                             array(
  561.                                 'type'          => 'template',
  562.                                 'template_id'   => 'toggle',
  563.                                 'title'         => __( 'Slider Animation', 'avia_framework' ),
  564.                                 'content'       => $c
  565.                             ),
  566.                     );
  567.  
  568.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'advanced_animation_slider' ), $template );
  569.  
  570.         }
  571.  
  572.         /**
  573.          * Creates the modal popup for a single entry
  574.          *
  575.          * @since 4.6.4
  576.          * @return array
  577.          */
  578.         protected function create_modal()
  579.         {
  580.             $elements = array(
  581.  
  582.                 array(
  583.                         'type'  => 'tab_container',
  584.                         'nodescription' => true
  585.                     ),
  586.  
  587.                 array(
  588.                         'type'  => 'tab',
  589.                         'name'  => __( 'Content', 'avia_framework' ),
  590.                         'nodescription' => true
  591.                     ),
  592.  
  593.                     array(
  594.                             'type'          => 'template',
  595.                             'template_id'   => $this->popup_key( 'modal_content_tstemonial' )
  596.                         ),
  597.  
  598.                 array(
  599.                         'type'  => 'tab_close',
  600.                         'nodescription' => true
  601.                     ),
  602.  
  603.                 array(
  604.                         'type'  => 'tab',
  605.                         'name'  => __( 'Advanced', 'avia_framework' ),
  606.                         'nodescription' => true
  607.                     ),
  608.  
  609.                     array(
  610.                             'type'          => 'template',
  611.                             'template_id'   => $this->popup_key( 'modal_advanced_link' )
  612.                         ),
  613.  
  614.                 array(
  615.                         'type'  => 'tab_close',
  616.                         'nodescription' => true
  617.                     ),
  618.  
  619.                 array(
  620.                         'type'          => 'template',
  621.                         'template_id'   => 'element_template_selection_tab',
  622.                         'args'          => array(
  623.                                                 'sc'            => $this,
  624.                                                 'modal_group'   => true
  625.                                             )
  626.                     ),
  627.  
  628.                 array(
  629.                         'type'  => 'tab_container_close',
  630.                         'nodescription' => true
  631.                     )
  632.  
  633.                 );
  634.  
  635.             return $elements;
  636.         }
  637.  
  638.         /**
  639.          * Register all templates for the modal group popup
  640.          *
  641.          * @since 4.6.4
  642.          */
  643.         protected function register_modal_group_templates()
  644.         {
  645.             /**
  646.              * Content Tab
  647.              * ===========
  648.              */
  649.             $c = array(
  650.                         array(
  651.                             'name'      => __( 'Image', 'avia_framework' ),
  652.                             'desc'      => __( 'Either upload a new, or choose an existing image from your media library', 'avia_framework' ),
  653.                             'id'        => 'src',
  654.                             'type'      => 'image',
  655.                             'fetch'     => 'id',
  656.                             'title'     => __( 'Insert Image', 'avia_framework' ),
  657.                             'button'    => __( 'Insert', 'avia_framework' ),
  658.                             'std'       => '',
  659.                             'lockable'  => true
  660.                         ),
  661.  
  662.                         array(
  663.                             'name'      => __( 'Name', 'avia_framework' ),
  664.                             'desc'      => __( 'Enter the Name of the Person to quote', 'avia_framework' ),
  665.                             'id'        => 'name',
  666.                             'type'      => 'input',
  667.                             'std'       => '',
  668.                             'lockable'  => true
  669.                         ),
  670.  
  671.                         array(
  672.                             'name'      => __( 'Subtitle below name', 'avia_framework' ),
  673.                             'desc'      => __( 'Can be used for a job description', 'avia_framework' ),
  674.                             'id'        => 'subtitle',
  675.                             'type'      => 'input',
  676.                             'std'       => '',
  677.                             'lockable'  => true
  678.                         ),
  679.  
  680.                         array(
  681.                             'name'      => __( 'Quote', 'avia_framework' ),
  682.                             'desc'      => __( 'Enter the testimonial here', 'avia_framework' ),
  683.                             'id'        => 'content',
  684.                             'type'      => 'tiny_mce',
  685.                             'std'       => '',
  686.                             'lockable'  => true
  687.                         ),
  688.  
  689.                 );
  690.  
  691.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'modal_content_tstemonial' ), $c );
  692.  
  693.             $c = array(
  694.                         array(
  695.                             'name'      => __( 'Website Link', 'avia_framework' ),
  696.                             'desc'      => __( 'Link to the Persons website', 'avia_framework' ),
  697.                             'id'        => 'link',
  698.                             'type'      => 'input',
  699.                             'std'       => 'http://',
  700.                             'lockable'  => true
  701.                         ),
  702.  
  703.                         array(
  704.                             'name'      => __( 'Website Name', 'avia_framework' ),
  705.                             'desc'      => __( 'Linktext for the above Link', 'avia_framework' ),
  706.                             'id'        => 'linktext',
  707.                             'type'      => 'input',
  708.                             'std'       => '',
  709.                             'lockable'  => true
  710.                         )
  711.                 );
  712.  
  713.             AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'modal_advanced_link' ), $c );
  714.  
  715.         }
  716.  
  717.         /**
  718.          * Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window
  719.          * Works in the same way as Editor Element
  720.          *
  721.          * @param array $params         holds the default values for $content and $args.
  722.          * @return array                usually holds an innerHtml key that holds item specific markup.
  723.          */
  724.         public function editor_sub_element( $params )
  725.         {
  726.             $default = array();
  727.             $locked = array();
  728.             $attr = $params['args'];
  729.             Avia_Element_Templates()->set_locked_attributes( $attr, $this, $this->config['shortcode_nested'][0], $default, $locked );
  730.  
  731.             $template = $this->update_template_lockable( 'name', __( 'Testimonial by', 'avia_framework' ) . ': {{name}}', $locked );
  732.  
  733.             $params['innerHtml']  = '';
  734.             $params['innerHtml'] .= "<div class='avia_title_container' {$template} data-update_element_template='yes'>" . __( 'Testimonial by', 'avia_framework' ) . ": {$attr['name']}</div>";
  735.  
  736.             return $params;
  737.         }
  738.  
  739.         /**
  740.          * Create custom stylings
  741.          *
  742.          * @since 4.8.4
  743.          * @param array $args
  744.          * @return array
  745.          */
  746.         protected function get_element_styles( array $args )
  747.         {
  748.             $result = parent::get_element_styles( $args );
  749.  
  750.             extract( $result );
  751.  
  752.             $default = array(
  753.                         'style'                     => 'grid',
  754.                         'columns'                   => '2',
  755.                         'grid_style'                => '',
  756.                         'navigation'                => 'arrows',
  757.                         'control_layout'            => 'av-control-default',
  758.                         'nav_visibility_desktop'    => '',
  759.                         'animation'                 => 'fade',
  760.                         'autoplay'                  => 'true',
  761.                         'interval'                  => 5,
  762.                         'autoplay_stopper'          => '',
  763.                         'manual_stopper'            => '',
  764.                         'hoverpause'                => true,        //  hardcoded for slider
  765.                         'font_color'                => '',
  766.                         'custom_title'              => '',
  767.                         'custom_sub'                => '',
  768.                         'custom_content'            => ''
  769.                     );
  770.  
  771.             $default = $this->sync_sc_defaults_array( $default, 'no_modal_item', 'no_content' );
  772.  
  773.  
  774.             $locked = array();
  775.             Avia_Element_Templates()->set_locked_attributes( $atts, $this, $shortcodename, $default, $locked, $content );
  776.             Avia_Element_Templates()->add_template_class( $meta, $atts, $default );
  777.  
  778.  
  779.             $this->in_sc_exec = true;
  780.  
  781.             $atts = shortcode_atts( $default, $atts, $this->config['shortcode'] );
  782.  
  783.  
  784.             avia_sc_testimonial::$counter = 1;
  785.             avia_sc_testimonial::$counter_prev = 1;
  786.             avia_sc_testimonial::$section_printed = false;
  787.             avia_sc_testimonial::$rows = 1;
  788.             avia_sc_testimonial::$columns = $atts['columns'];
  789.             avia_sc_testimonial::$style = $atts['style'];
  790.             avia_sc_testimonial::$grid_style = $atts['grid_style'];
  791.  
  792.             //if we got a slider we only need a single row wrapper
  793.             if( $atts['style'] != 'grid' )
  794.             {
  795.                 avia_sc_testimonial::$columns = 100000;
  796.             }
  797.  
  798.  
  799.             $cls_style = $atts['style'] == 'slider_large' ? 'slider' : $atts['style'];
  800.  
  801.             /**
  802.              * @since 5.3
  803.              * @param string $class_animation
  804.              * @param array $atts
  805.              * @param aviaShortcodeTemplate $this
  806.              * @param string $shortcodename
  807.              * @return string
  808.              */
  809.             $class_animation = apply_filters( 'avf_alb_element_animation', 'avia_animate_when_almost_visible', $atts, $this, $shortcodename );
  810.  
  811.  
  812.             $classes = array(
  813.                         'avia-testimonial-wrapper',
  814.                         $element_id,
  815.                         "avia-{$cls_style}-testimonials",
  816.                         "avia-{$cls_style}-{$atts['columns']}-testimonials",
  817.                         $class_animation
  818.                     );
  819.  
  820.             $element_styling->add_classes( 'container', $classes );
  821.             $element_styling->add_classes_from_array( 'container', $meta, 'custom_class' );
  822.             $element_styling->add_responsive_classes( 'container', 'hide_element', $atts );
  823.  
  824.  
  825.             if( $atts['style'] == 'grid' )
  826.             {
  827.                 $element_styling->add_classes( 'container', $atts['grid_style'] );
  828.             }
  829.             else if( $atts['style'] == 'slider_large' )
  830.             {
  831.                 $element_styling->add_classes( 'container', 'av-large-testimonial-slider' );
  832.             }
  833.  
  834.             if( false !== strpos( $atts['style'], 'slider' ) )
  835.             {
  836.                 $ui_args = array(
  837.                             'element_id'        => $element_id,
  838.                             'element_styling'   => $element_styling,
  839.                             'atts'              => $atts,
  840.                             'autoplay_option'   => 'true',
  841.                             'context'           => __CLASS__,
  842.                         );
  843.  
  844.                 $this->addSlideshowAttributes( $ui_args );
  845.             }
  846.  
  847.             $element_styling->add_responsive_font_sizes( 'item-name', 'size-name', $atts, $this );
  848.             $element_styling->add_responsive_font_sizes( 'item-subtitle', 'size-subtitle', $atts, $this );
  849.             $element_styling->add_responsive_font_sizes( 'item-sub-sep', 'size-subtitle', $atts, $this );
  850.             $element_styling->add_responsive_font_sizes( 'item-link', 'size-subtitle', $atts, $this );
  851.             $element_styling->add_responsive_font_sizes( 'item-content', 'size-content', $atts, $this );
  852.  
  853.  
  854.  
  855.             if( $atts['font_color'] == 'custom' )
  856.             {
  857.                 if( ! empty( $atts['custom_title'] ) )
  858.                 {
  859.                     $element_styling->add_styles( 'item-name', array( 'color' => $atts['custom_title'] ) );
  860.  
  861.                     $element_styling->add_classes( 'item-subtitle', 'av_opacity_variation' );
  862.                 }
  863.  
  864.                 $color = empty( $atts['custom_sub'] ) ? $atts['custom_title'] : $atts['custom_sub'];
  865.                 if( ! empty( $color ) )
  866.                 {
  867.                     $element_styling->add_styles( 'item-subtitle', array( 'color' => $color ) );
  868.                     $element_styling->add_styles( 'item-link', array( 'color' => $color ) );
  869.                 }
  870.  
  871.                 if( ! empty( $atts['custom_content'] ) )
  872.                 {
  873.                     $element_styling->add_styles( 'item-content', array( 'color' => $atts['custom_content'] ) );
  874.                     $element_styling->add_styles( 'controls', array( 'color' => $atts['custom_content'] ) );
  875.  
  876.                     $element_styling->add_classes( 'item-content', 'av_inherit_color' );
  877.                 }
  878.             }
  879.  
  880.             $element_styling->add_classes( 'item', array( 'flex_column', 'no_margin' ) );
  881.             switch( $atts['columns'] )
  882.             {
  883.                 case 1:
  884.                     $element_styling->add_classes( 'item', array( 'av_one_full' ) );
  885.                     break;
  886.                 case 2:
  887.                     $element_styling->add_classes( 'item', array( 'av_one_half' ) );
  888.                     break;
  889.                 case 3:
  890.                     $element_styling->add_classes( 'item', array( 'av_one_third' ) );
  891.                     break;
  892.                 case 4:
  893.                     $element_styling->add_classes( 'item', array( 'av_one_fourth' ) );
  894.                     break;
  895.             }
  896.  
  897.  
  898.             $selectors = array(
  899.                         'container'     => ".avia-testimonial-wrapper.{$element_id}",
  900.                         'item'          => ".avia-testimonial-wrapper.{$element_id} .avia-testimonial",
  901.                         'item-content'  => "#top .avia-testimonial-wrapper.{$element_id} .avia-testimonial-content",
  902.                         'item-name'     => "#top .avia-testimonial-wrapper.{$element_id} .avia-testimonial-name",
  903.                         'item-subtitle' => ".avia-testimonial-wrapper.{$element_id} .avia-testimonial-subtitle",
  904.                         'item-sub-sep'  => ".avia-testimonial-wrapper.{$element_id} .avia-testimonial-subtitle-sep",
  905.                         'item-link'     => ".avia-testimonial-wrapper.{$element_id} .avia-testimonial-link",
  906.                         'controls'      => ".avia-testimonial-wrapper.{$element_id} .avia-slideshow-controls"
  907.                     );
  908.  
  909.             $element_styling->add_selectors( $selectors );
  910.  
  911.             $result['default'] = $default;
  912.             $result['atts'] = $atts;
  913.             $result['content'] = $content;
  914.             $result['element_styling'] = $element_styling;
  915.  
  916.             $this->el_styling = $element_styling;
  917.  
  918.             return $result;
  919.         }
  920.  
  921.         /**
  922.          * Create custom stylings for items
  923.          *
  924.          * @since 4.8.4
  925.          * @param array $args
  926.          * @return array
  927.          */
  928.         protected function get_element_styles_item( array $args )
  929.         {
  930.             $result = parent::get_element_styles_item( $args );
  931.  
  932.             /**
  933.              * Fixes a problem when 3-rd party plugins call nested shortcodes without executing main shortcode  (like YOAST in wpseo-filter-shortcodes)
  934.              */
  935.             if( ! $this->in_sc_exec )
  936.             {
  937.                 return $result;
  938.             }
  939.  
  940.             extract( $result );
  941.  
  942.             $default = array(
  943.                         'src'           => '',
  944.                         'name'          => '',
  945.                         'subtitle'      => '',
  946.                         'link'          => '',
  947.                         'linktext'      => '',
  948.                         'custom_markup' => ''
  949.                     );
  950.  
  951.             $default = $this->sync_sc_defaults_array( $default, 'modal_item', 'no_content' );
  952.  
  953.             $locked = array();
  954.             Avia_Element_Templates()->set_locked_attributes( $atts, $this, $shortcodename, $default, $locked, $content );
  955.  
  956.             $atts = shortcode_atts( $default, $atts, $this->config['shortcode_nested'][0] );
  957.  
  958.  
  959.             $classes = array(
  960.                         'avia-testimonial',
  961.                         $element_id
  962.                     );
  963.  
  964.             $element_styling->add_classes( 'container', $classes );
  965.  
  966.             /**
  967.              * To support responsive images we moved avatar image from background to <img> tag
  968.              * The following commented lines are kept in case user like a fallback to background image - can be removed in future versions if no requests
  969.              *
  970.              * @since 4.8.4
  971.              */
  972.  
  973.             $element_styling->add_classes( 'container', 'avia-testimonial-row-' . avia_sc_testimonial::$rows );
  974.  
  975.             //if(count($testimonials) <= $rows * $columns) $class.= ' avia-testimonial-row-last ';
  976.             if( avia_sc_testimonial::$counter == 1 )
  977.             {
  978.                 $element_styling->add_classes( 'container', 'avia-first-testimonial' );
  979.             }
  980.             else if( avia_sc_testimonial::$counter == avia_sc_testimonial::$columns )
  981.             {
  982.                 $element_styling->add_classes( 'container', 'avia-last-testimonial' );
  983.             }
  984.  
  985.             /**
  986.              * avatar size filter
  987.              *
  988.              * @param string $size
  989.              * @param int|string $src       attachment id
  990.              * @param string $extra_class
  991.              * @return string
  992.              */
  993. //          $avatar_size = apply_filters( 'avf_testimonials_avatar_size', 'square', $atts['src'], $extra_class );
  994. //
  995. //          //  has to be kept inline because of image
  996. //          $bg = wp_get_attachment_image_src( $atts['src'], $avatar_size );
  997. //          if( ! empty( $bg[0] ) )
  998. //          {
  999. //              $element_styling->add_styles( 'image', array( 'background-image' => $bg[0] ) );
  1000. //          }
  1001.  
  1002.  
  1003.             $selectors = array(
  1004.                         'container' => ".avia-testimonial.{$element_id}",
  1005.                         'image'     => ".avia-testimonial.{$element_id} .avia-testimonial-image"
  1006.                     );
  1007.  
  1008.             $element_styling->add_selectors( $selectors );
  1009.  
  1010.             $result['default'] = $default;
  1011.             $result['atts'] = $atts;
  1012.             $result['content'] = $content;
  1013.             $result['element_styling'] = $element_styling;
  1014.  
  1015.             //  save for correct HTML markup
  1016.             avia_sc_testimonial::$counter_prev = avia_sc_testimonial::$counter;
  1017.             avia_sc_testimonial::$counter ++;
  1018.  
  1019.             if( avia_sc_testimonial::$counter > avia_sc_testimonial::$columns )
  1020.             {
  1021.                 avia_sc_testimonial::$counter = 1;
  1022.                 avia_sc_testimonial::$rows ++;
  1023.             }
  1024.  
  1025.             return $result;
  1026.         }
  1027.  
  1028.  
  1029.         /**
  1030.          * Frontend Shortcode Handler
  1031.          *
  1032.          * @param array $atts array of attributes
  1033.          * @param string $content text within enclosing form of shortcode element
  1034.          * @param string $shortcodename the shortcode found, when == callback name
  1035.          * @return string $output returns the modified html string
  1036.          */
  1037.         public function shortcode_handler( $atts, $content = '', $shortcodename = '', $meta = '' )
  1038.         {
  1039.             $result = $this->get_element_styles( compact( array( 'atts', 'content', 'shortcodename', 'meta' ) ) );
  1040.  
  1041.             extract( $result );
  1042.             extract( $atts );
  1043.  
  1044.             /**
  1045.              * Prior compact slider had no controls - this changed with this version.
  1046.              * Controls only shown on hover in 'slider_large'.
  1047.              *
  1048.              * @since 5.0       also allow controls for compact slider
  1049.              */
  1050.             $controls = false !== strpos( $atts['style'], 'slider' );
  1051.  
  1052.  
  1053.             $style_tag = $element_styling->get_style_tag( $element_id );
  1054.             $container_class = $element_styling->get_class_string( 'container' );
  1055.             $data_slideshow_options = $element_styling->get_data_attributes_json_string( 'container', 'slideshow-options' );
  1056.  
  1057.             $output  = '';
  1058.             $output .= $style_tag;
  1059.  
  1060.             $output .= "<div {$meta['custom_el_id']} class='{$container_class}' {$data_slideshow_options}>";
  1061.             $output .=      ShortcodeHelper::avia_remove_autop( $content, true );
  1062.  
  1063.             //close unclosed wrapper containers
  1064.             if( ! avia_sc_testimonial::$section_printed )
  1065.             {
  1066.                 $output .=  '</section>';
  1067.             }
  1068.  
  1069.             if( $controls )
  1070.             {
  1071.                 $output .= $this->slide_navigation_arrows( $atts );
  1072.                 $output .= $this->slide_navigation_dots( $atts );
  1073.             }
  1074.  
  1075.             $output .= '</div>';
  1076.  
  1077.             $this->in_sc_exec = false;
  1078.  
  1079.             return $output;
  1080.         }
  1081.  
  1082.         /**
  1083.          *
  1084.          * @return string
  1085.          */
  1086.         protected function slide_navigation_dots( $atts )
  1087.         {
  1088.             $args = array(
  1089.                             'total_entries'     => avia_sc_testimonial::$counter - 1,
  1090.                             'container_entries' => 1,
  1091.                             'context'           => get_class(),
  1092.                             'params'            => $atts
  1093.             );
  1094.             return aviaFrontTemplates::slide_navigation_dots( $args );
  1095.         }
  1096.  
  1097.         /**
  1098.          * Create arrows to scroll slides
  1099.          *
  1100.          * @since 4.8.3         reroute to aviaFrontTemplates
  1101.          * @param array $atts
  1102.          * @return string
  1103.          */
  1104.         protected function slide_navigation_arrows( array $atts )
  1105.         {
  1106.             $args = array(
  1107.                         'context'           => get_class(),
  1108.                         'params'            => $atts
  1109.                     );
  1110.  
  1111.             return aviaFrontTemplates::slide_navigation_arrows( $args );
  1112.         }
  1113.  
  1114.  
  1115.         /**
  1116.          * Shortcode handler
  1117.          *
  1118.          * @param array $atts
  1119.          * @param string $content
  1120.          * @param string $shortcodename
  1121.          * @return string
  1122.          */
  1123.         public function av_testimonial_single( $atts, $content = '', $shortcodename = '' )
  1124.         {
  1125.             /**
  1126.              * Fixes a problem when 3-rd party plugins call nested shortcodes without executing main shortcode  (like YOAST in wpseo-filter-shortcodes)
  1127.              */
  1128.             if( ! $this->in_sc_exec )
  1129.             {
  1130.                 return '';
  1131.             }
  1132.  
  1133.             $result = $this->get_element_styles_item( compact( array( 'atts', 'content', 'shortcodename' ) ) );
  1134.  
  1135.             extract( $result );
  1136.             extract( $atts );
  1137.  
  1138.             $avatar = '';
  1139.             $is_grid = avia_sc_testimonial::$style == 'grid';
  1140.             $grid_style = $is_grid ? avia_sc_testimonial::$grid_style : '';
  1141.  
  1142.             if( $link && ! $linktext )
  1143.             {
  1144.                 $linktext = $link;
  1145.             }
  1146.  
  1147.             if( $link == 'http://' || $link == 'https://' )
  1148.             {
  1149.                 $link = '';
  1150.             }
  1151.  
  1152.             $linktext = htmlentities( $linktext );
  1153.  
  1154.             $markup_avatar = avia_markup_helper( array( 'context' => 'single_image', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1155.             $markup_person = avia_markup_helper( array( 'context' => 'person','echo' => false, 'custom_markup'=> $custom_markup ) );
  1156.             $markup_author = avia_markup_helper( array( 'context' => 'author', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1157.             $markup_text = avia_markup_helper( array( 'context' => 'entry', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1158.             $markup_content = avia_markup_helper( array( 'context' => 'entry_content', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1159.             $markup_name = avia_markup_helper( array( 'context' => 'name', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1160.             $markup_job = avia_markup_helper( array( 'context' => 'job', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1161.  
  1162.             if( strpos( $link, '@') >= 1 )
  1163.             {
  1164.                 $markup_url = avia_markup_helper( array( 'context' => 'email', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1165.             }
  1166.             else
  1167.             {
  1168.                 $markup_url = avia_markup_helper( array( 'context' => 'url', 'echo' => false, 'custom_markup' => $custom_markup ) );
  1169.             }
  1170.  
  1171.  
  1172.             $style_tag = $element_styling->get_style_tag( $element_id );
  1173.             $container_class = $element_styling->get_class_string( 'container' );
  1174.  
  1175.             //  classes set in main element
  1176.             $content_class = $this->el_styling->get_class_string( 'item-content' );
  1177.             $subtitle_class = $this->el_styling->get_class_string( 'item-subtitle' );
  1178.             $item_class = $this->el_styling->get_class_string( 'item' );
  1179.  
  1180.             //final output
  1181.             if( $src )
  1182.             {
  1183.                 /**
  1184.                  * Avatar size filter
  1185.                  *
  1186.                  * @param string $size
  1187.                  * @param int|string $src       attachment id
  1188.                  * @param string $container_class
  1189.                  * @return string
  1190.                  */
  1191.                 $avatar_size = apply_filters( 'avf_testimonials_avatar_size', 'square', $src, $container_class );
  1192.                 $img = wp_get_attachment_image( $src, $avatar_size );
  1193.  
  1194.                 $avatar = "<div class='avia-testimonial-image' {$markup_avatar}>{$img}</div>";
  1195.             }
  1196.  
  1197.             $output = '';
  1198.             $output .= $style_tag;
  1199.  
  1200.             if( avia_sc_testimonial::$counter_prev == 1 )
  1201.             {
  1202.                 $output .= '<section class="avia-testimonial-row">';
  1203.             }
  1204.  
  1205.             $output .= "<div class='{$container_class} {$item_class}'>";
  1206.             $output .=      "<div class='avia-testimonial_inner' {$markup_text}>";
  1207.  
  1208.             if( $is_grid && $grid_style == '' )
  1209.             {
  1210.                 $output .=      $avatar;
  1211.             }
  1212.  
  1213.             $output .=          "<div class='avia-testimonial-content {$content_class}'>";
  1214.             $output .=              "<div class='avia-testimonial-markup-entry-content' {$markup_content}>";
  1215.             $output .=                  ShortcodeHelper::avia_apply_autop( ShortcodeHelper::avia_remove_autop( $content ) );
  1216.             $output .=              '</div>';
  1217.             $output .=          '</div>';
  1218.             $output .=          '<div class="avia-testimonial-meta">';
  1219.             $output .=              '<div class="avia-testimonial-arrow-wrap">';
  1220.             $output .=                  '<div class="avia-arrow"></div>';
  1221.             $output .=              '</div>';
  1222.  
  1223.             if( ! $is_grid || ( $is_grid && $grid_style != '' ) )
  1224.             {
  1225.                 $output .=          $avatar;
  1226.             }
  1227.  
  1228.             $output .=              "<div class='avia-testimonial-meta-mini' {$markup_author}>";
  1229.  
  1230.             if( $name )
  1231.             {
  1232.                 $output .=              "<strong  class='avia-testimonial-name' {$markup_name}>{$name}</strong>";
  1233.             }
  1234.  
  1235.             if( $subtitle )
  1236.             {
  1237.                 $output .=              "<span  class='avia-testimonial-subtitle {$subtitle_class}' {$markup_job}>{$subtitle}</span>";
  1238.             }
  1239.  
  1240.             if( $link )
  1241.             {
  1242.                 $output .=              "<span class='hidden avia-testimonial-markup-link' {$markup_url}>{$link}</span>";
  1243.             }
  1244.  
  1245.             if( $link && $subtitle )
  1246.             {
  1247.                 $output .=              '<span class="avia-testimonial-subtitle-sep">&ndash;</span>';
  1248.             }
  1249.  
  1250.             if( $link )
  1251.             {
  1252.                 $output .=              "<a class='aviablank avia-testimonial-link' href='{$link}' rel=’noopener noreferrer’>{$linktext}</a>";
  1253.             }
  1254.  
  1255.             $output .=              '</div>';
  1256.             $output .=          '</div>';
  1257.             $output .=      '</div>';
  1258.             $output .= '</div>';
  1259.  
  1260.             if( avia_sc_testimonial::$counter_prev == avia_sc_testimonial::$columns )
  1261.             {
  1262.                 $output .= '</section>';
  1263.                 avia_sc_testimonial::$section_printed = true;
  1264.             }
  1265.             else
  1266.             {
  1267.                 avia_sc_testimonial::$section_printed = false;
  1268.             }
  1269.  
  1270.             return $output;
  1271.         }
  1272.  
  1273.     }
  1274. }
  1275.  
  1276.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement