@@ -81,51 +81,51 @@ public function getRelationParameters(): RelationParameters
8181 */
8282 private function checkTableAccess (array $ relationParams ): array
8383 {
84- if (isset ($ relationParams [' relation ' ], $ relationParams [' table_info ' ])) {
85- if ($ this ->canAccessStorageTable ((string ) $ relationParams [' table_info ' ])) {
86- $ relationParams [' displaywork ' ] = true ;
84+ if (isset ($ relationParams [RelationParameters:: RELATION ], $ relationParams [RelationParameters:: TABLE_INFO ])) {
85+ if ($ this ->canAccessStorageTable ((string ) $ relationParams [RelationParameters:: TABLE_INFO ])) {
86+ $ relationParams [RelationParameters:: DISPLAY_WORK ] = true ;
8787 }
8888 }
8989
90- if (isset ($ relationParams [' table_coords ' ], $ relationParams [' pdf_pages ' ])) {
91- if ($ this ->canAccessStorageTable ((string ) $ relationParams [' table_coords ' ])) {
92- if ($ this ->canAccessStorageTable ((string ) $ relationParams [' pdf_pages ' ])) {
93- $ relationParams [' pdfwork ' ] = true ;
90+ if (isset ($ relationParams [RelationParameters:: TABLE_COORDS ], $ relationParams [RelationParameters:: PDF_PAGES ])) {
91+ if ($ this ->canAccessStorageTable ((string ) $ relationParams [RelationParameters:: TABLE_COORDS ])) {
92+ if ($ this ->canAccessStorageTable ((string ) $ relationParams [RelationParameters:: PDF_PAGES ])) {
93+ $ relationParams [RelationParameters:: PDF_WORK ] = true ;
9494 }
9595 }
9696 }
9797
98- if (isset ($ relationParams [' column_info ' ])) {
99- if ($ this ->canAccessStorageTable ((string ) $ relationParams [' column_info ' ])) {
100- $ relationParams [' commwork ' ] = true ;
98+ if (isset ($ relationParams [RelationParameters:: COLUMN_INFO ])) {
99+ if ($ this ->canAccessStorageTable ((string ) $ relationParams [RelationParameters:: COLUMN_INFO ])) {
100+ $ relationParams [RelationParameters:: COMM_WORK ] = true ;
101101 // phpMyAdmin 4.3+
102102 // Check for input transformations upgrade.
103- $ relationParams [' mimework ' ] = $ this ->tryUpgradeTransformations ();
103+ $ relationParams [RelationParameters:: MIME_WORK ] = $ this ->tryUpgradeTransformations ();
104104 }
105105 }
106106
107- if (isset ($ relationParams [' users ' ], $ relationParams [' usergroups ' ])) {
108- if ($ this ->canAccessStorageTable ((string ) $ relationParams [' users ' ])) {
109- if ($ this ->canAccessStorageTable ((string ) $ relationParams [' usergroups ' ])) {
110- $ relationParams [' menuswork ' ] = true ;
107+ if (isset ($ relationParams [RelationParameters:: USERS ], $ relationParams [RelationParameters:: USER_GROUPS ])) {
108+ if ($ this ->canAccessStorageTable ((string ) $ relationParams [RelationParameters:: USERS ])) {
109+ if ($ this ->canAccessStorageTable ((string ) $ relationParams [RelationParameters:: USER_GROUPS ])) {
110+ $ relationParams [RelationParameters:: MENUS_WORK ] = true ;
111111 }
112112 }
113113 }
114114
115115 $ settings = [
116- ' export_templates ' => ' exporttemplateswork ' ,
117- ' designer_settings ' => ' designersettingswork ' ,
118- ' central_columns ' => ' centralcolumnswork ' ,
119- ' savedsearches ' => ' savedsearcheswork ' ,
120- ' navigationhiding ' => ' navwork ' ,
121- ' bookmark ' => ' bookmarkwork ' ,
122- ' userconfig ' => ' userconfigwork ' ,
123- ' tracking ' => ' trackingwork ' ,
124- ' table_uiprefs ' => ' uiprefswork ' ,
125- ' favorite ' => ' favoritework ' ,
126- ' recent ' => ' recentwork ' ,
127- ' history ' => ' historywork ' ,
128- ' relation ' => ' relwork ' ,
116+ RelationParameters:: EXPORT_TEMPLATES => RelationParameters:: EXPORT_TEMPLATES_WORK ,
117+ RelationParameters:: DESIGNER_SETTINGS => RelationParameters:: DESIGNER_SETTINGS_WORK ,
118+ RelationParameters:: CENTRAL_COLUMNS => RelationParameters:: CENTRAL_COLUMNS_WORK ,
119+ RelationParameters:: SAVED_SEARCHES => RelationParameters:: SAVED_SEARCHES_WORK ,
120+ RelationParameters:: NAVIGATION_HIDING => RelationParameters:: NAV_WORK ,
121+ RelationParameters:: BOOKMARK => RelationParameters:: BOOKMARK_WORK ,
122+ RelationParameters:: USER_CONFIG => RelationParameters:: USER_CONFIG_WORK ,
123+ RelationParameters:: TRACKING => RelationParameters:: TRACKING_WORK ,
124+ RelationParameters:: TABLE_UI_PREFS => RelationParameters:: UI_PREFS_WORK ,
125+ RelationParameters:: FAVORITE => RelationParameters:: FAVORITE_WORK ,
126+ RelationParameters:: RECENT => RelationParameters:: RECENT_WORK ,
127+ RelationParameters:: HISTORY => RelationParameters:: HISTORY_WORK ,
128+ RelationParameters:: RELATION => RelationParameters:: REL_WORK ,
129129 ];
130130
131131 foreach ($ settings as $ setingName => $ worksKey ) {
@@ -161,43 +161,43 @@ private function fillRelationParamsWithTableNames(array $relationParams): array|
161161
162162 foreach ($ tables as $ table ) {
163163 if ($ table === $ this ->config ->selectedServer ['bookmarktable ' ]) {
164- $ relationParams [' bookmark ' ] = $ table ;
164+ $ relationParams [RelationParameters:: BOOKMARK ] = $ table ;
165165 } elseif ($ table === $ this ->config ->selectedServer ['relation ' ]) {
166- $ relationParams [' relation ' ] = $ table ;
166+ $ relationParams [RelationParameters:: RELATION ] = $ table ;
167167 } elseif ($ table === $ this ->config ->selectedServer ['table_info ' ]) {
168- $ relationParams [' table_info ' ] = $ table ;
168+ $ relationParams [RelationParameters:: TABLE_INFO ] = $ table ;
169169 } elseif ($ table === $ this ->config ->selectedServer ['table_coords ' ]) {
170- $ relationParams [' table_coords ' ] = $ table ;
170+ $ relationParams [RelationParameters:: TABLE_COORDS ] = $ table ;
171171 } elseif ($ table === $ this ->config ->selectedServer ['column_info ' ]) {
172- $ relationParams [' column_info ' ] = $ table ;
172+ $ relationParams [RelationParameters:: COLUMN_INFO ] = $ table ;
173173 } elseif ($ table === $ this ->config ->selectedServer ['pdf_pages ' ]) {
174- $ relationParams [' pdf_pages ' ] = $ table ;
174+ $ relationParams [RelationParameters:: PDF_PAGES ] = $ table ;
175175 } elseif ($ table === $ this ->config ->selectedServer ['history ' ]) {
176- $ relationParams [' history ' ] = $ table ;
176+ $ relationParams [RelationParameters:: HISTORY ] = $ table ;
177177 } elseif ($ table === $ this ->config ->selectedServer ['recent ' ]) {
178- $ relationParams [' recent ' ] = $ table ;
178+ $ relationParams [RelationParameters:: RECENT ] = $ table ;
179179 } elseif ($ table === $ this ->config ->selectedServer ['favorite ' ]) {
180- $ relationParams [' favorite ' ] = $ table ;
180+ $ relationParams [RelationParameters:: FAVORITE ] = $ table ;
181181 } elseif ($ table === $ this ->config ->selectedServer ['table_uiprefs ' ]) {
182- $ relationParams [' table_uiprefs ' ] = $ table ;
182+ $ relationParams [RelationParameters:: TABLE_UI_PREFS ] = $ table ;
183183 } elseif ($ table === $ this ->config ->selectedServer ['tracking ' ]) {
184- $ relationParams [' tracking ' ] = $ table ;
184+ $ relationParams [RelationParameters:: TRACKING ] = $ table ;
185185 } elseif ($ table === $ this ->config ->selectedServer ['userconfig ' ]) {
186- $ relationParams [' userconfig ' ] = $ table ;
186+ $ relationParams [RelationParameters:: USER_CONFIG ] = $ table ;
187187 } elseif ($ table === $ this ->config ->selectedServer ['users ' ]) {
188- $ relationParams [' users ' ] = $ table ;
188+ $ relationParams [RelationParameters:: USERS ] = $ table ;
189189 } elseif ($ table === $ this ->config ->selectedServer ['usergroups ' ]) {
190- $ relationParams [' usergroups ' ] = $ table ;
190+ $ relationParams [RelationParameters:: USER_GROUPS ] = $ table ;
191191 } elseif ($ table === $ this ->config ->selectedServer ['navigationhiding ' ]) {
192- $ relationParams [' navigationhiding ' ] = $ table ;
192+ $ relationParams [RelationParameters:: NAVIGATION_HIDING ] = $ table ;
193193 } elseif ($ table === $ this ->config ->selectedServer ['savedsearches ' ]) {
194- $ relationParams [' savedsearches ' ] = $ table ;
194+ $ relationParams [RelationParameters:: SAVED_SEARCHES ] = $ table ;
195195 } elseif ($ table === $ this ->config ->selectedServer ['central_columns ' ]) {
196- $ relationParams [' central_columns ' ] = $ table ;
196+ $ relationParams [RelationParameters:: CENTRAL_COLUMNS ] = $ table ;
197197 } elseif ($ table === $ this ->config ->selectedServer ['designer_settings ' ]) {
198- $ relationParams [' designer_settings ' ] = $ table ;
198+ $ relationParams [RelationParameters:: DESIGNER_SETTINGS ] = $ table ;
199199 } elseif ($ table === $ this ->config ->selectedServer ['export_templates ' ]) {
200- $ relationParams [' export_templates ' ] = $ table ;
200+ $ relationParams [RelationParameters:: EXPORT_TEMPLATES ] = $ table ;
201201 }
202202 }
203203
@@ -214,32 +214,32 @@ private function fillRelationParamsWithTableNames(array $relationParams): array|
214214 private function checkRelationsParam (): array
215215 {
216216 $ workToTable = [
217- ' relwork ' => 'relation ' ,
218- ' displaywork ' => ['relation ' , 'table_info ' ],
219- ' bookmarkwork ' => 'bookmarktable ' ,
220- ' pdfwork ' => ['table_coords ' , 'pdf_pages ' ],
221- ' commwork ' => 'column_info ' ,
222- ' mimework ' => 'column_info ' ,
223- ' historywork ' => 'history ' ,
224- ' recentwork ' => 'recent ' ,
225- ' favoritework ' => 'favorite ' ,
226- ' uiprefswork ' => 'table_uiprefs ' ,
227- ' trackingwork ' => 'tracking ' ,
228- ' userconfigwork ' => 'userconfig ' ,
229- ' menuswork ' => ['users ' , 'usergroups ' ],
230- ' navwork ' => 'navigationhiding ' ,
231- ' savedsearcheswork ' => 'savedsearches ' ,
232- ' centralcolumnswork ' => 'central_columns ' ,
233- ' designersettingswork ' => 'designer_settings ' ,
234- ' exporttemplateswork ' => 'export_templates ' ,
217+ RelationParameters:: REL_WORK => 'relation ' ,
218+ RelationParameters:: DISPLAY_WORK => ['relation ' , 'table_info ' ],
219+ RelationParameters:: BOOKMARK_WORK => 'bookmarktable ' ,
220+ RelationParameters:: PDF_WORK => ['table_coords ' , 'pdf_pages ' ],
221+ RelationParameters:: COMM_WORK => 'column_info ' ,
222+ RelationParameters:: MIME_WORK => 'column_info ' ,
223+ RelationParameters:: HISTORY_WORK => 'history ' ,
224+ RelationParameters:: RECENT_WORK => 'recent ' ,
225+ RelationParameters:: FAVORITE_WORK => 'favorite ' ,
226+ RelationParameters:: UI_PREFS_WORK => 'table_uiprefs ' ,
227+ RelationParameters:: TRACKING_WORK => 'tracking ' ,
228+ RelationParameters:: USER_CONFIG_WORK => 'userconfig ' ,
229+ RelationParameters:: MENUS_WORK => ['users ' , 'usergroups ' ],
230+ RelationParameters:: NAV_WORK => 'navigationhiding ' ,
231+ RelationParameters:: SAVED_SEARCHES_WORK => 'savedsearches ' ,
232+ RelationParameters:: CENTRAL_COLUMNS_WORK => 'central_columns ' ,
233+ RelationParameters:: DESIGNER_SETTINGS_WORK => 'designer_settings ' ,
234+ RelationParameters:: EXPORT_TEMPLATES_WORK => 'export_templates ' ,
235235 ];
236236
237237 $ relationParams = array_fill_keys (array_keys ($ workToTable ), false );
238238
239- $ relationParams [' version ' ] = Version::VERSION ;
240- $ relationParams [' allworks ' ] = false ;
241- $ relationParams [' user ' ] = null ;
242- $ relationParams [' db ' ] = null ;
239+ $ relationParams [RelationParameters:: VERSION ] = Version::VERSION ;
240+ $ relationParams [RelationParameters:: ALL_WORKS ] = false ;
241+ $ relationParams [RelationParameters:: USER ] = null ;
242+ $ relationParams [RelationParameters:: DATABASE ] = null ;
243243
244244 if (
245245 Current::$ server === 0
@@ -251,8 +251,8 @@ private function checkRelationsParam(): array
251251 return $ relationParams ;
252252 }
253253
254- $ relationParams [' user ' ] = $ this ->config ->selectedServer ['user ' ];
255- $ relationParams [' db ' ] = $ this ->config ->selectedServer ['pmadb ' ];
254+ $ relationParams [RelationParameters:: USER ] = $ this ->config ->selectedServer ['user ' ];
255+ $ relationParams [RelationParameters:: DATABASE ] = $ this ->config ->selectedServer ['pmadb ' ];
256256
257257 $ relationParamsFilled = $ this ->fillRelationParamsWithTableNames ($ relationParams );
258258
@@ -289,7 +289,7 @@ private function checkRelationsParam(): array
289289 }
290290 }
291291
292- $ relationParams [' allworks ' ] = $ allWorks ;
292+ $ relationParams [RelationParameters:: ALL_WORKS ] = $ allWorks ;
293293
294294 return $ relationParams ;
295295 }
0 commit comments