|
9 | 9 |
|
10 | 10 | use PhpMyAdmin\ConfigStorage\Relation; |
11 | 11 | use PhpMyAdmin\Container\ContainerBuilder; |
12 | | -use PhpMyAdmin\Favorites\RecentFavoriteTable; |
13 | | -use PhpMyAdmin\Favorites\RecentFavoriteTables; |
14 | | -use PhpMyAdmin\Favorites\TableType; |
15 | 12 | use PhpMyAdmin\Html\Generator; |
16 | | -use PhpMyAdmin\Identifiers\DatabaseName; |
17 | | -use PhpMyAdmin\Identifiers\TableName; |
18 | 13 | use PhpMyAdmin\Navigation\Navigation; |
19 | 14 | use PhpMyAdmin\Theme\ThemeManager; |
20 | 15 |
|
@@ -252,22 +247,10 @@ public function disableWarnings(): void |
252 | 247 | */ |
253 | 248 | public function getDisplay(): string |
254 | 249 | { |
255 | | - if ($this->headerIsSent || ! $this->isEnabled) { |
| 250 | + if ($this->headerIsSent || ! $this->isEnabled || $this->isAjax) { |
256 | 251 | return ''; |
257 | 252 | } |
258 | 253 |
|
259 | | - $recentTable = ''; |
260 | | - if (empty($_REQUEST['recent_table']) && Current::$table !== '') { |
261 | | - $recentTable = $this->addRecentTable( |
262 | | - DatabaseName::from(Current::$database), |
263 | | - TableName::from(Current::$table), |
264 | | - ); |
265 | | - } |
266 | | - |
267 | | - if ($this->isAjax) { |
268 | | - return $recentTable; |
269 | | - } |
270 | | - |
271 | 254 | $this->sendHttpHeaders(); |
272 | 255 |
|
273 | 256 | $baseDir = defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : ''; |
@@ -359,7 +342,6 @@ public function getDisplay(): string |
359 | 342 | 'menu' => $menu ?? '', |
360 | 343 | 'console' => $console, |
361 | 344 | 'messages' => $messages, |
362 | | - 'recent_table' => $recentTable, |
363 | 345 | 'theme_color_mode' => $theme->getColorMode(), |
364 | 346 | 'theme_color_modes' => $theme->getColorModes(), |
365 | 347 | 'theme_id' => $theme->getId(), |
@@ -580,24 +562,6 @@ private function getCspHeaders(): array |
580 | 562 | return $headers; |
581 | 563 | } |
582 | 564 |
|
583 | | - /** |
584 | | - * Add recently used table and reload the navigation. |
585 | | - */ |
586 | | - private function addRecentTable(DatabaseName $db, TableName $table): string |
587 | | - { |
588 | | - if ($this->menuEnabled && $this->config->settings['NumRecentTables'] > 0) { |
589 | | - $favoriteTable = new RecentFavoriteTable($db, $table); |
590 | | - $error = RecentFavoriteTables::getInstance(TableType::Recent)->add($favoriteTable); |
591 | | - if ($error === true) { |
592 | | - return RecentFavoriteTables::getHtmlUpdateRecentTables(); |
593 | | - } |
594 | | - |
595 | | - return $error->getDisplay(); |
596 | | - } |
597 | | - |
598 | | - return ''; |
599 | | - } |
600 | | - |
601 | 565 | /** |
602 | 566 | * Returns the phpMyAdmin version to be appended to the url to avoid caching |
603 | 567 | * between versions |
|
0 commit comments