diff --git a/e107_admin/footer.php b/e107_admin/footer.php index d303c8e9d..76f6fe802 100644 --- a/e107_admin/footer.php +++ b/e107_admin/footer.php @@ -9,9 +9,9 @@ * Admin Footer * * $Source: /cvs_backup/e107_0.8/e107_admin/footer.php,v $ - * $Revision: 1.17 $ - * $Date: 2009-11-18 01:04:25 $ - * $Author: e107coders $ + * $Revision: 1.18 $ + * $Date: 2010-01-12 07:38:29 $ + * $Author: secretr $ */ if (!defined('e107_INIT')) { @@ -306,7 +306,63 @@ echo ""; // // I Send the buffered page data, along with appropriate headers // -$page = ob_get_clean(); + +// SecretR - EXPERIMENT! SEND CSS data to header. Performance tests in progress. +$tmp = array(); +$e_js = e107::getJs(); +// Other CSS - from unknown location, different from core/theme/plugin location or backward compatibility +$tmp1 = $e_js->renderJs('other_css', false, 'css', true); +if($tmp1) +{ + $tmp['search'][] = ''; + $tmp['replace'][] = $tmp1; +} + +// Core CSS +$tmp1 = $e_js->renderJs('core_css', false, 'css', true); +if($tmp1) +{ + $tmp['search'][] = ''; + $tmp['replace'][] = $tmp1; +} + + +// Plugin CSS +$tmp1 = $e_js->renderJs('plugin_css', false, 'css', true); +if($tmp1) +{ + $tmp['search'][] = ''; + $tmp['replace'][] = $tmp1; +} + +//echo "\n"; +$tmp1 = $e_js->renderJs('theme_css', false, 'css', true); +if($tmp1) +{ + $tmp['search'][] = ''; + $tmp['replace'][] = $tmp1; +} + +// Inline CSS - not sure if this should stay at all! +$tmp1 = $e_js->renderJs('inline_css', false, 'css', true); +if($tmp1) +{ + $tmp['search'][] = ''; + $tmp['replace'][] = $tmp1; +} + +if($tmp) +{ + $page = str_replace($tmp['search'], $tmp['replace'], ob_get_clean()); +} +else +{ + $page = ob_get_clean(); +} +unset($tmp1, $tmp1); + + + $etag = md5($page); header("Cache-Control: must-revalidate"); diff --git a/e107_admin/header.php b/e107_admin/header.php index 76531a5ef..d22365da6 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -9,8 +9,8 @@ * Admin Header * * $Source: /cvs_backup/e107_0.8/e107_admin/header.php,v $ - * $Revision: 1.55 $ - * $Date: 2009-11-28 15:32:47 $ + * $Revision: 1.56 $ + * $Date: 2010-01-12 07:38:29 $ * $Author: secretr $ */ @@ -37,8 +37,8 @@ $sql->db_Mark_Time('(Header Top)'); // A: Admin Defines and Links // B: Send HTTP headers that come before any html // C: Send start of HTML -// D: Send JS -// E: Send CSS +// D: Send CSS +// E: Send JS // F: Send Meta Tags and Icon links // G: Send final theme headers (theme_head() function) // H: Generate JS for image preloading (setup for onload) @@ -105,7 +105,105 @@ echo(defined("CORE_LC")) ? "\n"; + $e_js->otherCSS('{e_FILE}e107.css'); +} + + +if (!isset($no_core_css) || !$no_core_css) +{ + //echo "\n"; + $e_js->otherCSS('{e_FILE}e107.css'); +} +//NEW - Iframe mod +if (!defsettrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss']) +{ + $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? 'admin_'.$pref['admincss'] : $pref['admincss']; + //echo "\n"; + $e_js->themeCSS($css_file); +} +elseif (isset($pref['themecss']) && $pref['themecss']) +{ + $css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? 'admin_'.$pref['themecss'] : $pref['themecss']; + //echo "\n"; + $e_js->themeCSS($css_file); +} +else +{ + $css_file = file_exists(THEME.'admin_style.css') ? 'admin_style.css' : 'style.css'; + //echo "\n"; + $e_js->themeCSS($css_file); +} + +// FIXME: TEXTDIRECTION compatibility CSS (marj?) +// TODO: probably better to externalise along with some other things above +// possibility to overwrite some CSS definition according to TEXTDIRECTION +// especially usefull for rtl.css +// see _blank theme for examples +if(defined('TEXTDIRECTION') && file_exists(THEME.'/'.strtolower(TEXTDIRECTION).'.css')) +{ + //echo ' + //'; + $e_js->themeCSS(strtolower(TEXTDIRECTION).'.css'); +} + +// ################### RENDER CSS + +// Other CSS - from unknown location, different from core/theme/plugin location or backward compatibility +$e_js->renderJs('other_css', false, 'css', false); +echo "\n\n"; + +// Core CSS +$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"; + +// Inline CSS - not sure if this should stay at all! +$e_js->renderJs('inline_css', false, 'css', false); +echo "\n\n"; + + + +// +// Unobtrusive JS via CSS, prevent 3rd party code overload +// +require_once(e_FILE."/e_css.php"); + +//iepngfix - IE6 only +if ((isset($pref['enable_png_image_fix']) && $pref['enable_png_image_fix'] == true) || (isset($sleight) && $sleight == true)) +{ + /* + * The only problem is that the browser is REALLY, + * REALLY slow when it has to render more elements + * try e.g. "div, img, td, input" (or just *) instead only img rule + * However I hope this will force IE6 user to hate it :) + */ + echo "\n"; +} + +// +// E: Send JS // echo "\n"; @@ -166,59 +264,9 @@ function savepreset(ps,pid){ \n"; } -//iepngfix - IE6 only -if ((isset($pref['enable_png_image_fix']) && $pref['enable_png_image_fix'] == true) || (isset($sleight) && $sleight == true)) -{ - /* - * The only problem is that the browser is REALLY, - * REALLY slow when it has to render more elements - * try e.g. "div, img, td, input" (or just *) instead only img rule - * However I hope this will force IE6 user to hate it :) - */ - echo "\n"; -} -// -// E: Send CSS -// -echo "\n"; -if (isset($eplug_css) && $eplug_css) -{ - echo "\n\n"; - echo "\n"; -} - -echo "\n"; -if (!isset($no_core_css) || !$no_core_css) -{ - echo "\n"; -} -//NEW - Iframe mod -if (!defsettrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss'] && file_exists(THEME.$pref['admincss'])) -{ - $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? THEME_ABS.'admin_'.$pref['admincss'] : THEME_ABS.$pref['admincss']; - echo "\n"; -} -elseif (isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss'])) -{ - $css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? THEME_ABS.'admin_'.$pref['themecss'] : THEME_ABS.$pref['themecss']; - echo "\n"; - -} -else -{ - $css_file = file_exists(THEME.'admin_style.css') ? THEME_ABS.'admin_style.css' : THEME_ABS.'style.css'; - echo "\n"; -} - -// [JSManager] Load JS Includes - Zone 3 - After Theme CSS, before e_meta and headerjs() +// [JSManager] Load JS Includes - Zone 3 - before e_meta and headerjs() e107::getJs()->renderJs('header', 3); e107::getJs()->renderJs('header_inline', 3); @@ -279,21 +327,6 @@ if (function_exists('theme_head')) echo theme_head(); } -// FIXME: TEXTDIRECTION compatibility CSS (marj?) -// TODO: probably better to externalise along with some other things above -// possibility to overwrite some CSS definition according to TEXTDIRECTION -// especially usefull for rtl.css -// see _blank theme for examples -if(defined('TEXTDIRECTION') && file_exists(THEME.'/'.strtolower(TEXTDIRECTION).'.css')) -{ - echo ' - '; -} -// -// Unobtrusive JS, prevent 3rd party code overload -// -require_once(e_FILE."/e_css.php"); - // // H: Generate JS for image preloads [user mode only] // diff --git a/e107_handlers/calendar/calendar_class.php b/e107_handlers/calendar/calendar_class.php index 0b47b18cd..fcec03d19 100755 --- a/e107_handlers/calendar/calendar_class.php +++ b/e107_handlers/calendar/calendar_class.php @@ -7,9 +7,9 @@ * GNU General Public License (http://gnu.org). * * $Source: /cvs_backup/e107_0.8/e107_handlers/calendar/calendar_class.php,v $ - * $Revision: 1.4 $ - * $Date: 2009-11-18 01:49:18 $ - * $Author: marj_nl_fr $ + * $Revision: 1.5 $ + * $Date: 2010-01-12 07:38:29 $ + * $Author: secretr $ * */ @@ -82,7 +82,9 @@ class DHTML_Calendar } function load_files() { - return $this->get_load_files_code(); + //return $this->get_load_files_code(); + // JS and CSS are now sent on the fly - see make_input_field() + return ''; } function get_load_files_code() { @@ -107,7 +109,13 @@ class DHTML_Calendar $ret .= ' '; $ret .= "".$this->calendar_img.""; $options = array_merge($cal_options, array('inputField' => $this->_field_id($id), 'button' => $this->_trigger_id($id))); - e107::getJs()->footerInline($this->_make_calendar($options, false)); //FIXME - get_load_files_code() to use JS Manager + e107::getJs()->footerInline($this->_make_calendar($options, false)); + //JS manager to send JS to header if possible, if not - footer + e107::getJs() + ->tryHeaderFile($this->calendar_file) + ->tryHeaderFile($this->calendar_setup_file) + ->tryHeaderFile($this->calendar_lang_file) + ->otherCSS($this->calendar_theme_file); // send CSS to the site header return $ret; } diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 0bedf0245..4be9374d6 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -7,8 +7,8 @@ * GNU General Public License (http://gnu.org). * * $Source: /cvs_backup/e107_0.8/e107_handlers/js_manager.php,v $ - * $Revision: 1.10 $ - * $Date: 2010-01-09 18:40:15 $ + * $Revision: 1.11 $ + * $Date: 2010-01-12 07:38:28 $ * $Author: secretr $ * */ @@ -213,7 +213,7 @@ class e_jsmanager * @param string $media any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp * @return e_jsmanager */ - public function coreCSS($file_path, $media = 'screen') + public function coreCSS($file_path, $media = 'all') { $this->addJs('core_css', $file_path, $media); return $this; @@ -227,7 +227,7 @@ class e_jsmanager * @param string $media any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp * @return e_jsmanager */ - public function pluginCSS($plugname, $file_path, $media = 'screen') + public function pluginCSS($plugname, $file_path, $media = 'all') { if(is_array($file_path)) { @@ -248,7 +248,7 @@ class e_jsmanager * @param string $media any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp * @return e_jsmanager */ - protected function themeCSS($file_path, $media = 'screen') + public function themeCSS($file_path, $media = 'all') { $this->addJs('theme_css', $file_path, $media); return $this; @@ -261,7 +261,7 @@ class e_jsmanager * @param string $media any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp * @return e_jsmanager */ - public function otherCSS($file_path, $media = 'screen') + public function otherCSS($file_path, $media = 'all') { $this->addJs('other_css', $file_path, $media); return $this; @@ -274,7 +274,7 @@ class e_jsmanager * @param string $media (not implemented yet) any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp * @return e_jsmanager */ - public function inlineCSS($css_content, $media = 'screen') + public function inlineCSS($css_content, $media = 'all') { $this->addJs('inline_css', $css_content, $media); return $this; @@ -808,7 +808,7 @@ class e_jsmanager if('css' === $external) { $path = explode('|', $path, 2); - $media = $path[0]; + $media = $path[0] ? $path[0] : 'all'; $path = $path[1]; echo ''; echo "\n";