Welcome to mirror list, hosted at ThFree Co, Russian Federation.

footer.inc.php « libraries - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ead3e414410f2c5bf282cb8fb7b3388757b7472f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * finishes HTML output
 *
 * updates javascript variables in index.php for correct working with querywindow
 * and navigation frame refreshing
 *
 * send buffered data if buffered
 *
 * WARNING: This script has to be included at the very end of your code because
 *          it will stop the script execution!
 *
 * always use $GLOBALS, as this script is also included by functions
 *
 * @uses    $_REQUEST['no_history']
 * @uses    $GLOBALS['lang']
 * @uses    $GLOBALS['collation_connection']
 * @uses    $GLOBALS['server']
 * @uses    $GLOBALS['db']
 * @uses    $GLOBALS['table']
 * @uses    $GLOBALS['error_message']
 * @uses    $GLOBALS['reload']
 * @uses    $GLOBALS['sql_query']
 * @uses    $GLOBALS['focus_querywindow']
 * @uses    $GLOBALS['checked_special']
 * @uses    $GLOBALS['pmaThemeImage']
 * @uses    $GLOBALS['controllink'] to close it
 * @uses    $GLOBALS['userlink'] to close it
 * @uses    $cfg['Server']['user']
 * @uses    $cfg['NavigationBarIconic']
 * @uses    $cfg['DBG']['enable']
 * @uses    $cfg['DBG']['profile']['enable']
 * @uses    $GLOBALS['strOpenNewWindow']
 * @uses    $cfg['MaxCharactersInDisplayedSQL']
 * @uses    PMA_isValid()
 * @uses    PMA_setHistory()
 * @uses    PMA_ifSetOr()
 * @uses    PMA_escapeJsString()
 * @uses    PMA_getenv()
 * @uses    PMA_generate_common_url()
 * @uses    basename()
 * @uses    file_exists()
 * @version $Id$
 * @package phpMyAdmin
 */
if (! defined('PHPMYADMIN')) {
    exit;
}

/**
 * for PMA_setHistory()
 */
require_once './libraries/relation.lib.php';

if (! PMA_isValid($_REQUEST['no_history']) && empty($GLOBALS['error_message'])
 && ! empty($GLOBALS['sql_query'])) {
    PMA_setHistory(PMA_ifSetOr($GLOBALS['db'], ''),
        PMA_ifSetOr($GLOBALS['table'], ''),
        $GLOBALS['cfg']['Server']['user'],
        $GLOBALS['sql_query']);
}

if ($GLOBALS['error_handler']->hasDisplayErrors()) {
    echo '<div>';
    $GLOBALS['error_handler']->dispErrors();
    echo '</div>';
}

if (count($GLOBALS['footnotes'])) {
    echo '<div class="notice">';
    foreach ($GLOBALS['footnotes'] as $footnote) {
        echo '<span id="footnote_' . $footnote['nr'] . '"><sup>'
            . $footnote['nr'] . '</sup> ' . $footnote['note'] . '</span><br />';
    }
    echo '</div>';
}

if (! empty($_SESSION['debug'])) {
    $sum_time = 0;
    $sum_exec = 0;
    foreach ($_SESSION['debug']['queries'] as $query) {
        $sum_time += $query['count'] * $query['time'];
        $sum_exec += $query['count'];
    }

    echo '<div>';
    echo count($_SESSION['debug']['queries']) . ' queries executed'
        . $sum_exec . ' times in ' . $sum_time . ' seconds';
    echo '<pre>';
    print_r($_SESSION['debug']);
    echo '</pre>';
    echo '</div>';
    $_SESSION['debug'] = array();
}

?>
<script type="text/javascript">
//<![CDATA[
<?php
if (empty($GLOBALS['error_message'])) {
    ?>
// updates current settings
if (window.parent.setAll) {
    window.parent.setAll('<?php
        echo PMA_escapeJsString($GLOBALS['lang']) . "', '";
        echo PMA_escapeJsString($GLOBALS['collation_connection']) . "', '";
        echo PMA_escapeJsString($GLOBALS['server']) . "', '";
        echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['db'], '')) . "', '";
        echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['table'], '')) . "', '";
        echo PMA_escapeJsString($_SESSION[' PMA_token ']);?>');
}
    <?php
    if (! empty($GLOBALS['reload'])) {
        ?>
// refresh navigation frame content
if (window.parent.refreshNavigation) {
    window.parent.refreshNavigation();
}
        <?php
    }
    ?>
// set current db, table and sql query in the querywindow
if (window.parent.reload_querywindow) {
    window.parent.reload_querywindow(
        '<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['db'], '')) ?>',
        '<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['table'], '')) ?>',
        '<?php echo strlen($GLOBALS['sql_query']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] ? PMA_escapeJsString($GLOBALS['sql_query']) : ''; ?>');
}
    <?php
}

if (! empty($GLOBALS['focus_querywindow'])) {
    ?>
// set focus to the querywindow
if (parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) {
    self.focus();
}
    <?php
}
?>

if (window.parent.frame_content) {
    // reset content frame name, as querywindow needs to set a unique name
    // before submitting form data, and navigation frame needs the original name
    if (typeof(window.parent.frame_content.name) != 'undefined'
     && window.parent.frame_content.name != 'frame_content') {
        window.parent.frame_content.name = 'frame_content';
    }
    if (typeof(window.parent.frame_content.id) != 'undefined'
     && window.parent.frame_content.id != 'frame_content') {
        window.parent.frame_content.id = 'frame_content';
    }
    //window.parent.frame_content.setAttribute('name', 'frame_content');
    //window.parent.frame_content.setAttribute('id', 'frame_content');
}
//]]>
</script>
<?php

// Link to itself to replicate windows including frameset
if (!isset($GLOBALS['checked_special'])) {
    $GLOBALS['checked_special'] = false;
}

if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
    echo '<div id="selflink" class="print_ignore">' . "\n";
    $url_params['target'] = basename(PMA_getenv('SCRIPT_NAME'));
    echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
        . ' title="' . $GLOBALS['strOpenNewWindow'] . '" target="_blank">';
    /*
    echo '<a href="index.php?target=' . basename(PMA_getenv('SCRIPT_NAME'));
    $url = PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']);
    if (!empty($url)) {
        echo '&amp;' . $url;
    }
    echo '" target="_blank">';
    */
    if ($GLOBALS['cfg']['NavigationBarIconic']) {
        echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 'window-new.png"'
            . ' alt="' . $GLOBALS['strOpenNewWindow'] . '" />';
    }
    if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
        echo $GLOBALS['strOpenNewWindow'];
    }
    echo '</a>' . "\n";
    echo '</div>' . "\n";
}

// Include possible custom footers
if (file_exists('./config.footer.inc.php')) {
    require './config.footer.inc.php';
}


/**
 * Generates profiling data if requested
 */

// profiling deactivated due to licensing issues
if (! empty($GLOBALS['cfg']['DBG']['php'])
 && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) {
    //run the basic setup code first
    require_once './libraries/dbg/setup.php';
    //if the setup ran fine, then do the profiling
    /*
    if (! empty($GLOBALS['DBG'])) {
        require_once './libraries/dbg/profiling.php';
        dbg_dump_profiling_results();
    }
    */
}

?>
</body>
</html>
<?php
/**
 * Stops the script execution
 */
exit;
?>