PATH:
home
/
letacommog
/
lesfinessaveurs
/
wp-content
/
plugins
/
fusion-builder
/
shortcodes
<?php if ( fusion_is_element_enabled( 'fusion_tooltip' ) ) { if ( ! class_exists( 'FusionSC_Tooltip' ) ) { /** * Shortcode class. * * @package fusion-builder * @since 1.0 */ class FusionSC_Tooltip extends Fusion_Element { /** * An array of the shortcode arguments. * * @since 1.0 * @access protected * @var array */ protected $args; /** * Constructor. * * @access public * @since 1.0 */ public function __construct() { parent::__construct(); add_filter( 'fusion_attr_tooltip-shortcode', array( $this, 'attr' ) ); add_shortcode( 'fusion_tooltip', array( $this, 'render' ) ); } /** * Render the shortcode * * @access public * @since 1.0 * @param array $args Shortcode parameters. * @param string $content Content between shortcode. * @return string HTML output. */ public function render( $args, $content = '' ) { $defaults = FusionBuilder::set_shortcode_defaults( array( 'class' => '', 'id' => '', 'animation' => false, 'delay' => 0, 'placement' => 'top', 'title' => 'none', 'trigger' => 'hover', ), $args, 'fusion_tooltip' ); extract( $defaults ); $this->args = $defaults; $html = sprintf( '<span %s>%s</span>', FusionBuilder::attributes( 'tooltip-shortcode' ), do_shortcode( $content ) ); return $html; } /** * Builds the attributes array. * * @access public * @since 1.0 * @return array */ public function attr() { $attr = array( 'class' => 'fusion-tooltip tooltip-shortcode', ); if ( $this->args['class'] ) { $attr['class'] .= ' ' . $this->args['class']; } if ( $this->args['id'] ) { $attr['id'] = $this->args['id']; } $attr['data-animation'] = $this->args['animation']; $attr['data-delay'] = $this->args['delay']; $attr['data-placement'] = $this->args['placement']; $attr['data-title'] = $this->args['title']; $attr['data-toggle'] = 'tooltip'; $attr['data-trigger'] = $this->args['trigger']; return $attr; } /** * Builds the dynamic styling. * * @access public * @since 1.1 * @return array */ public function add_styling() { global $fusion_library, $fusion_settings, $dynamic_css_helpers; $elements = apply_filters( 'fusion_builder_element_classes', array( '.tooltip-shortcode' ), '.tooltip-shortcode' ); $css['global'][ $dynamic_css_helpers->implode( $elements ) ]['color'] = $fusion_library->sanitize->color( $fusion_settings->get( 'primary_color' ) ); return $css; } /** * Sets the necessary scripts. * * @access public * @since 1.1 * @return void */ public function add_scripts() { Fusion_Dynamic_JS::enqueue_script( 'fusion-tooltip' ); } } } new FusionSC_Tooltip(); } /** * Map shortcode to Fusion Builder. * * @since 1.0 */ function fusion_element_tooltip() { fusion_builder_map( array( 'name' => esc_attr__( 'Tooltip', 'fusion-builder' ), 'shortcode' => 'fusion_tooltip', 'icon' => 'fusiona-exclamation-sign', 'generator_only' => true, 'params' => array( array( 'type' => 'textfield', 'heading' => esc_attr__( 'Tooltip Title', 'fusion-builder' ), 'description' => esc_attr__( 'Insert the text that displays in the tooltip.', 'fusion-builder' ), 'param_name' => 'title', 'value' => '', ), array( 'type' => 'textarea', 'heading' => esc_attr__( 'Triggering Content', 'fusion-builder' ), 'description' => esc_attr__( 'Insert the text that will activate the tooltip when hovered or clicked.', 'fusion-builder' ), 'param_name' => 'element_content', 'value' => '', ), array( 'type' => 'radio_button_set', 'heading' => esc_attr__( 'Tooltip Position', 'fusion-builder' ), 'description' => esc_attr__( 'Choose the display position.' ), 'param_name' => 'placement', 'value' => array( 'top' => esc_attr__( 'Top', 'fusion-builder' ), 'bottom' => esc_attr__( 'Bottom', 'fusion-builder' ), 'left' => esc_attr__( 'Left', 'fusion-builder' ), 'right' => esc_attr__( 'Right', 'fusion-builder' ), ), 'default' => 'top', 'group' => esc_attr__( 'Design', 'fusion-builder' ), ), array( 'type' => 'radio_button_set', 'heading' => esc_attr__( 'Tooltip Trigger Action', 'fusion-builder' ), 'description' => esc_attr__( 'Choose action to trigger the tooltip.', 'fusion-builder' ), 'param_name' => 'trigger', 'value' => array( 'hover' => esc_attr__( 'Hover', 'fusion-builder' ), 'click' => esc_attr__( 'Click', 'fusion-builder' ), ), 'default' => 'hover', 'group' => esc_attr__( 'Design', 'fusion-builder' ), ), array( 'type' => 'textfield', 'heading' => esc_attr__( 'CSS Class', 'fusion-builder' ), 'param_name' => 'class', 'value' => '', 'description' => esc_attr__( 'Add a class to the wrapping HTML element.', 'fusion-builder' ), ), array( 'type' => 'textfield', 'heading' => esc_attr__( 'CSS ID', 'fusion-builder' ), 'param_name' => 'id', 'value' => '', 'description' => esc_attr__( 'Add an ID to the wrapping HTML element.', 'fusion-builder' ), ), ), ) ); } add_action( 'fusion_builder_before_init', 'fusion_element_tooltip' );
[+]
..
[-] fusion-woo-shortcodes.php
[edit]
[-] fusion-fontawesome.php
[edit]
[-] fusion-youtube.php
[edit]
[-] fusion-countdown.php
[edit]
[-] fusion-tabs.php
[edit]
[-] fusion-counters-circle.php
[edit]
[-] fusion-table.php
[edit]
[-] fusion-modal.php
[edit]
[-] fusion-tooltip.php
[edit]
[-] fusion-text.php
[edit]
[-] fusion-flip-boxes.php
[edit]
[+]
js
[-] fusion-gallery.php
[edit]
[-] fusion-code-block.php
[edit]
[-] fusion-progress.php
[edit]
[-] fusion-row-inner.php
[edit]
[-] fusion-user-login.php
[edit]
[-] fusion-separator.php
[edit]
[-] fusion-syntax-highlighter.php
[edit]
[-] fusion-image-carousel.php
[edit]
[-] fusion-one-page-link.php
[edit]
[-] fusion-slider.php
[edit]
[-] fusion-pricing-table.php
[edit]
[-] fusion-menu-anchor.php
[edit]
[-] fusion-tagline.php
[edit]
[-] fusion-google-map.php
[edit]
[-] fusion-testimonials.php
[edit]
[-] fusion-dropcap.php
[edit]
[-] fusion-image.php
[edit]
[-] fusion-highlight.php
[edit]
[-] fusion-woo-product-slider.php
[edit]
[-] fusion-person.php
[edit]
[-] fusion-convertplus.php
[edit]
[-] fusion-woo-featured-products-slider.php
[edit]
[-] fusion-popover.php
[edit]
[-] fusion-lightbox.php
[edit]
[-] fusion-checklist.php
[edit]
[-] fusion-toggle.php
[edit]
[-] fusion-sharingbox.php
[edit]
[-] fusion-nextpage.php
[edit]
[-] fusion-column-inner.php
[edit]
[-] fusion-soundcloud.php
[edit]
[-] fusion-post-slider.php
[edit]
[-] fusion-social-links.php
[edit]
[-] fusion-widget-area.php
[edit]
[-] fusion-column.php
[edit]
[-] fusion-vimeo.php
[edit]
[-] fusion-events.php
[edit]
[-] fusion-content-boxes.php
[edit]
[-] fusion-counters-box.php
[edit]
[-] fusion-global.php
[edit]
[-] fusion-revolution-slider.php
[edit]
[-] fusion-container.php
[edit]
[-] fusion-recent-posts.php
[edit]
[-] fusion-row.php
[edit]
[-] fusion-blog.php
[edit]
[-] fusion-title.php
[edit]
[-] fusion-image-before-after.php
[edit]
[-] fusion-alert.php
[edit]
[-] fusion-button.php
[edit]
[-] fusion-section-separator.php
[edit]
[-] fusion-layer-slider.php
[edit]
[-] fusion-blank-page.php
[edit]
[-] fusion-chart.php
[edit]