diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index 286fb31cc..869a3f546 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -172,6 +172,7 @@ echo "".(defined('e_PAGETITLE') ? e_PAGETITLE.' - ' : (defined('PAGE_NAME // D: Register CSS // $e_js = e107::getJs(); + $e_pref = e107::getConfig('core'); // Other Meta tags. @@ -315,7 +316,7 @@ else -$CSSORDER = deftrue('CSSORDER') ? explode(",",CSSORDER) : array('other','core','plugin','theme','inline'); +$CSSORDER = deftrue('CSSORDER') ? explode(",",CSSORDER) : array('library', 'other','core','plugin','theme','inline'); foreach($CSSORDER as $val) diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 1ee36df99..f44cf1e5f 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -358,6 +358,21 @@ class e_jsmanager return $this; } + /** + * Add CSS file(s) for inclusion in site header in the 'library' category. + * + * @param string|array $file_path path, shortcodes usage is prefered + * @param string $media any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp + * @return e_jsmanager + */ + public function libraryCSS($file_path, $media = 'all', $preComment = '', $postComment = '') + { + $this->addJs('library_css', $file_path, $media, $preComment, $postComment); + return $this; + } + + + /** * Add CSS file(s) for inclusion in site header * @@ -962,6 +977,13 @@ class e_jsmanager $runtime = true; break; + case 'library_css': + $file_path = $runtime_location.$this->_sep.$tp->createConstants($file_path, 'mix').$this->_sep.$pre.$this->_sep.$post; + if(!isset($this->_e_css['library'])) $this->_e_css['library'] = array(); + $registry = &$this->_e_css['library']; + $runtime = true; + break; + case 'inline_css': // no zones, TODO - media? $this->_e_css_src[] = $file_path; return $this; @@ -1129,6 +1151,11 @@ class e_jsmanager unset($this->_e_css['other']); break; + case 'library_css': + $this->renderFile(varset($this->_e_css['library'], array()), $external, 'Library CSS', $mod, false); + unset($this->_e_css['library']); + break; + case 'inline_css': $this->renderInline($this->_e_css_src, 'Inline CSS', 'css'); $this->_e_css_src = array(); diff --git a/e107_handlers/library_manager.php b/e107_handlers/library_manager.php index 57be5a1f0..8ff92d68a 100755 --- a/e107_handlers/library_manager.php +++ b/e107_handlers/library_manager.php @@ -300,7 +300,7 @@ class core_library ), 'css' => array( 'dist/css/bootstrap.min.css' => array( - 'zone' => 2, + 'zone' => 1, ), ), ), @@ -1724,7 +1724,8 @@ class e_library_manager } elseif($type == 'css') { - e107::css($options['type'], $data, null); + e107::getJs()->libraryCSS($data); // load before others. + // e107::css($options['type'], $data, null); } $count++; } diff --git a/e107_themes/bootstrap4/theme.php b/e107_themes/bootstrap4/theme.php index 1cf1cbb08..7439e1185 100644 --- a/e107_themes/bootstrap4/theme.php +++ b/e107_themes/bootstrap4/theme.php @@ -7,7 +7,7 @@ if ( ! defined('e107_INIT')) { exit(); } e107::meta('viewport', 'width=device-width, initial-scale=1.0'); //e107::meta('apple-mobile-web-app-capable','yes'); - +e107::css("url", "https://bootswatch.com/4/slate/bootstrap.min.css" ); $HEADER = array(); $FOOTER = array();