| 1 |
<?php |
| 2 |
|
| 3 |
/* * ********************************************************* |
| 4 |
* Tooltip |
| 5 |
* ********************************************************* */ |
| 6 |
|
| 7 |
function osc_theme_tooltip($params, $content = 'Tooltip') { |
| 8 |
extract(shortcode_atts(array( |
| 9 |
'type' => '', |
| 10 |
'link' => '', |
| 11 |
'tooltip' => '', |
| 12 |
'style' => '', |
| 13 |
'class' => '', |
| 14 |
'target' => '', |
| 15 |
), $params)); |
| 16 |
$out = ''; |
| 17 |
if ($type == 'link') { |
| 18 |
$out = '<a href="' . $link . '" data-placement="' . $style . '" title="' . $tooltip . '" class="osc_tooltip ' . $class .'" target="'.$target.'">' . do_shortcode($content) . '</a> |
| 19 |
'; |
| 20 |
} elseif ($type == 'button') { |
| 21 |
$out = '<button type="button" data-toggle="tooltip" data-placement="' . $style . '" title="' . $tooltip . '" class="btn osc_tooltip ' . $class . '">' . do_shortcode($content) . '</button>'; |
| 22 |
} |
| 23 |
|
| 24 |
if(EBS_TOOLTIP_TEMPLATE==''){ |
| 25 |
$out .= " |
| 26 |
<script> |
| 27 |
jQuery(document).ready(function() { |
| 28 |
jQuery('.osc_tooltip').tooltip(); |
| 29 |
}); |
| 30 |
</script> |
| 31 |
"; |
| 32 |
|
| 33 |
} else{ |
| 34 |
$out .= " |
| 35 |
<script> |
| 36 |
jQuery(document).ready(function(){ |
| 37 |
jQuery('.osc_tooltip').tooltip({template:'".EBS_TOOLTIP_TEMPLATE."'}); |
| 38 |
}); |
| 39 |
</script> |
| 40 |
"; |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
return $out; |
| 45 |
} |
| 46 |
|
| 47 |
ebs_backward_compatibility_callback('tooltip', 'osc_theme_tooltip'); |