), 'id_sizes' => array( // 'default' => 'custom_date_size', 'medium' => 'av-medium-font-size', 'small' => 'av-small-font-size', 'mini' => 'av-mini-font-size' ) ), ); $template = array( array( 'type' => 'template', 'template_id' => 'toggle', 'title' => __( 'Fonts', 'avia_framework' ), 'content' => $c ), ); AviaPopupTemplates()->register_dynamic_template( $this->popup_key( 'styling_fonts' ), $template ); } /** * Create custom stylings * * @since 4.8.4 * @param array $args * @return array */ protected function get_element_styles( array $args ) { $result = parent::get_element_styles( $args ); extract( $result ); $default = array( 'date' => '', 'hour' => '12', 'minute' => '0', 'timezone' => '', 'min' => '1', 'max' => '5', 'align' => 'av-align-center', 'size' => '', 'style' => 'av-default-style', 'link' => '', // used by events_countown 'title' => '' // used by events_countown ); $default = $this->sync_sc_defaults_array( $default ); $locked = array(); Avia_Element_Templates()->set_locked_attributes( $atts, $this, $shortcodename, $default, $locked, $content ); Avia_Element_Templates()->add_template_class( $meta, $atts, $default ); $meta = aviaShortcodeTemplate::set_frontend_developer_heading_tag( $atts, $meta ); $atts = shortcode_atts( $default, $atts, $this->config['shortcode'] ); $element_styling->create_callback_styles( $atts ); $classes = array( 'av-countdown-timer', $element_id, $atts['align'], $atts['style'] ); $element_styling->add_classes( 'container', $classes ); $element_styling->add_classes_from_array( 'container', $meta, 'el_class' ); if( ! empty( $atts['size'] ) ) { $element_styling->add_styles( 'time', array( 'font-size' => $atts['size'] . 'px' ) ); } $selectors = array( 'container' => ".av-countdown-timer.{$element_id}", 'time' => ".av-countdown-timer.{$element_id} .av-countdown-time" ); $element_styling->add_selectors( $selectors ); $result['default'] = $default; $result['atts'] = $atts; $result['content'] = $content; $result['meta'] = $meta; return $result; } /** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler( $atts, $content = '', $shortcodename = '', $meta = '' ) { $result = $this->get_element_styles( compact( array( 'atts', 'content', 'shortcodename', 'meta' ) ) ); extract( $result ); extract( AviaHelper::av_mobile_sizes( $atts ) ); //return $av_font_classes, $av_title_font_classes and $av_display_classes extract( $atts ); $current_time_array = $this->clean_up_time_array( $atts ); $offset = AviaHtmlHelper::get_timezone_offset( $timezone ) * 60; $interval = $this->full_time_array[ $min ]['interval']; $data_final_time = ''; if( empty( $date ) ) { return ''; } $date = explode( '/', $date ); $data_final_time .= " data-year='" . $date[2] . "'"; $data_final_time .= " data-month='" . ( (int) $date[0] - 1 ) . "'"; $data_final_time .= " data-day='" . $date[1] . "'"; $data_final_time .= " data-hour='" . $hour . "'"; $data_final_time .= " data-minute='" . $minute . "'"; $data_final_time .= " data-timezone='" . $offset . "'"; $tags = ! empty( $link ) ? array( "a href='{$link}' ", 'a' ) : array( 'span', 'span' ); $default_heading = ! empty( $meta['heading_tag'] ) ? $meta['heading_tag'] : 'h3'; $args = array( 'heading' => $default_heading, 'extra_class' => $meta['heading_class'] ); $extra_args = array( $this, $atts, $content, 'title' ); /** * @since 4.5.5 * @return array */ $args = apply_filters( 'avf_customize_heading_settings', $args, __CLASS__, $extra_args ); $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading; $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : $meta['heading_class']; // used by e.g. events countdown - prepare output string if( is_array( $title ) ) { if( isset( $title['top'] ) && ! empty( $title['top'] ) ) { $title['top'] = "<{$heading}><{$tags[0]} class='av-countdown-timer-title av-countdown-timer-title-top {$css}'>{$title['top']}"; } else { unset( $title['top'] ); } if( isset( $title['bottom'] ) && ! empty( $title['bottom'] ) ) { $title['bottom'] = "<{$heading}><{$tags[0]} class='av-countdown-timer-title av-countdown-timer-title-bottom {$css}'>{$title['bottom']}"; } else { unset( $title['bottom'] ); } } $style_tag = $element_styling->get_style_tag( $element_id ); $container_class = $element_styling->get_class_string( 'container' ); $output = ''; $output .= $style_tag; $output .= "
"; if( is_array( $title ) && isset( $title['top'] ) ) { $output .= $title['top']; } $output .= "<{$tags[0]} class='av-countdown-timer-inner'>"; foreach( array_reverse( $current_time_array ) as $key => $number ) { if( $number >= $min && $number <= $max ) { $class = $this->full_time_array[ $number ]['class']; $single = $this->full_time_array[ $number ]['label']; $multi = $this->full_time_array[ $number ]['label_multi']; $output .= ""; $output .= ""; $output .= "0"; $output .= "{$multi}"; $output .= ''; $output .= ''; } } $output .= ""; if( is_array( $title ) && isset( $title['bottom'] ) ) { $output .= $title['bottom']; } $output .= '
'; return $output; } /** * Remove week/month/year depending on setting for "Smallest time unit" and "Largest time unit" * Make sure that $atts['min'] <= $atts['max'] before calling this function * * @since 4.8 * @param array $atts * @return array */ protected function clean_up_time_array( array &$atts ) { // fallback if( $atts['min'] > $atts['max'] ) { $atts['min'] = $atts['max']; } $current = array_flip( $this->time_array ); if( $atts['max'] == 5 ) { unset( $current[6] ); unset( $current[7] ); } else if( in_array( $atts['max'], array( 6, 7 ) ) ) { if( $atts['min'] == 5 ) { $atts['min'] = 6; } unset( $current[5] ); } return array_flip( $current ); } } } {"version":"1.0","provider_name":"Stichting Collot Zien en Beleven","provider_url":"https:\/\/www.collotzienenbeleven.nl","author_name":"Stichting Collot Zien en Beleven","author_url":"https:\/\/www.collotzienenbeleven.nl","title":"Zandvoort Casino No Deposit Bonus","type":"rich","width":600,"height":338,"html":"
Zandvoort Casino No Deposit Bonus<\/a><\/blockquote>