1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-16 12:34:41 +01:00

Experimental CSS filtering.

This commit is contained in:
Cameron 2021-06-24 12:29:47 -07:00
parent d8f9a96dea
commit 00d584f584
2 changed files with 26 additions and 1 deletions
e107_core/templates
e107_handlers

@ -344,6 +344,11 @@ $e_js->renderLinks();
$CSSORDER = deftrue('CSSORDER') ? explode(",",CSSORDER) : array('library', 'other','core','plugin','theme','inline'); $CSSORDER = deftrue('CSSORDER') ? explode(",",CSSORDER) : array('library', 'other','core','plugin','theme','inline');
/** Experimental - Subject to removal at any time. Use at own risk */
if(method_exists('theme', 'css'))
{
$e_js->set('_theme_css_processor', true);
}
foreach($CSSORDER as $val) foreach($CSSORDER as $val)
{ {

@ -185,6 +185,8 @@ class e_jsmanager
protected $_sep = '#|#'; protected $_sep = '#|#';
protected $_theme_css_processor = false;
/** /**
* Constructor * Constructor
* *
@ -662,6 +664,11 @@ class e_jsmanager
{ {
$this->_dependence = null; $this->_dependence = null;
} }
public function set($name, $value)
{
$this->$name = $value;
}
/** /**
* Return TRUE if the library is disabled. ie. prototype or jquery. * Return TRUE if the library is disabled. ie. prototype or jquery.
@ -953,7 +960,7 @@ class e_jsmanager
// echo $this->_dependence." :: ENABLED<br />"; // echo $this->_dependence." :: ENABLED<br />";
// echo $this->_dependence."::".$file_path." : DISABLED<br />"; // echo $this->_dependence."::".$file_path." : DISABLED<br />";
// } // }
$tp = e107::getParser(); $tp = e107::getParser();
@ -1168,11 +1175,20 @@ class e_jsmanager
break; break;
case 'core_css': //e_jslib case 'core_css': //e_jslib
if($this->_theme_css_processor)
{
$this->_e_css['core'] = e107::callMethod('theme', 'css', $this->_e_css['core'], 'core');
e107::getMessage()->addDebug('Theme css() method is experimental and is subject to removal at any time. Use at own risk');
}
$this->renderFile(varset($this->_e_css['core'], array()), $external, 'Core CSS', $mod, false); $this->renderFile(varset($this->_e_css['core'], array()), $external, 'Core CSS', $mod, false);
unset($this->_e_css['core']); unset($this->_e_css['core']);
break; break;
case 'plugin_css': //e_jslib case 'plugin_css': //e_jslib
if($this->_theme_css_processor)
{
$this->_e_css['plugin'] = e107::callMethod('theme', 'css', $this->_e_css['plugin'], 'plugin');
}
$this->renderFile(varset($this->_e_css['plugin'], array()), $external, 'Plugin CSS', $mod, false); $this->renderFile(varset($this->_e_css['plugin'], array()), $external, 'Plugin CSS', $mod, false);
unset($this->_e_css['plugin']); unset($this->_e_css['plugin']);
break; break;
@ -1183,6 +1199,10 @@ class e_jsmanager
break; break;
case 'other_css': case 'other_css':
if($this->_theme_css_processor)
{
$this->_e_css['other'] = e107::callMethod('theme', 'css', $this->_e_css['other'], 'other');
}
$this->renderFile(varset($this->_e_css['other'], array()), $external, 'Other CSS', $mod, false); $this->renderFile(varset($this->_e_css['other'], array()), $external, 'Other CSS', $mod, false);
unset($this->_e_css['other']); unset($this->_e_css['other']);
break; break;