Header and Footr output is suppressed if it is an Ajax request

This commit is contained in:
ninadsp
2010-05-26 11:38:58 +05:30
parent 0a417e3c2a
commit 5ab3a60612
2 changed files with 147 additions and 136 deletions

View File

@@ -225,10 +225,16 @@ if (! empty($GLOBALS['cfg']['DBG']['php'])
*/ */
} }
/**
* If we are in an AJAX request, we do not need to generate the closing tags for
* body and html.
*/
if (! $GLOBALS['is_ajax_request']) {
?> ?>
</body> </body>
</html> </html>
<?php <?php
}
/** /**
* Stops the script execution * Stops the script execution
*/ */

View File

@@ -14,7 +14,11 @@ if (! defined('PHPMYADMIN')) {
*/ */
require_once './libraries/common.inc.php'; require_once './libraries/common.inc.php';
if (empty($GLOBALS['is_header_sent'])) { /**
* If this is an Ajax request, we do not need to generate all this output.
*/
if (!$GLOBALS['is_ajax_request']) {
if (empty($GLOBALS['is_header_sent'])) {
/** /**
* Gets a core script and starts output buffering work * Gets a core script and starts output buffering work
@@ -41,9 +45,9 @@ if (empty($GLOBALS['is_header_sent'])) {
/* ]]> */ /* ]]> */
</style> </style>
<![endif]--> <![endif]-->
</head> </head>
<body> <body>
<?php <?php
// Include possible custom headers // Include possible custom headers
@@ -170,5 +174,6 @@ if (empty($GLOBALS['is_header_sent'])) {
* Sets a variable to remember headers have been sent * Sets a variable to remember headers have been sent
*/ */
$GLOBALS['is_header_sent'] = true; $GLOBALS['is_header_sent'] = true;
} }
} //end if(!$GLOBALS['is_ajax_request'])
?> ?>