Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2021-12-07 21:44:53 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2021-12-11 14:10:40 +0300
commitc4575fd48b32f03bc260246ea9e4a7648c1db498 (patch)
tree3797667528d083ca1de5c03f4310cef261390717 /libraries/classes/Table.php
parent5746563e2f1636b0fc1f438c9d2e265dbeabb78e (diff)
Add methods to check for RelationParameters features
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'libraries/classes/Table.php')
-rw-r--r--libraries/classes/Table.php53
1 files changed, 7 insertions, 46 deletions
diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php
index 6cefa64332..d4d9b0d227 100644
--- a/libraries/classes/Table.php
+++ b/libraries/classes/Table.php
@@ -1318,11 +1318,11 @@ class Table implements Stringable
return true;
}
- if ($relationParameters->commwork) {
+ if ($relationParameters->hasColumnCommentsFeature()) {
// Get all comments and MIME-Types for current table
$commentsCopyRs = $relation->queryAsControlUser(
'SELECT column_name, comment'
- . ($relationParameters->mimework
+ . ($relationParameters->hasBrowserTransformationFeature()
? ', mimetype, transformation, transformation_options'
: '')
. ' FROM '
@@ -1343,7 +1343,7 @@ class Table implements Stringable
. Util::backquote($relationParameters->db)
. '.' . Util::backquote($relationParameters->columnInfo)
. ' (db_name, table_name, column_name, comment'
- . ($relationParameters->mimework
+ . ($relationParameters->hasBrowserTransformationFeature()
? ', mimetype, transformation, transformation_options'
: '')
. ') VALUES(\'' . $dbi->escapeString($targetDb)
@@ -1352,7 +1352,7 @@ class Table implements Stringable
. '\',\''
. $dbi->escapeString($commentsCopyRow['comment'])
. '\''
- . ($relationParameters->mimework
+ . ($relationParameters->hasBrowserTransformationFeature()
? ',\'' . $dbi->escapeString($commentsCopyRow['mimetype'])
. '\',\'' . $dbi->escapeString($commentsCopyRow['transformation'])
. '\',\'' . $dbi->escapeString($commentsCopyRow['transformation_options'])
@@ -1415,45 +1415,6 @@ class Table implements Stringable
];
self::duplicateInfo('relwork', 'relation', $getFields, $whereFields, $newFields);
- /**
- * @todo Can't get duplicating PDFs the right way. The
- * page numbers always get screwed up independently from
- * duplication because the numbers do not seem to be stored on a
- * per-database basis. Would the author of pdf support please
- * have a look at it?
- *
- $get_fields = array('page_descr');
- $where_fields = array('db_name' => $source_db);
- $new_fields = array('db_name' => $target_db);
- $last_id = self::duplicateInfo(
- 'pdfwork',
- 'pdf_pages',
- $get_fields,
- $where_fields,
- $new_fields
- );
-
- if (isset($last_id) && $last_id >= 0) {
- $get_fields = array('x', 'y');
- $where_fields = array(
- 'db_name' => $source_db,
- 'table_name' => $source_table
- );
- $new_fields = array(
- 'db_name' => $target_db,
- 'table_name' => $target_table,
- 'pdf_page_number' => $last_id
- );
- self::duplicateInfo(
- 'pdfwork',
- 'table_coords',
- $get_fields,
- $where_fields,
- $new_fields
- );
- }
- */
-
return true;
}
@@ -1886,7 +1847,7 @@ class Table implements Stringable
// set session variable if it's still undefined
if (! isset($_SESSION['tmpval']['table_uiprefs'][$serverId][$this->dbName][$this->name])) {
// check whether we can get from pmadb
- $uiPrefs = $relationParameters->uiprefswork ? $this->getUiPrefsFromDb() : [];
+ $uiPrefs = $relationParameters->hasUiPreferencesFeature() ? $this->getUiPrefsFromDb() : [];
$_SESSION['tmpval']['table_uiprefs'][$serverId][$this->dbName][$this->name] = $uiPrefs;
}
@@ -2008,7 +1969,7 @@ class Table implements Stringable
// check if pmadb is set
$relationParameters = $this->relation->getRelationParameters();
- if ($relationParameters->uiprefswork) {
+ if ($relationParameters->hasUiPreferencesFeature()) {
return $this->saveUiPrefsToDb();
}
@@ -2033,7 +1994,7 @@ class Table implements Stringable
// check if pmadb is set
$relationParameters = $this->relation->getRelationParameters();
- if ($relationParameters->uiprefswork) {
+ if ($relationParameters->hasUiPreferencesFeature()) {
return $this->saveUiPrefsToDb();
}
}