function blox_parse_callout_hook($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'alignment' => 'left', 'skin' => 'bordered', 'animation' => '', 'extra_class' => '', 'visibility' => ''), $atts)); $is_animate = $animation != 'none' && $animation != '' ? 'animate' : ''; $title = $title != '' ? "<h1>{$title}</h1>" : ''; $visibility = str_replace(',', ' ', $visibility); $content = fix_shortcode_paragraph($content); $html = "<div class='blox-element callout text-{$alignment} {$skin} {$is_animate} {$extra_class} {$visibility}' data-animate='{$animation}'>{$title}<p class='lead'>" . do_shortcode($content) . "</p></div>"; return $html; }
function blox_parse_text_hook($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'visibility' => '', 'animation' => '', 'extra_class' => ''), $atts)); $title = $title != '' ? '<h3 class="element-title">' . $title . '</h3>' : ''; $is_animate = $animation != 'none' && $animation != '' ? 'animate' : ''; $animation = "data-animate='{$animation}'"; $visibility = str_replace(',', ' ', $visibility); $content = fix_shortcode_paragraph($content); return "<div class='blox-element blox-element-text {$is_animate} {$extra_class} {$visibility}' {$animation}>" . $title . do_shortcode($content) . "</div>"; }
function blox_parse_raw_hook($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'animation' => '', 'extra_class' => ''), $atts)); $title = $title != '' && $title != 'undefined' ? '<h3 class="element_title">' . $title . '</h3>' : ''; $animate_class = get_blox_animate_class($animation); $content = fix_shortcode_paragraph($content); $content = html_entity_decode($content); $content = html_unescape($content); $content = str_replace('”', '"', $content); $content = str_replace('″', '"', $content); return "<div class='blox_element tt_raw_content {$animate_class} {$extra_class}'>" . $title . do_shortcode($content) . "</div>"; }
function blox_notification_hook($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'type' => 'default', 'alignment' => 'left', 'dismissable' => '0', 'animation' => '', 'extra_class' => '', 'visibility' => ''), $atts)); $title = $title != '' ? "<h3>{$title}</h3>" : ''; $type = $type != 'default' ? $type : ''; $is_animate = $animation != 'none' && $animation != '' ? 'animate' : ''; $close_button = $dismissable == '1' ? "<a class='close' data-dismiss='alert' href='#' aria-hidden='true'>×</a>" : ''; $dismissable = $dismissable == '1' ? 'alert-dismissable-1' : ''; $visibility = str_replace(',', ' ', $visibility); $content = fix_shortcode_paragraph($content); return "<div class='blox-element alert {$type} {$dismissable} text-{$alignment} {$is_animate} {$extra_class} {$visibility}' data-animate='{$animation}'>{$close_button} {$title} " . do_shortcode($content) . "</div>"; }
function blox_parse_service_hook($atts, $content = null) { extract(shortcode_atts(array('layout' => 'default', 'alignment' => 'left', 'title' => '', 'heading' => 'h3', 'icon' => '', 'icon_size' => 'md', 'icon_location' => 'left', 'icon_link' => '', 'skin' => 'default', 'animation' => 'none', 'extra_class' => '', 'visibility' => ''), $atts)); $service_title = "<{$heading} class='service-title'>{$title}</{$heading}>"; $is_animate = $animation != 'none' && $animation != '' ? 'animate' : ''; // Link $box_link = $box_link_close = ''; if (($skin == 'boxed' || $skin == 'bordered') && $icon_link != '') { $box_link = "<a href='{$icon_link}'>"; $box_link_close = "</a>"; $icon_link = ''; } $skin = $skin == 'default' ? '' : $skin; $visibility = str_replace(',', ' ', $visibility); $extra_class .= ' ' . $visibility; $service_icon = "<span class='blox-icon {$icon_size} {$icon}'></span>"; $service_icon = validateURL($icon) ? "<span class='service-image'><img src='{$icon}' alt='service-image' class='img-responsive' /></span>" : $service_icon; $service_icon = $icon_link != '' ? "<a href='{$icon_link}'>" . $service_icon . "</a>" : $service_icon; $icon_top = $icon_location == 'top' ? $service_icon : ''; $icon_middle = $icon_location == 'middle' ? $service_icon : ''; $icon_bottom = $icon_location == 'bottom' ? $service_icon : ''; $content = fix_shortcode_paragraph($content); $find_p = strpos($content, '</p>'); if ($find_p === false) { $content = "<p>" . trim($content) . "</p>"; } $html = ''; if ($layout == 'small_icon') { $html = "<div class='blox-element service-icon-title {$skin} {$is_animate} {$extra_class}' data-animate='{$animation}'><{$heading}>{$service_icon}{$title}</{$heading}>" . do_shortcode($content) . "</div>"; } else { if ($layout == 'left_icon') { $html = "<div class='blox-element service-icon-left {$skin} {$is_animate} {$extra_class}' data-animate='{$animation}'>" . $service_icon . $service_title . do_shortcode($content) . "</div>"; } else { // $layout=='default' $html = "<div class='blox-element service-block text-{$alignment} {$skin} {$is_animate} {$extra_class}' data-animate='{$animation}'>" . $icon_top . $service_title . $icon_middle . do_shortcode($content) . $icon_bottom . "</div>"; } } return $box_link . $html . $box_link_close; }