From: SourceForge.net <no...@so...> - 2012-04-16 02:53:32
|
Feature Requests item #3518308, was opened at 2012-04-15 19:53 Message generated for change (Tracker Item Submitted) made by beckmi You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430843&aid=3518308&group_id=41586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: XOOPS 2.6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Michael Beck (beckmi) Assigned to: MusS (forxoops) Summary: Use a file to set order of script and css loading in theme Initial Comment: From XavierS: http://xoops.org/modules/newbb/viewtopic.php?post_id=344695#forumpost344695 could you send this very small hack to the core team to correct a lot of pb about order script and css loading in theme ( i think, it's also an open way for switching to a mobile theme) Quote: /class/theme.php -------------------- function xoInit($options = array()){ ..... $GLOBALS['xoopsTpl'] =& $this->template; //to control order of loading JS and CSS if (file_exists($this->path ."/theme_onload.php")) include_once($this->path ."/theme_onload.php"); ------------- /themes/(thetheme)/theme_onload.php ------- <? global $xoTheme; $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/ui/jquery.ui.core.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/ui/jquery.ui.draggable.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/ui/jquery.ui.resizable.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.metadata.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/styleswitch.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.hoverIntent.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/mbTooltip.js'); $xoTheme->addStyleSheet('xoops.css'); $xoTheme->addStyleSheet('css/smoothness/jquery-ui-1.8.5.custom.css'); $xoTheme->addStyleSheet('css/style.css'); $xoTheme->addScript('browse.php?Frameworks/jquery/mbMenu.js'); $xoTheme->addStyleSheet('css/menu_style.css'); // by the way we can charge some script only for 1 module if ($GLOBALS['xoopsModule']->getVar('dirname')=="newbb"){ $xoTheme->addScript('browse.php?Frameworks/jquery/mbContainer.js'); $xoTheme->addStyleSheet('css/menu_red.css'); $xoTheme->addStyleSheet('css/mbContainer.css'); } ?> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430843&aid=3518308&group_id=41586 |