oop: fix ExportLatex

This commit is contained in:
Alex Marin 2012-08-17 11:06:41 +03:00
parent ad32e6a529
commit c806f1d64d
2 changed files with 36 additions and 7 deletions

View File

@ -3460,6 +3460,10 @@ class PMA_CommonFunctions
*
* @param string $string Text where to do expansion.
* @param function $escape Function to call for escaping variable values.
* Can also be an array of:
* - the escape method name
* - the class that contains the method
* - location of the class (for inclusion)
* @param array $updates Array with overrides for default parameters
* (obtained from GLOBALS).
*
@ -3507,10 +3511,19 @@ class PMA_CommonFunctions
/* Optional escaping */
if (! is_null($escape)) {
if (is_array($escape)) {
require_once $escape[2];
$escape_class = new $escape[1];
$escape_method = $escape[0];
}
foreach ($replace as $key => $val) {
$replace[$key] = ($escape == 'backquote')
? $this->$escape($val)
: $escape($val);
if (is_array($escape)) {
$replace[$key] = $escape_class->$escape_method($val);
} else {
$replace[$key] = ($escape == 'backquote')
? $this->$escape($val)
: $escape($val);
}
}
}

View File

@ -311,7 +311,11 @@ class ExportLatex extends ExportPlugin
$buffer .= ' \\caption{'
. $common_functions->expandUserString(
$GLOBALS['latex_data_caption'],
get_class($this) . '->texEscape',
array(
'texEscape',
get_class($this),
'libraries/plugins/export/' . get_class($this) . ".class.php"
),
array('table' => $table, 'database' => $db)
)
. '} \\label{'
@ -343,7 +347,11 @@ class ExportLatex extends ExportPlugin
'\\caption{'
. $common_functions->expandUserString(
$GLOBALS['latex_data_continued_caption'],
get_class($this) . '->texEscape',
array(
'texEscape',
get_class($this),
'libraries/plugins/export/' . get_class($this) . ".class.php"
),
array('table' => $table, 'database' => $db)
)
. '} \\\\ '
@ -513,7 +521,11 @@ class ExportLatex extends ExportPlugin
$buffer .= ' \\caption{'
. $common_functions->expandUserString(
$GLOBALS['latex_structure_caption'],
get_class($this) . '->texEscape',
array(
'texEscape',
get_class($this),
'libraries/plugins/export/' . get_class($this) . ".class.php"
),
array('table' => $table, 'database' => $db)
)
. '} \\label{'
@ -531,7 +543,11 @@ class ExportLatex extends ExportPlugin
$buffer .= ' \\caption{'
. $common_functions->expandUserString(
$GLOBALS['latex_structure_continued_caption'],
get_class($this) . '->texEscape',
array(
'texEscape',
get_class($this),
'libraries/plugins/export/' . get_class($this) . ".class.php"
),
array('table' => $table, 'database' => $db)
)
. '} \\\\ ' . $crlf;