faysalmirmd

How to add Twitter Bootstrap in joomla 3.0

Dec 4th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.74 KB | None | 0 0
  1. JHtml::_('jquery.framework'); //jquery for joomla 3.0
  2. JHtml::_('bootstrap.framework'); // how to add twitter bootstrap in joomla
  3.  
  4. $image.= '<div class="cbresponsivefbpgkstrmbsimg" style="float:left;margin:2px 5px 0 5px;'.$leftmarginstyle.'">';
  5.      $image.= '<div class="cbresponsivefbpgkstrmphoto" style="">';
  6.     $image.=   '<a style="cursor:pointer;" class="cbrfbstrmimg cbresponsivefbpgkstrmanchor tbpop" href="' .       (($pinopen == 'pop') ? '#' : $anchorhref ) . '" target="_blank" '.$tooltipattr.'  data-target="#cbresponsivefbpgkstrm'.$itemkey.'img'.$thumbindex.'" iframesrc="" vidhost="">';
  7.             //$image.=       '<div style="max-width:'.$thimbdimension.'px;" >';
  8.             $image.=           '<img style="max-width:'.$thimbdimension.'px;" class="cbresponsivefbpgkstrmitemthumb" src="' . $imgsrc . '" alt="fbthumb" />';
  9.             //$image.=       '</div>';
  10.             $image.=   '</a>';
  11.             $image.= '</div>';
  12.  
  13.             if($pinopen == 'pop' && $tooltipimg){
  14.                 //$image.= '<div style="margin:2px 5px 0 0;">';style="width:auto; margin-left:-150px;"
  15.                 $image .= '<div id="cbresponsivefbpgkstrm'.$itemkey.'img'.$thumbindex.'" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none;max-width:500px;width:auto;">';
  16.                 $image .=    '<div class="modal-header">';
  17.                 $image .=         '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><div style="clear:both;"></div>';                                      
  18.                 $image .=    '</div>';
  19.                 $image .=    '<div class="modal-body" style="overflow:hidden;">';
  20.                 $image .=        '<img style="" src="'.$tooltipimg.'" />';
  21.                 $image .=    '</div>';
  22.                 $image .=    '<div class="modal-footer">';
  23.                 $image .=       '<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>';
  24.                 $image .=    '</div>';
  25.                 $image .= '</div>';
  26.                 //$image .= '</div>';
  27.             }
  28.  
  29.         $image .= '</div>';
  30.  
  31. //javascript for adding modal
  32. if($pinopen == 'pop'){                  
  33.             $modaljs = 'jQuery(document).ready(function(){  
  34.                            jQuery("a.cbresponsivefbpgkstrmanchor").click(function(event){
  35.                                event.preventDefault();
  36.                                var id = jQuery(this).data("target");
  37.                                jQuery(id).modal();
  38.                                //console.log(id);
  39.                            });
  40.                            '.$bsmodaljs.'
  41.                        });';
  42.  
  43.             $doc->addScriptDeclaration($modaljs);
  44.         }
Advertisement
Add Comment
Please, Sign In to add comment