Merge remote-tracking branch 'origin/QA_4_3' into QA_4_3
This commit is contained in:
commit
7d5acc16be
@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog
|
||||
- bug #4697 Server Status refresh not behaving as expected
|
||||
- bug Null argument in array_multisort()
|
||||
- bug #4699 Navigation panel should not hide icons based on 'TableNavigationLinksMode'
|
||||
- bug #4703 Unsaved schema page exported as pdf.pdf
|
||||
|
||||
4.3.6.0 (2015-01-07)
|
||||
- bug Undefined index notices while configuring recent and favorite tables
|
||||
|
||||
@ -247,6 +247,28 @@ class PMA_Export_Relation_Schema
|
||||
return $tables;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
|
||||
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -824,47 +825,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.
|
||||
*
|
||||
|
||||
@ -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'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user