Permalink
Browse files

Finished integrating the PMA_Footer class

  • Loading branch information...
1 parent 234480c commit d9bedbd75e3894e937a6f2974082867c9e4a7b21 @roccivic roccivic committed Jun 1, 2012
View
3 browse_foreigners.php
@@ -322,6 +322,3 @@ function formupdate(fieldmd5, key) {
?>
</tbody>
</table>
-
-</body>
-</html>
View
5 index.php
@@ -73,7 +73,10 @@
// start output
$response = PMA_Response::getInstance();
-$response->getHeader()->sendHttpHeaders();
+$header = $response->getHeader();
+$header->sendHttpHeaders();
+$response->disable();
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
View
1 libraries/Error_Handler.class.php
@@ -239,6 +239,7 @@ public function getDispUserErrors()
*/
protected function dispPageStart($error = null)
{
+ PMA_Response::getInstance()->disable();
echo '<html><head><title>';
if ($error) {
echo $error->getTitle();
View
20 libraries/Header.class.php
@@ -84,6 +84,13 @@ class PMA_Header
*/
private $_isAjax;
/**
+ * Whether to display anything
+ *
+ * @access private
+ * @var bool
+ */
+ private $_isEnabled;
+ /**
* Whether the HTTP headers (and possibly some HTML)
* have already been sent to the browser
*
@@ -100,6 +107,7 @@ class PMA_Header
*/
public function __construct()
{
+ $this->_isEnabled = true;
$this->_isAjax = false;
$this->_bodyId = '';
$this->_title = 'phpMyAdmin';
@@ -200,6 +208,16 @@ private function _addDefaultScripts()
*
* @return
*/
+ public function disable()
+ {
+ $this->_isEnabled = false;
+ }
+
+ /**
+ *
+ *
+ * @return
+ */
public function isAjax($isAjax)
{
$this->_isAjax = $isAjax;
@@ -281,7 +299,7 @@ public function getDisplay()
$retval = '';
if (! self::$headerIsSent) {
$this->sendHttpHeaders();
- if (! $this->_isAjax) {
+ if (! $this->_isAjax && $this->_isEnabled) {
$retval .= $this->_getHtmlStart();
$retval .= $this->_getMetaTags();
$retval .= $this->_getLinkTags();
View
6 libraries/Response.class.php
@@ -77,6 +77,12 @@ public static function getInstance()
return self::$_instance;
}
+ public function disable()
+ {
+ $this->_header->disable();
+ $this->_footer->disable();
+ }
+
public function getHeader()
{
return $this->_header;
View
3 libraries/auth/config.auth.lib.php
@@ -75,6 +75,7 @@ function PMA_auth_fails()
/* HTML header */
$GLOBALS['page_title'] = __('Access denied');
$response = PMA_Response::getInstance();
+ $response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setTitle(__('Access denied'));
$header->disableMenu();
@@ -129,7 +130,7 @@ function PMA_auth_fails()
echo '</tr>' . "\n";
}
echo '</table>' . "\n";
- include './libraries/footer.inc.php';
+ exit;
return true;
} // end of the 'PMA_auth_fails()' function
View
3 libraries/auth/cookie.auth.lib.php
@@ -156,6 +156,7 @@ function PMA_auth()
$GLOBALS['page_title'] = 'phpMyAdmin';
$response = PMA_Response::getInstance();
+ $response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setBodyId('loginform');
$header->disableMenu();
@@ -304,8 +305,6 @@ function PMA_auth()
}
//]]>
</script>
-</body>
-</html>
<?php
exit;
} // end of the 'PMA_auth()' function
View
7 libraries/auth/http.auth.lib.php
@@ -51,6 +51,7 @@ function PMA_auth()
/* HTML header */
$GLOBALS['page_title'] = __('Access denied');
$response = PMA_Response::getInstance();
+ $response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setTitle(__('Access denied'));
$header->disableMenu();
@@ -69,12 +70,8 @@ function PMA_auth()
if (file_exists(CUSTOM_FOOTER_FILE)) {
include CUSTOM_FOOTER_FILE;
}
- ?>
-</body>
-</html>
- <?php
- exit();
+ exit;
} // end of the 'PMA_auth()' function
View
1 libraries/core.lib.php
@@ -515,6 +515,7 @@ function PMA_sendHeaderLocation($uri, $use_refresh = false)
{
if (PMA_IS_IIS && strlen($uri) > 600) {
include_once './libraries/js_escape.lib.php';
+ PMA_Response::getInstance()->disable();
echo '<html><head><title>- - -</title>' . "\n";
echo '<meta http-equiv="expires" content="0">' . "\n";
View
5 libraries/error.inc.php
@@ -10,9 +10,12 @@
exit;
}
-if (!defined('TESTSUITE')) {
+if (! defined('TESTSUITE')) {
header('Content-Type: text/html; charset=utf-8');
}
+
+PMA_Response::getInstance()->disable();
+
?>
<!DOCTYPE HTML>
<html lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>">
View
2 navigation.php
@@ -19,7 +19,6 @@
*/
function PMA_exitNavigationFrame()
{
- echo '</body></html>';
exit;
}
@@ -77,6 +76,7 @@ function PMA_exitNavigationFrame()
$cfgRelation = PMA_getRelationsParam();
$response = PMA_Response::getInstance();
+$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenu();
$header->setBodyId('body_leftFrame');
View
3 pmd_general.php
@@ -40,6 +40,7 @@
}
$response = PMA_Response::getInstance();
+$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setBodyId('pmd_body');
$scripts = $header->getScripts();
@@ -858,5 +859,3 @@ class="M_butt" target="_self">';
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png'); ?>" width="0" height="0" alt="" />
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath('pmd/uparrow2_m.png'); ?>" width="0" height="0" alt="" />
<div id="PMA_disable_floating_menubar"></div>
-</body>
-</html>
View
3 pmd_pdf.php
@@ -78,6 +78,7 @@
}
$response = PMA_Response::getInstance();
+$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenu();
$header->display();
@@ -145,6 +146,4 @@
</div>
</form>
</div>
-</body>
-</html>
View
3 querywindow.php
@@ -113,6 +113,7 @@
* prepare JavaScript functionality
*/
$response = PMA_Response::getInstance();
+$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenu();
$header->setBodyId('bodyquerywindow');
@@ -201,5 +202,3 @@
<input type="hidden" name="querydisplay_tab" value="<?php echo $querydisplay_tab; ?>" />
</form>
</div>
-</body>
-</html>

0 comments on commit d9bedbd

Please sign in to comment.