Permalink
Browse files

PMA_Footer and PMA_Header no longer need to be singletons

  • Loading branch information...
1 parent c2ae2ae commit a05456210029c8ba09db1eb765bcb116c449c746 @roccivic roccivic committed Jun 1, 2012
Showing with 206 additions and 137 deletions.
  1. +2 −1 browse_foreigners.php
  2. +3 −1 db_events.php
  3. +3 −1 db_export.php
  4. +3 −1 db_import.php
  5. +3 −1 db_operations.php
  6. +2 −1 db_printview.php
  7. +3 −1 db_routines.php
  8. +3 −1 db_search.php
  9. +3 −1 db_sql.php
  10. +3 −1 db_structure.php
  11. +3 −1 db_tracking.php
  12. +3 −1 db_triggers.php
  13. +2 −1 export.php
  14. +2 −1 import.php
  15. +2 −1 index.php
  16. +2 −24 libraries/Footer.class.php
  17. +2 −23 libraries/Header.class.php
  18. +2 −1 libraries/PDF.class.php
  19. +4 −4 libraries/Response.class.php
  20. +3 −2 libraries/auth/config.auth.lib.php
  21. +2 −1 libraries/auth/cookie.auth.lib.php
  22. +2 −1 libraries/auth/http.auth.lib.php
  23. +4 −2 libraries/common.lib.php
  24. +6 −3 libraries/core.lib.php
  25. +2 −1 libraries/db_common.inc.php
  26. +3 −1 libraries/insert_edit.lib.php
  27. +2 −1 libraries/schema/Export_Relation_Schema.class.php
  28. +2 −1 libraries/server_common.inc.php
  29. +2 −1 libraries/tbl_common.inc.php
  30. +2 −1 main.php
  31. +2 −1 navigation.php
  32. +2 −2 pmd_general.php
  33. +2 −1 pmd_pdf.php
  34. +5 −2 prefs_forms.php
  35. +6 −3 prefs_manage.php
  36. +2 −1 querywindow.php
  37. +3 −2 server_databases.php
  38. +3 −1 server_export.php
  39. +3 −1 server_import.php
  40. +3 −1 server_plugins.php
  41. +3 −1 server_privileges.php
  42. +3 −1 server_replication.php
  43. +3 −1 server_sql.php
  44. +4 −3 server_status.php
  45. +3 −1 server_synchronize.php
  46. +3 −1 server_variables.php
  47. +2 −1 setup/index.php
  48. +20 −8 sql.php
  49. +2 −1 tbl_addfield.php
  50. +4 −2 tbl_change.php
  51. +3 −1 tbl_chart.php
  52. +2 −1 tbl_create.php
  53. +3 −1 tbl_export.php
  54. +3 −1 tbl_gis_visualization.php
  55. +3 −1 tbl_import.php
  56. +3 −1 tbl_indexes.php
  57. +2 −1 tbl_printview.php
  58. +3 −1 tbl_relation.php
  59. +3 −1 tbl_replace.php
  60. +3 −1 tbl_select.php
  61. +3 −1 tbl_sql.php
  62. +3 −1 tbl_structure.php
  63. +3 −1 tbl_zoom_select.php
  64. +2 −2 themes.php
  65. +2 −1 transformation_overview.php
  66. +2 −1 transformation_wrapper.php
  67. +5 −3 user_password.php
