From 5a4981c9f10a857a717b9a6e91ccdf3091af6f84 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 17 Jun 2013 16:44:46 -0700 Subject: [PATCH] Added 'bootstrap' as a e107::css() and e107::js() option. (subject to change) --- e107_handlers/e107_class.php | 10 ++++++++++ e107_themes/bootstrap/theme.php | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 06281eca1..f566af812 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -1610,6 +1610,11 @@ class e107 if(null !== $zone) $jshandler->requireCoreLib($data, $zone); else $jshandler->requireCoreLib($data); break; + + case 'bootstrap': //TODO Eventually add own method and render for bootstrap. + if(null !== $zone) $jshandler->requireCoreLib('bootstrap/js/'.$data, $zone); + else $jshandler->requireCoreLib('bootstrap/js/'.$data); + break; case 'theme': // data is e.g. 'jslib/mytheme.js' @@ -1677,6 +1682,11 @@ class e107 // data is path relative to e_FILE/jslib/ $jshandler->coreCSS($data, $media, $preComment, $postComment); break; + + case 'bootstrap': + // data is path relative to e_FILE/jslib/ + $jshandler->coreCSS('bootstrap/css/'.$data, $media, $preComment, $postComment); + break; case 'theme': // data is path relative to current theme diff --git a/e107_themes/bootstrap/theme.php b/e107_themes/bootstrap/theme.php index 718dd76f2..b0880640d 100644 --- a/e107_themes/bootstrap/theme.php +++ b/e107_themes/bootstrap/theme.php @@ -8,7 +8,7 @@ define("VIEWPORT", "width=device-width, initial-scale=1.0"); define("BODYTAG", ''); e107::lan('theme'); -e107::js('core','bootstrap/js/bootstrap.min.js'); +e107::js('bootstrap','bootstrap.min.js'); if(THEME_STYLE != 'style.css') // allow for drop-in bootstrap replacement. See http://bootswatch.com { @@ -16,11 +16,11 @@ if(THEME_STYLE != 'style.css') // allow for drop-in bootstrap replacement. See h } else { - e107::css('core','bootstrap/css/bootstrap.min.css'); + e107::css('bootstrap','bootstrap.min.css'); } -e107::css('core','bootstrap/css/bootstrap-responsive.min.css'); -e107::css('core','bootstrap/css/jquery-ui.custom.css'); +e107::css('bootstrap','bootstrap-responsive.min.css'); +e107::css('bootstrap','jquery-ui.custom.css'); e107::css('theme', 'js/google-code-prettify/prettify.css'); e107::js('theme', "js/google-code-prettify/prettify.js");