1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-19 14:04:44 +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

View File

@ -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)
{ {

View File

@ -185,6 +185,8 @@ class e_jsmanager
protected $_sep = '#|#'; protected $_sep = '#|#';
protected $_theme_css_processor = false;
/** /**
* Constructor * Constructor
* *
@ -663,6 +665,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.
* FIXME - remove $type & $loc * FIXME - remove $type & $loc
@ -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;