public static function bootstrap($load_bsjs, $load_bscss, $local_css, $custom_tag = true) { $app = JFactory::getApplication(); // Load Bootstrap JavaScript if ($load_bsjs && !isset($app->cjbsjs)) { if (APP_VERSION < 3) { // make sure jquery is loaded CjLibBehavior::jquery(); // now load bootstrap CJFunctions::add_script(CJLIB_MEDIA_URI . '/bootstrap/js/bootstrap.min.js', $custom_tag); } else { JHtml::_('bootstrap.framework'); } CJFunctions::add_script(CJLIB_MEDIA_URI . '/bootstrap/js/respond.min.js', $custom_tag); $app->cjbsjs = true; } // Load Bootstrap CSS if ($load_bscss && !isset($app->cjbscss)) { $doc = JFactory::getDocument(); // CJFunctions::add_css_to_document($doc, '/media/jui/css/bootstrap.min.css', false); CJFunctions::add_css_to_document($doc, CJLIB_MEDIA_URI . '/bootstrap/css/' . ($local_css ? 'cj.' : '') . 'bootstrap.min.css', $custom_tag); if ($doc->direction == 'rtl') { CJFunctions::add_css_to_document($doc, CJLIB_MEDIA_URI . '/bootstrap/css/' . ($local_css ? 'cj.' : '') . 'boostrap-rtl.min.css', $custom_tag); } $app->cjbscss = true; } }
public static function behavior($behavior, $options = array()) { require_once CJLIB_PATH . '/framework/behavior.php'; $custom_tag = isset($options['customtag']) ? $options['customtag'] : false; switch ($behavior) { case 'jquery': CjLibBehavior::jquery($custom_tag); break; case 'bootstrap': $load_bsjs = isset($options['loadjs']) ? $options['loadjs'] : true; $load_bscss = isset($options['loadcss']) ? $options['loadcss'] : true; $local_css = isset($options['localcss']) ? $options['localcss'] : false; CjLibBehavior::bootstrap($load_bsjs, $load_bscss, $local_css, $custom_tag); break; case 'bscore': CjLibBehavior::bscore($custom_tag); break; case 'fontawesome': CjLibBehavior::fontawesome($custom_tag); break; } }