diff options
author | Christian Foellmann <foellmann@foe-services.de> | 2015-01-17 12:49:39 +0300 |
---|---|---|
committer | Christian Foellmann <foellmann@foe-services.de> | 2015-01-17 12:49:39 +0300 |
commit | 315c33fef0fc20fbfa948446b728c0b9db34ab7c (patch) | |
tree | bdc18a0e2e87b62e37f8168fd0f1e199ad25df05 /libraries/plugins | |
parent | 72f864ff50d01b8bc18904db7a6ba4fa32c44783 (diff) |
UPDATE to 4.3.74.3.7
Diffstat (limited to 'libraries/plugins')
9 files changed, 39 insertions, 69 deletions
diff --git a/libraries/plugins/schema/Export_Relation_Schema.class.php b/libraries/plugins/schema/Export_Relation_Schema.class.php index 729339563f..7d7a7adeba 100644 --- a/libraries/plugins/schema/Export_Relation_Schema.class.php +++ b/libraries/plugins/schema/Export_Relation_Schema.class.php @@ -248,6 +248,28 @@ class PMA_Export_Relation_Schema } /** + * Returns the file name + * + * @param String $extension file extension + */ + protected function getFileName($extension) + { + $filename = $GLOBALS['db'] . $extension; + // Get the name of this page to use as filename + if ($this->pageNumber != -1 && ! $this->offline) { + $_name_sql = 'SELECT page_descr FROM ' + . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' + . PMA_Util::backquote($GLOBALS['cfgRelation']['pdf_pages']) + . ' WHERE page_nr = ' . $this->pageNumber; + $_name_rs = PMA_queryAsControlUser($_name_sql); + $_name_row = $GLOBALS['dbi']->fetchRow($_name_rs); + $filename = $_name_row[0] . $extension; + } + + return $filename; + } + + /** * Displays an error message * * @param integer $pageNumber ID of the chosen page @@ -258,7 +280,7 @@ class PMA_Export_Relation_Schema * * @return void */ - function dieSchema($pageNumber, $type = '', $error_message = '') + public static function dieSchema($pageNumber, $type = '', $error_message = '') { echo "<p><strong>" . __("SCHEMA ERROR: ") . $type . "</strong></p>" . "\n"; if (!empty($error_message)) { diff --git a/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php b/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php index 3f6abfa13d..c8619555ee 100644 --- a/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php +++ b/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php @@ -176,7 +176,7 @@ class PMA_DIA extends XMLWriter $output = $this->flush(); PMA_Response::getInstance()->disable(); PMA_downloadHeader( - $fileName . '.dia', + $fileName, 'application/x-dia-diagram', /*overload*/mb_strlen($output) ); @@ -302,11 +302,7 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema function showOutput() { global $dia; - $filename = $GLOBALS['db']; - if ($this->pageNumber != -1) { - $filename .= '-' . $this->pageNumber; - } - $dia->showOutput($filename); + $dia->showOutput($this->getFileName('.dia')); } /** diff --git a/libraries/plugins/schema/dia/TableStatsDia.class.php b/libraries/plugins/schema/dia/TableStatsDia.class.php index 81f86c1612..a3aabb5622 100644 --- a/libraries/plugins/schema/dia/TableStatsDia.class.php +++ b/libraries/plugins/schema/dia/TableStatsDia.class.php @@ -62,7 +62,7 @@ class Table_Stats_Dia extends TableStats */ protected function showMissingTableError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "DIA", sprintf(__('The %s table doesn\'t exist!'), $this->tableName) @@ -76,7 +76,7 @@ class Table_Stats_Dia extends TableStats */ protected function showMissingCoordinatesError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "DIA", sprintf( diff --git a/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php b/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php index 205c0024b7..45c7966843 100644 --- a/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php +++ b/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php @@ -295,7 +295,7 @@ class PMA_EPS $output = $this->stringCommands; PMA_Response::getInstance()->disable(); PMA_downloadHeader( - $fileName . '.eps', + $fileName, 'image/x-eps', /*overload*/mb_strlen($output) ); @@ -432,11 +432,7 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema function showOutput() { global $eps; - $filename = $GLOBALS['db']; - if ($this->pageNumber != -1) { - $filename .= '-' . $this->pageNumber; - } - $eps->showOutput($filename); + $eps->showOutput($this->getFileName('.eps')); } /** diff --git a/libraries/plugins/schema/eps/TableStatsEps.class.php b/libraries/plugins/schema/eps/TableStatsEps.class.php index 3e40627f9f..6643972272 100644 --- a/libraries/plugins/schema/eps/TableStatsEps.class.php +++ b/libraries/plugins/schema/eps/TableStatsEps.class.php @@ -75,7 +75,7 @@ class Table_Stats_Eps extends TableStats */ protected function showMissingTableError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "EPS", sprintf(__('The %s table doesn\'t exist!'), $this->tableName) @@ -89,7 +89,7 @@ class Table_Stats_Eps extends TableStats */ protected function showMissingCoordinatesError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "EPS", sprintf( diff --git a/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php b/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php index 82be0fa4fc..2b4350f975 100644 --- a/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php +++ b/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php @@ -653,7 +653,8 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema */ function showOutput() { - $this->_showOutput($this->pageNumber); + global $pdf; + $pdf->Download($this->getFileName('.pdf')); } /** @@ -825,47 +826,6 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema } /** - * Outputs the PDF document to a file - * or sends the output to browser - * - * @param integer $pageNumber page number - * - * @global object $pdf The current PDF document - * @access private - * - * @return void - * - * @see PMA_Schema_PDF - */ - private function _showOutput($pageNumber) - { - global $pdf; - - // Get the name of this pdfpage to use as filename - if ($this->offline) { - $filename = $GLOBALS['db']; - if ($this->pageNumber != -1) { - $filename .= '-' . $this->pageNumber; - } - } else { - $_name_sql = 'SELECT page_descr FROM ' - . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' - . PMA_Util::backquote($GLOBALS['cfgRelation']['pdf_pages']) - . ' WHERE page_nr = ' . $pageNumber; - $_name_rs = PMA_queryAsControlUser($_name_sql); - if ($_name_rs) { - $_name_row = $GLOBALS['dbi']->fetchRow($_name_rs); - $filename = $_name_row[0] . '.pdf'; - } - if (empty($filename)) { - $filename = $pageNumber . '.pdf'; - } - } - - $pdf->Download($filename); - } - - /** * Generates data dictionary pages. * * @param array $alltables Tables to document. diff --git a/libraries/plugins/schema/pdf/TableStatsPdf.class.php b/libraries/plugins/schema/pdf/TableStatsPdf.class.php index a20829ccc8..c45637dbce 100644 --- a/libraries/plugins/schema/pdf/TableStatsPdf.class.php +++ b/libraries/plugins/schema/pdf/TableStatsPdf.class.php @@ -76,7 +76,7 @@ class Table_Stats_Pdf extends TableStats */ protected function showMissingTableError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "PDF", sprintf(__('The %s table doesn\'t exist!'), $this->tableName) @@ -90,7 +90,7 @@ class Table_Stats_Pdf extends TableStats */ protected function showMissingCoordinatesError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "PDF", sprintf( diff --git a/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php b/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php index f2ae1f1bc6..75eafebab3 100644 --- a/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php +++ b/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php @@ -188,7 +188,7 @@ class PMA_SVG extends XMLWriter $output = $this->flush(); PMA_Response::getInstance()->disable(); PMA_downloadHeader( - $fileName . '.svg', + $fileName, 'image/svg+xml', /*overload*/mb_strlen($output) ); @@ -405,11 +405,7 @@ class PMA_Svg_Relation_Schema extends PMA_Export_Relation_Schema function showOutput() { global $svg; - $filename = $GLOBALS['db']; - if ($this->pageNumber != -1) { - $filename .= '-' . $this->pageNumber; - } - $svg->showOutput($filename); + $svg->showOutput($this->getFileName('.svg')); } diff --git a/libraries/plugins/schema/svg/TableStatsSvg.class.php b/libraries/plugins/schema/svg/TableStatsSvg.class.php index 7b421c318a..0fce77cbb5 100644 --- a/libraries/plugins/schema/svg/TableStatsSvg.class.php +++ b/libraries/plugins/schema/svg/TableStatsSvg.class.php @@ -76,7 +76,7 @@ class Table_Stats_Svg extends TableStats */ protected function showMissingTableError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "SVG", sprintf(__('The %s table doesn\'t exist!'), $this->tableName) @@ -90,7 +90,7 @@ class Table_Stats_Svg extends TableStats */ protected function showMissingCoordinatesError() { - $this->diagram->dieSchema( + PMA_Export_Relation_Schema::dieSchema( $this->pageNumber, "SVG", sprintf( |