From c7fc923736447f4d8d9caf404cb3a33344d16e22 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 4 Nov 2016 19:36:16 -0700 Subject: [PATCH] Load Plugin CSS after Theme CSS when in admin area. --- e107_admin/header.php | 8 +++++--- e107_handlers/js_manager.php | 8 ++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/e107_admin/header.php b/e107_admin/header.php index f6fede866..181580ddb 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -295,15 +295,17 @@ echo "\n\n"; $e_js->renderJs('core_css', false, 'css', false); echo "\n\n"; -// Plugin CSS -$e_js->renderJs('plugin_css', false, 'css', false); -echo "\n\n"; + // Theme CSS //echo "\n"; $e_js->renderJs('theme_css', false, 'css', false); echo "\n\n"; +// Plugin CSS +$e_js->renderJs('plugin_css', false, 'css', false); +echo "\n\n"; + // Inline CSS - not sure if this should stay at all! $e_js->renderJs('inline_css', false, 'css', false); echo "\n\n"; diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 5e1b99bd6..80ca39f52 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -991,11 +991,15 @@ class e_jsmanager break; case 'plugin_css': - $file_path = explode(':', $file_path); - $file_path = $runtime_location.$this->_sep.'{e_PLUGIN}'.$file_path[0].'/'.trim($file_path[1], '/').$this->_sep.$pre.$this->_sep.$post; + $pfile_path = explode(':', $file_path,2); + $plugfile_path = $runtime_location.$this->_sep.'{e_PLUGIN}'.$pfile_path[0].'/'.trim($pfile_path[1], '/').$this->_sep.$pre.$this->_sep.$post; + + // allow for URLs to be attributed to plugins. (loads after theme css in admin area header) + $file_path = ((strpos($pfile_path[1], 'http') !== 0 && strpos($pfile_path[1], '//') !== 0)) ? $plugfile_path : 'all'.$this->_sep.$pfile_path[1].$this->_sep.$pre.$this->_sep.$post;; if(!isset($this->_e_css['plugin'])) $this->_e_css['plugin'] = array(); $registry = &$this->_e_css['plugin']; $runtime = true; + break; case 'theme_css':