PluginProbe
Easy Bootstrap Shortcode / 4.5
Easy Bootstrap Shortcode v4.5
trunk 2.4.0 2.5 3.4 3.5 3.6 3.7 4.0.0 4.4 4.5 4.5.4 5.0.0 5.0.1 5.0.2
easy-bootstrap-shortcodes / shortcode / oscpopover / plugin_shortcode.php

plugin_shortcode.php in Easy Bootstrap Shortcode 4.5, at shortcode/oscpopover/plugin_shortcode.php

90 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function osc_theme_popover($params, $content = 'Popover') {
4 extract(shortcode_atts(array(
5 'trigger' => '',
6 'title' => '',
7 'pop_content' => '',
8 'style' => '',
9 'size' => '',
10 'type' => '',
11 'class' => ''
12 ), $params));
13 $out = '';
14 $out = '<button class="osc_popover btn ' . $size . ' ' . $type . ' ' . $class .EBS_CONTAINER_CLASS. '" data-content="' . $pop_content . '" data-placement="' . $style . '" data-toggle="popover" data-trigger="' . $trigger . '" data-container="body" type="button" data-title="' . $title . '"> ' . do_shortcode($content) . ' </button>';
15
16 if(EBS_POPOVER_TEMPLATE==''){
17 $out .= "
18 <script>
19 jQuery(document).ready(function(){
20 jQuery('.osc_popover').popover();
21 });
22 </script>
23 ";
24
25
26 } else{
27 $out .= "
28 <script>
29 jQuery(document).ready(function(){
30 jQuery('.osc_popover').popover({template:'".EBS_POPOVER_TEMPLATE."'});
31 });
32 </script>
33 ";
34 }
35 return $out;
36 }
37 $_osc_popover_array=array('count'=>0);
38 function osc_theme_popover_new($params, $content = '') {
39 global $_osc_popover_array;
40 extract(shortcode_atts(array(
41 'id'=>count($_osc_popover_array),
42 'trigger' => '',
43 'title' => '',
44 'button_text' => 'Popover',
45 'style' => '',
46 'size' => '',
47 'type' => '',
48 'class' => ''
49 ), $params));
50 $_osc_popover_array[$id]=array();
51 $out = '';
52 $out = '<button class="osc_popover_new btn ' . $size . ' ' . $type . ' ' . $class .EBS_CONTAINER_CLASS. '" data-placement="' . $style . '" data-toggle="popover" data-trigger="' . $trigger . '" data-container="body" type="button" data-title="' . $title . '" data-contentwrapper="osc_popover_'.$id.'"> ' .$button_text . ' </button>';
53 $out.='<div id="osc_popover_'.$id.'" style="display:none;">'.do_shortcode($content).'</div>';
54
55 if(EBS_POPOVER_TEMPLATE==''){
56 $out .= "
57 <script>
58 jQuery(document).ready(function(){
59 jQuery('.osc_popover_new').popover({
60 html:true,
61 content:function(){
62 return jQuery('#'+jQuery(this).data('contentwrapper')).html();
63 }
64
65 });
66 });
67 </script>
68 ";
69
70
71 } else{
72 $out .= "
73 <script>
74 jQuery(document).ready(function(){
75 jQuery('.osc_popover_new').popover({
76 template:'".EBS_POPOVER_TEMPLATE."',
77 html:true,
78 content:function(){
79 return jQuery('#'+jQuery(this).data('contentwrapper')).html();
80 }
81 });
82 });
83 </script>
84 ";
85 }
86 return $out;
87 }
88
89 ebs_backward_compatibility_callback('popover', 'osc_theme_popover');
90 ebs_backward_compatibility_callback('popovernew', 'osc_theme_popover_new');