1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 17:14:42 +02:00

Added THEME_STYLE constant for easy checking of the currently selected theme style. CSSORDER also added, but subject to change.

This commit is contained in:
Cameron
2013-06-17 15:40:39 -07:00
parent bebbaa0533
commit 59047796d1
5 changed files with 49 additions and 7 deletions

View File

@@ -1092,6 +1092,15 @@ if(!defined("THEME_LAYOUT"))
}
*/
if(varset($pref['themecss']) && file_exists(THEME.$pref['themecss']))
{
define("THEME_STYLE", $pref['themecss']);
}
else
{
define("THEME_STYLE", 'style.css');
}
if($def) // custom-page layout.
{
define("THEME_LAYOUT",$def);

View File

@@ -251,6 +251,10 @@ else
else
{
// Theme default
$e_js->themeCSS(THEME_STYLE, $css_default);
/* Moved to class2 and defined as THEME_STYLE
if($e_pref->get('themecss') && file_exists(THEME.$e_pref->get('themecss')))
{
//echo "<link rel='stylesheet' href='".THEME_ABS."{$pref['themecss']}' type='text/css' media='{$css_default}' />\n";
@@ -258,10 +262,10 @@ else
}
else
{
echo "<link rel='stylesheet' href='".THEME_ABS."style.css' type='text/css' media='{$css_default}' />\n";
// echo "<link rel='stylesheet' href='".THEME_ABS."style.css' type='text/css' media='{$css_default}' />\n";
$e_js->themeCSS('style.css', $css_default);
}
*/
// Support for print and handheld media - override theme default CSS
if(file_exists(THEME."style_mobile.css"))
{
@@ -297,6 +301,20 @@ else
//
// Other CSS - from unknown location, different from core/theme/plugin location or backward compatibility; NOTE - could be removed in the future!!!
//TODO Additional options for 'bootstrap' and 'style' (ie. THEME_STYLE loaded above). Requires changes to js_manager.php
$CSSORDER = deftrue('CSSORDER') ? explode(",",CSSORDER) : array('other','core','plugin','theme','inline');
foreach($CSSORDER as $val)
{
$cssId = $val."_css";
$e_js->renderJs($cssId, false, 'css', false);
}
unset($CSSORDER);
/*
$e_js->renderJs('other_css', false, 'css', false);
echo "\n<!-- footer_other_css -->\n";
@@ -313,9 +331,12 @@ echo "\n<!-- footer_plugin_css -->\n";
$e_js->renderJs('theme_css', false, 'css', false);
echo "\n<!-- footer_theme_css -->\n";
// Inline CSS - not sure if this should stay at all!
$e_js->renderJs('inline_css', false, 'css', false);
echo "\n<!-- footer_inline_css -->\n";
*/
//
// Style for unobtrusive JS, prevent 3rd party code overload

View File

@@ -519,7 +519,7 @@ class e107_db_debug {
$inc = array(
'HEADERF','FOOTERF','FILE_UPLOADS','FLOODPROTECT','FLOODTIMEOUT','CHARSET',
'GUESTS_ONLINE','MEMBERS_ONLINE','PAGE_NAME','STANDARDS_MODE','TIMEOFFSET',
'TOTAL_ONLINE','THEME','THEME_ABS','THEME_LAYOUT','META_OG','META_DESCRIPTION','MPREFIX'
'TOTAL_ONLINE','THEME','THEME_ABS','THEME_LAYOUT','THEME_STYLE','META_OG','META_DESCRIPTION','MPREFIX','VIEWPORT','BODYTAG','CSSORDER'
);
$userCon = get_defined_constants(true);

View File

@@ -222,7 +222,7 @@ class themeHandler
$reject = array('e_.*');
$handle2 = e107::getFile()->get_files(e_THEME.$file."/", ".php|.css|.xml|preview.jpg|preview.png", $reject, 1);
$handle2 = e107::getFile()->get_files(e_THEME.$file."/", ".php|.css|.xml|preview.jpg|preview.png", $reject, 0);
foreach ($handle2 as $fln)
@@ -1337,7 +1337,7 @@ class themeHandler
if($mode == 1) // SITE-THEME Mode
{
if(substr($css['name'], 0, 6) == "admin_" || !strstr($css['name'],'style'))
if(substr($css['name'], 0, 6) == "admin_")
{
continue;
}

View File

@@ -9,12 +9,23 @@ define("BODYTAG", '<body data-spy="scroll" data-target=".bs-docs-sidebar" >');
e107::lan('theme');
e107::js('core','bootstrap/js/bootstrap.min.js');
e107::css('core','bootstrap/css/bootstrap.min.css');
if(THEME_STYLE != 'style.css') // allow for drop-in bootstrap replacement. See http://bootswatch.com
{
define("CSSORDER", "theme,core,other,plugin,inline");
}
else
{
e107::css('core','bootstrap/css/bootstrap.min.css');
}
e107::css('core','bootstrap/css/bootstrap-responsive.min.css');
e107::css('core','bootstrap/css/jquery-ui.custom.css');
e107::css('theme', 'js/google-code-prettify/prettify.css');
e107::js('theme', "js/google-code-prettify/prettify.js");
e107::js('theme', "js/google-code-prettify/prettify.js");
e107::css('inline','@media (min-width: 1000px){ body { padding-top: 75px; } } ');
if(THEME_LAYOUT == 'docs')
{
@@ -25,6 +36,7 @@ if(THEME_LAYOUT == 'docs')
}
//$no_core_css = TRUE;
//define("STANDARDS_MODE",TRUE);