public function testPMA_includeJS() { $filename = "common.js"; $mod = 0; if (file_exists('./js/' . $filename)) { $mod = filemtime('./js/' . $filename); } else { $this->fail("JS file doesn't exists."); } $this->assertEquals(PMA_includeJS($filename), '<script src="./js/' . $filename . '?ts=' . $mod . '" type="text/javascript"></script>' . "\n"); $filename = '?file.js'; //$this->assertEquals(PMA_includeJS($filename), '<script src="./js/?file.js" type="text/javascript"></script>\n'); $this->assertEquals(PMA_includeJS($filename), '<script src="./js/' . $filename . '" type="text/javascript"></script>' . "\n"); //$this->assertFalse(PMA_includeJS(null)); }
$GLOBALS['js_include'][] = 'functions.js'; $GLOBALS['js_include'][] = 'jquery/jquery.qtip-1.0.0.min.js'; $params = array('lang' => $GLOBALS['lang']); if (isset($GLOBALS['db'])) { $params['db'] = $GLOBALS['db']; } $GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params); /** * Here we add a timestamp when loading the file, so that users who * upgrade phpMyAdmin are not stuck with older .js files in their * browser cache. This produces an HTTP 304 request for each file. */ // avoid loading twice a js file $GLOBALS['js_include'] = array_unique($GLOBALS['js_include']); foreach ($GLOBALS['js_include'] as $js_script_file) { echo PMA_includeJS($js_script_file); } ?> <script type="text/javascript"> // <![CDATA[ // Updates the title of the frameset if possible (ns4 does not allow this) if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown' && typeof(parent.document.title) == 'string') { parent.document.title = '<?php echo isset($title) ? PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))) : ''; ?> '; } <?php foreach ($GLOBALS['js_events'] as $js_event) {
if (onloadCnt == 0) { if (typeof(onLoadHandler) == "function") { onLoadHandler(); } if (typeof(getFrames) != 'undefined' && typeof(getFrames) == 'function') { getFrames(); } onloadCnt++; } }; // ]]> </script> <?php echo PMA_includeJS('jquery/jquery-1.6.2.js'); echo PMA_includeJS('update-location.js'); echo PMA_includeJS('common.js'); ?> </head> <frameset cols="<?php if ($GLOBALS['text_dir'] === 'rtl') { echo '*,'; } echo $GLOBALS['cfg']['NaviWidth']; if ($GLOBALS['text_dir'] === 'ltr') { echo ',*'; } ?> " rows="*" id="mainFrameset"> <?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
$GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params); // Append the theme id to this url to invalidate the cache on a theme change $GLOBALS['js_include'][] = 'get_image.js.php?theme=' . urlencode($_SESSION['PMA_Theme']->getId()); /** * Here we add a timestamp when loading the file, so that users who * upgrade phpMyAdmin are not stuck with older .js files in their * browser cache. This produces an HTTP 304 request for each file. */ // avoid loading twice a js file $GLOBALS['js_include'] = array_unique($GLOBALS['js_include']); foreach ($GLOBALS['js_include'] as $js_script_file) { $ie_conditional = false; if (is_array($js_script_file)) { list($js_script_file, $ie_conditional) = $js_script_file; } echo PMA_includeJS($js_script_file, $ie_conditional); } // Below javascript Updates the title of the frameset if possible ?> <script type="text/javascript"> // <![CDATA[ if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown' && typeof(parent.document.title) == 'string') { parent.document.title = '<?php echo isset($title) ? PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))) : ''; ?> '; } <?php if (count($GLOBALS['js_script']) > 0) { echo implode("\n", $GLOBALS['js_script']) . "\n";
href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?> &js_frame=left&nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?> " /> <?php echo PMA_includeJS('jquery/jquery-1.6.2.js'); echo PMA_includeJS('jquery/jquery-ui-1.8.16.custom.js'); echo PMA_includeJS('jquery/jquery.qtip-1.0.0-rc3.js'); echo PMA_includeJS('navigation.js'); echo PMA_includeJS('functions.js'); echo PMA_includeJS('messages.php'); // Append the theme id to this url to invalidate the cache on a theme change echo PMA_includeJS('get_image.js.php?theme=' . urlencode($_SESSION['PMA_Theme']->getId())); ?> <script type="text/javascript"> // <![CDATA[ // INIT PMA_setFrameSize var onloadCnt = 0; var onLoadHandler = window.onload; var resizeHandler = window.onresize; window.document.onresize = resizeHandler; window.onload = function() { if (onloadCnt == 0) { if (typeof(onLoadHandler) == "function") { onLoadHandler(); } if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') { PMA_setFrameSize();