}
}
- // }}}
- // {{{ scriptsCompare()
-
- /**
- * make sure jquery lib is loaded first
- *
- * @param string $i script 1 to compare against script 2 ($j)
- * @param string $j script 2 to compare against script 1 ($i)
- *
- * @return integer result of comparison
- * @access public
- * @static
- */
- public static function scriptsCompare($i, $j)
- {
- if ($i == GLM_APP_BASE_URL . 'libjs/jquery-1.3.2.min.js') {
- return -1;
- } elseif ($j == GLM_APP_BASE_URL . 'libjs/jquery-1.3.2.min.js') {
- return 1;
- } else {
- return 0;
- }
- }
-
// }}}
// {{{ getScripts()
}
$uniqueScripts = array_unique($GLOBALS['scripts']);
- usort($uniqueScripts, array(self, 'scriptsCompare'));
+ // Get the main jquery file
+ $jquery = GLM_APP_BASE_URL . 'libjs/jquery-1.3.2.min.js';
+ $key = array_search($jquery, $uniqueScripts);
+ // If it exists, remove it from its current location
+ // and put at front of array.
+ if ($key !== false) {
+ unset($uniqueScripts[$key]);
+ array_unshift($uniqueScripts, $jquery);
+ }
$format = '<script type="text/javascript" src="%s"></script>';
$ret = '';