View
3 browse_foreigners.php
@@ -13,7 +13,8 @@
PMA_checkParameters(array('db', 'table', 'field'));
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->disableMenu();
$header->setBodyId('body_browse_foreigners');
View
4 db_events.php
@@ -15,7 +15,9 @@
/**
* Include JavaScript libraries
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('jquery/timepicker.js');
$scripts->addFile('rte/common.js');
$scripts->addFile('rte/events.js');
View
4 db_export.php
@@ -11,7 +11,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('export.js');
// $sub_part is also used in db_info.inc.php to see if we are coming from
View
4 db_import.php
@@ -10,7 +10,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('import.js');
/**
View
4 db_operations.php
@@ -19,7 +19,9 @@
require_once 'libraries/mysql_charsets.lib.php';
// add a javascript file for jQuery functions to handle Ajax actions
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('db_operations.js');
/**
View
3 db_printview.php
@@ -10,7 +10,8 @@
*/
require_once 'libraries/common.inc.php';
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->enablePrintView();
$header->display();
View
4 db_routines.php
@@ -16,7 +16,9 @@
/**
* Include JavaScript libraries
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('jquery/timepicker.js');
$scripts->addFile('rte/common.js');
$scripts->addFile('rte/routines.js');
View
4 db_search.php
@@ -13,7 +13,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('db_search.js');
$scripts->addFile('sql.js');
$scripts->addFile('makegrid.js');
View
4 db_sql.php
@@ -13,7 +13,9 @@
/**
* Runs common work
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('functions.js');
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
View
4 db_structure.php
@@ -10,7 +10,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('db_structure.js');
$scripts->addFile('tbl_change.js');
$scripts->addFile('jquery/timepicker.js');
View
4 db_tracking.php
@@ -10,7 +10,9 @@
require_once 'libraries/common.inc.php';
//Get some js files needed for Ajax requests
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('db_structure.js');
/**
View
4 db_triggers.php
@@ -14,7 +14,9 @@
/**
* Include JavaScript libraries
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('rte/common.js');
$scripts->addFile('rte/triggers.js');
View
3 export.php
@@ -407,7 +407,8 @@ function PMA_exportOutputHandler($line)
}
}
$backup_cfgServer = $cfg['Server'];
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
$cfg['Server'] = $backup_cfgServer;
unset($backup_cfgServer);
echo "\n" . '<div style="text-align: ' . $cell_align_left . '">' . "\n";
View
3 import.php
@@ -83,7 +83,8 @@
// upload limit has been reached, let's assume the second possibility.
;
if ($_POST == array() && $_GET == array()) {
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
$message = PMA_Message::error(__('You probably tried to upload too large file. Please refer to %sdocumentation%s for ways to workaround this limit.'));
$message->addParam('[a@./Documentation.html#faq1_16@_blank]');
$message->addParam('[/a]');
View
3 index.php
@@ -72,7 +72,8 @@
// start output
-PMA_Header::getInstance()->sendHttpHeaders();
+$response = PMA_Response::getInstance();
+$response->getHeader()->sendHttpHeaders();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
View
26 libraries/Footer.class.php
@@ -12,22 +12,13 @@
require_once 'libraries/Footnotes.class.php';
/**
- * Singleton class used to output the footer
+ * Class used to output the footer
*
* @package PhpMyAdmin
*/
class PMA_Footer
{
/**
- * PMA_Footer instance
- *
- * @access private
- * @static
- * @var object
- */
- private static $_instance;
-
- /**
* PMA_Footnotes instance
*
* @access private
@@ -48,7 +39,7 @@ class PMA_Footer
*
* @return new PMA_Footer object
*/
- private function __construct()
+ public function __construct()
{
$this->_footnotes = new PMA_Footnotes();
$this->_scripts = new PMA_Scripts();
@@ -236,19 +227,6 @@ private function _setHistory()
}
/**
- * Returns the singleton PMA_Footer object
- *
- * @return PMA_Footer object
- */
- public static function getInstance()
- {
- if (empty(self::$_instance)) {
- self::$_instance = new PMA_Footer();
- }
- return self::$_instance;
- }
-
- /**
* Returns the PMA_Footnotes object
*
* @return PMA_Footnotes object
View
25 libraries/Header.class.php
@@ -20,21 +20,13 @@
$is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
/**
- * Singleton class used to output the HTTP and HTML headers
+ * Class used to output the HTTP and HTML headers
*
* @package PhpMyAdmin
*/
class PMA_Header
{
/**
- * PMA_Header instance
- *
- * @access private
- * @static
- * @var object
- */
- private static $_instance;
- /**
* PMA_Scripts instance
*
* @access private
@@ -107,7 +99,7 @@ class PMA_Header
*
* @return new PMA_Header object
*/
- private function __construct()
+ public function __construct()
{
$this->_isAjax = false;
if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
@@ -208,19 +200,6 @@ private function _addDefaultScripts()
}
/**
- * Returns the singleton PMA_Header object
- *
- * @return PMA_Header object
- */
- public static function getInstance()
- {
- if (empty(self::$_instance)) {
- self::$_instance = new PMA_Header();
- }
- return self::$_instance;
- }
-
- /**
* Returns the PMA_Scripts object
*
* @return PMA_Scripts object
View
3 libraries/PDF.class.php
@@ -85,7 +85,8 @@ function _putpages()
*/
function Error($error_message = '')
{
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
PMA_Message::error(__('Error while creating PDF:') . ' ' . $error_message)->display();
include './libraries/footer.inc.php';
}
View
8 libraries/Response.class.php
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
- *
+ * Manages the rendering of pages in PMA
*
* @package PhpMyAdmin
*/
@@ -13,7 +13,7 @@
require_once 'libraries/Footer.class.php';
/**
- *
+ * Singleton class used to manage the rendering of pages in PMA
*
* @package PhpMyAdmin
*/
@@ -40,9 +40,9 @@ class PMA_Response
private function __construct()
{
$this->_data = array();
- $this->_header = PMA_Header::getInstance();
+ $this->_header = new PMA_Header();
$this->_content = '';
- $this->_footer = PMA_Footer::getInstance();
+ $this->_footer = new PMA_Footer();
}
/**
View
5 libraries/auth/config.auth.lib.php
@@ -74,7 +74,8 @@ function PMA_auth_fails()
/* HTML header */
$GLOBALS['page_title'] = __('Access denied');
- $header = PMA_Header::getInstance();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
$header->setTitle(__('Access denied'));
$header->disableMenu();
$header->display();
@@ -90,7 +91,7 @@ function PMA_auth_fails()
<td>
<?php
- PMA_Header::getInstance()->isHeaderSent = true;
+ PMA_Header::$headerIsSent = true;
if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
trigger_error(__('Access denied'), E_USER_NOTICE);
View
3 libraries/auth/cookie.auth.lib.php
@@ -155,7 +155,8 @@ function PMA_auth()
$cell_align = ($GLOBALS['text_dir'] == 'ltr') ? 'left' : 'right';
$GLOBALS['page_title'] = 'phpMyAdmin';
- $header = PMA_Header::getInstance();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
$header->setBodyId('loginform');
$header->disableMenu();
$header->display();
View
3 libraries/auth/http.auth.lib.php
@@ -50,7 +50,8 @@ function PMA_auth()
/* HTML header */
$GLOBALS['page_title'] = __('Access denied');
- $header = PMA_Header::getInstance();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
$header->setTitle(__('Access denied'));
$header->disableMenu();
$header->display();
View
6 libraries/common.lib.php
@@ -540,7 +540,8 @@ function PMA_showPHPDocu($target)
*/
function PMA_showHint($message, $bbcode = false)
{
- $footnotes = PMA_Footer::getInstance()->getFootnotes();
+ $response = PMA_Response::getInstance();
+ $footnotes = $response->getFooter()->getFootnotes();
return $footnotes->add($message, $bbcode);
}
@@ -569,7 +570,8 @@ function PMA_mysqlDie(
/**
* start http output, display html headers
*/
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
$error_msg = '';
View
9 libraries/core.lib.php
@@ -774,7 +774,7 @@ function PMA_includeJS($url, $ie_conditional = false)
}
/**
- * Adds JS code snippets to be displayed by the PMA_Header class.
+ * Adds JS code snippets to be displayed by the PMA_Response class.
* Adds a newline to each snippet.
*
* @param string $str Js code to be added (e.g. "token=1234;")
@@ -783,12 +783,15 @@ function PMA_includeJS($url, $ie_conditional = false)
*/
function PMA_addJSCode($str)
{
- PMA_Header::getInstance()->getScripts()->addCode($str);
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
+ $scripts = $header->getScripts();
+ $scripts->addCode($str);
}
/**
* Adds JS code snippet for variable assignment
- * to be displayed by the PMA_Header class.
+ * to be displayed by the PMA_Response class.
*
* @param string $key Name of value to set
* @param mixed $value Value to set, can be either string or array of strings
View
3 libraries/db_common.inc.php
@@ -79,7 +79,8 @@
/**
* Displays headers
*/
-PMA_Header::getInstance()->display();
+$response = PMA_Response::getInstance();
+$response->getHeader()->display();
/**
* Set parameters for links
View
4 libraries/insert_edit.lib.php
@@ -1551,7 +1551,9 @@ function PMA_isInsertRow()
&& $_REQUEST['insert_rows'] != $GLOBALS['cfg']['InsertRows']
) {
$GLOBALS['cfg']['InsertRows'] = $_REQUEST['insert_rows'];
- $scripts = PMA_Header::getInstance()->getScripts();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
+ $scripts = $header->getScripts();
$scripts->addFile('tbl_change.js');
include 'tbl_change.php';
exit;
View
3 libraries/schema/Export_Relation_Schema.class.php
@@ -226,7 +226,8 @@ function dieSchema($pageNumber, $type = '', $error_message = '')
{
global $db;
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
echo "<p><strong>" . __("SCHEMA ERROR: ") . $type . "</strong></p>" . "\n";
if (!empty($error_message)) {
$error_message = htmlspecialchars($error_message);
View
3 libraries/server_common.inc.php
@@ -30,7 +30,8 @@
/**
* Displays headers
*/
-PMA_Header::getInstance()->display();
+$response = PMA_Response::getInstance();
+$response->getHeader()->display();
/**
* @global boolean Checks for superuser privileges
View
3 libraries/tbl_common.inc.php
@@ -48,7 +48,8 @@
/**
* Displays headers
*/
-PMA_Header::getInstance()->display();
+$response = PMA_Response::getInstance();
+$response->getHeader()->display();
if (PMA_Tracker::isActive()
&& PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])
View
3 main.php
@@ -26,7 +26,8 @@
$GLOBALS['db'] = '';
$GLOBALS['table'] = '';
$show_query = '1';
-PMA_Header::getInstance()->display();
+$response = PMA_Response::getInstance();
+$response->getHeader()->display();
// Any message to display?
if (! empty($message)) {
View
3 navigation.php
@@ -83,7 +83,8 @@ function PMA_exitNavigationFrame()
*/
$cfgRelation = PMA_getRelationsParam();
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->disableMenu();
$header->setBodyId('body_leftFrame');
$scripts = $header->getScripts();
View
4 pmd_general.php
@@ -39,8 +39,8 @@
$params['db'] = $GLOBALS['db'];
}
-
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->setBodyId('pmd_body');
$scripts = $header->getScripts();
$scripts->addFile('pmd/ajax.js');
View
3 pmd_pdf.php
@@ -77,7 +77,8 @@
}
}
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->disableMenu();
$header->display();
View
7 prefs_forms.php
@@ -69,9 +69,12 @@
}
// display forms
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('config.js');
-PMA_Header::getInstance()->display();
+$header->display();
+
require 'libraries/user_preferences.inc.php';
if ($error) {
$error->display();
View
9 prefs_manage.php
@@ -109,7 +109,8 @@
}
if (!$all_ok) {
// mimic original form and post json in a hidden field
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
include 'libraries/user_preferences.inc.php';
$msg = PMA_Message::error(__('Configuration contains incorrect data for some fields.'));
$msg->display();
@@ -216,9 +217,11 @@
exit;
}
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('config.js');
-PMA_Header::getInstance()->display();
+$header->display();
require 'libraries/user_preferences.inc.php';
if ($error) {
if (!$error instanceof PMA_Message) {
View
3 querywindow.php
@@ -118,7 +118,8 @@
/**
* prepare JavaScript functionality
*/
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->disableMenu();
$header->setBodyId('bodyquerywindow');
$scripts = $header->getScripts();
View
5 server_databases.php
@@ -9,8 +9,9 @@
* Does the common work
*/
require_once 'libraries/common.inc.php';
-
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('server_databases.js');
require 'libraries/server_common.inc.php';
View
4 server_export.php
@@ -10,7 +10,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('export.js');
require 'libraries/server_common.inc.php';
View
4 server_import.php
@@ -10,7 +10,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('import.js');
/**
View
4 server_plugins.php
@@ -13,7 +13,9 @@
/**
* JS includes
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('jquery/jquery.cookie.js');
$scripts->addFile('jquery/jquery.tablesorter.js');
$scripts->addFile('server_plugins.js');
View
4 server_privileges.php
@@ -13,7 +13,9 @@
/**
* Does the common work
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('server_privileges.js');
$_add_user_error = false;
View
4 server_replication.php
@@ -13,7 +13,9 @@
/**
* Does the common work
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('server_privileges.js');
$scripts->addFile('replication.js');
View
4 server_sql.php
@@ -13,7 +13,9 @@
/**
* Does the common work
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
View
7 server_status.php
@@ -10,7 +10,7 @@
require_once 'libraries/common.inc.php';
if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
- PMA_Header::getInstance()->isHeaderSent = true;
+ PMA_Header::$headerIsSent = true;
}
/**
@@ -429,8 +429,9 @@
/**
* JS Includes
*/
-
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('server_status.js');
$scripts->addFile('jquery/jquery.tablesorter.js');
View
4 server_synchronize.php
@@ -14,7 +14,9 @@
/**
* Does the common work
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('server_synchronize.js');
require_once 'libraries/server_common.inc.php';
View
4 server_variables.php
@@ -7,7 +7,9 @@
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('server_variables.js');
PMA_addJSVar('pma_token', $_SESSION[' PMA_token ']);
View
3 setup/index.php
@@ -27,7 +27,8 @@
$action_done = preg_replace('/[^a-z_]/', '', $action_done);
// send no-cache headers
-PMA_Header::getInstance()->sendHttpHeaders();
+$response = PMA_Response::getInstance();
+$response->getHeader()->sendHttpHeaders();
?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
View
28 sql.php
@@ -15,7 +15,9 @@
require_once 'libraries/check_user_privileges.lib.php';
require_once 'libraries/bookmark.lib.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('jquery/timepicker.js');
$scripts->addFile('tbl_change.js');
// the next one needed because sql.php may do a "goto" to tbl_structure.php
@@ -57,7 +59,9 @@
}
if (isset($_SESSION['profiling'])) {
- $scripts = PMA_Header::getInstance()->getScripts();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
+ $scripts = $header->getScripts();
/* < IE 9 doesn't support canvas natively */
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
$scripts->addFile('canvg/flashcanvas.js');
@@ -287,7 +291,8 @@
&& $is_drop_database
&& ! $is_superuser
) {
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
PMA_mysqlDie(__('"DROP DATABASE" statements are disabled.'), '', '', $err_url);
} // end if
@@ -383,7 +388,8 @@
if ($do_confirm) {
$stripped_sql_query = $sql_query;
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
if ($is_drop_database) {
echo '<h1 class="error">' . __(
'You are about to DESTROY a complete database!'
@@ -871,7 +877,9 @@
}
if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['table_maintenance'])) {
- $scripts = PMA_Header::getInstance()->getScripts();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
+ $scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
@@ -907,7 +915,8 @@
if (isset($printview) && $printview == '1') {
PMA_checkParameters(array('db', 'full_sql_query'));
- $header = PMA_Header::getInstance();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
$header->enablePrintView();
$header->display();
@@ -939,7 +948,9 @@
echo "</p>";
} else {
- $scripts = PMA_Header::getInstance()->getScripts();
+ $response = PMA_Response::getInstance();
+ $header = $response->getHeader();
+ $scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
@@ -957,7 +968,8 @@
include 'libraries/server_common.inc.php';
}
} else {
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
//we don't need to buffer the output in PMA_getMessage here.
//set a global variable and check against it in the function
$GLOBALS['buffer_message'] = false;
View
3 tbl_addfield.php
@@ -10,7 +10,8 @@
*/
require_once 'libraries/common.inc.php';
-PMA_Header::getInstance()->display();
+$response = PMA_Response::getInstance();
+$response->getHeader()->display();
// Check parameters
PMA_checkParameters(array('db', 'table'));
View
6 tbl_change.php
@@ -109,7 +109,9 @@
/**
* Load JavaScript files
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('functions.js');
$scripts->addFile('tbl_change.js');
$scripts->addFile('jquery/timepicker.js');
@@ -118,7 +120,7 @@
/**
* HTTP and HTML headers
*/
-PMA_Header::getInstance()->display();
+$header->display();
/**
* Displays the query submitted and its result
View
4 tbl_chart.php
@@ -11,7 +11,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('tbl_chart.js');
$scripts->addFile('highcharts/highcharts.js');
/* Files required for chart exporting */
View
3 tbl_create.php
@@ -11,7 +11,8 @@
$action = 'tbl_create.php';
-PMA_Header::getInstance()->display();
+$response = PMA_Response::getInstance();
+$response->getHeader()->display();
$titles = PMA_buildActionTitles();
View
4 tbl_export.php
@@ -10,7 +10,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('export.js');
/**
View
4 tbl_gis_visualization.php
@@ -8,7 +8,9 @@
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('openlayers/OpenLayers.js');
$scripts->addFile('jquery/jquery.svg.js');
$scripts->addFile('jquery/jquery.mousewheel.js');
View
4 tbl_import.php
@@ -10,7 +10,9 @@
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('import.js');
/**
View
4 tbl_indexes.php
@@ -129,7 +129,9 @@
*/
// Displays headers (if needed)
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('indexes.js');
require_once 'libraries/tbl_info.inc.php';
View
3 tbl_printview.php
@@ -11,7 +11,8 @@
*/
require_once 'libraries/common.inc.php';
-PMA_Header::getInstance()->enablePrintView();
+$response = PMA_Response::getInstance();
+$response->getHeader()->enablePrintView();
require 'libraries/tbl_common.inc.php';
View
4 tbl_relation.php
@@ -17,7 +17,9 @@
* Gets some core libraries
*/
require_once 'libraries/common.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('tbl_relation.js');
require_once 'libraries/tbl_common.inc.php';
View
4 tbl_replace.php
@@ -31,7 +31,9 @@
*/
$goto_include = false;
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
// Needed for generation of Inline Edit anchors
$scripts->addFile('sql.js');
View
4 tbl_select.php
@@ -16,7 +16,9 @@
require_once 'libraries/mysql_charsets.lib.php';
require_once 'libraries/tbl_select.lib.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
$scripts->addFile('tbl_select.js');
View
4 tbl_sql.php
@@ -13,7 +13,9 @@
/**
* Runs common work
*/
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
View
4 tbl_structure.php
@@ -12,7 +12,9 @@
require_once 'libraries/common.inc.php';
require_once 'libraries/mysql_charsets.lib.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('tbl_structure.js');
$scripts->addFile('indexes.js');
View
4 tbl_zoom_select.php
@@ -17,7 +17,9 @@
require_once './libraries/relation.lib.php';
require_once './libraries/tbl_info.inc.php';
-$scripts = PMA_Header::getInstance()->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
$scripts->addFile('date.js');
View
4 themes.php
@@ -9,8 +9,8 @@
* get some globals
*/
require './libraries/common.inc.php';
-
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->setBodyId('bodythemes');
$header->setTitle('phpMyAdmin - ' . __('Theme'));
$header->disableMenu();
View
3 transformation_overview.php
@@ -11,7 +11,8 @@
require_once './libraries/common.inc.php';
require_once './libraries/transformations.lib.php';
-$header = PMA_Header::getInstance();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
$header->disableMenu();
$header->display();
View
3 transformation_wrapper.php
@@ -85,7 +85,8 @@
}
// Only output the http headers
-PMA_Header::getInstance()->sendHttpHeaders();
+$response = PMA_Response::getInstance();
+$response->getHeader()->sendHttpHeaders();
// [MIME]
if (isset($ct) && !empty($ct)) {
View
8 user_password.php
@@ -12,8 +12,9 @@
*/
require_once './libraries/common.inc.php';
-$header = PMA_Header::getInstance();
-$scripts = $header->getScripts();
+$response = PMA_Response::getInstance();
+$header = $response->getHeader();
+$scripts = $header->getScripts();
$scripts->addFile('server_privileges.js');
/**
@@ -204,7 +205,8 @@ function PMA_changePassAuthType($_url_params, $password)
*/
function PMA_changePassDisplayPage($message, $sql_query, $_url_params)
{
- PMA_Header::getInstance()->display();
+ $response = PMA_Response::getInstance();
+ $response->getHeader()->display();
echo '<h1>' . __('Change password') . '</h1>' . "\n\n";
echo PMA_getMessage($message, $sql_query, 'success');
echo '<a href="index.php'.PMA_generate_common_url($_url_params).' target="_parent">'. "\n"

0 comments on commit a054562

Please sign in to comment.