Translation update done using Pootle.
[phpmyadmin/ammaryasirr.git] / libraries / header_scripts.inc.php
blob056386882a2b719bc1736d165adade6db967b8dd
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 /**
14 require_once './libraries/common.inc.php';
17 // Cross-framing protection
18 if ( false === $GLOBALS['cfg']['AllowThirdPartyFraming']) {
19 echo PMA_includeJS('cross_framing_protection.js');
21 // generate title (unless we already have $page_title, from cookie auth)
22 if (! isset($page_title)) {
23 $title = PMA_expandUserString(
24 !empty($GLOBALS['table']) ? $GLOBALS['cfg']['TitleTable'] :
25 (!empty($GLOBALS['db']) ? $GLOBALS['cfg']['TitleDatabase'] :
26 (!empty($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['TitleServer'] :
27 $GLOBALS['cfg']['TitleDefault']))
29 } else {
30 $title = $page_title;
32 // here, the function does not exist with this configuration: $cfg['ServerDefault'] = 0;
33 $is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
35 $GLOBALS['js_include'][] = 'functions.js';
36 $GLOBALS['js_include'][] = 'jquery/jquery.qtip-1.0.0-rc3.js';
37 $params = array('lang' => $GLOBALS['lang']);
38 if (isset($GLOBALS['db'])) {
39 $params['db'] = $GLOBALS['db'];
41 $GLOBALS['js_include'][] = 'messages.php' . PMA_generate_common_url($params);
43 /**
44 * Here we add a timestamp when loading the file, so that users who
45 * upgrade phpMyAdmin are not stuck with older .js files in their
46 * browser cache. This produces an HTTP 304 request for each file.
49 // avoid loading twice a js file
50 $GLOBALS['js_include'] = array_unique($GLOBALS['js_include']);
51 foreach ($GLOBALS['js_include'] as $js_script_file) {
52 echo PMA_includeJS($js_script_file);
54 // Below javascript Updates the title of the frameset if possible
56 <script type="text/javascript">
57 // <![CDATA[
58 if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
59 && typeof(parent.document.title) == 'string') {
60 parent.document.title = '<?php echo PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))); ?>';
62 <?php
63 if(count($GLOBALS['js_script']) > 0) {
64 echo implode("\n",$GLOBALS['js_script'])."\n";
67 foreach ($GLOBALS['js_events'] as $js_event) {
68 echo "$(window.parent).bind('" . $js_event['event'] . "', "
69 . $js_event['function'] . ");\n";
72 // ]]>
73 </script>
74 <?php
75 // Reloads the navigation frame via JavaScript if required
76 PMA_reloadNavigation();