[BUGFIX] Update extension scanner docs.typo3.org link
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Classes / Browser / RecordBrowser.php
1 <?php
2 declare(strict_types = 1);
3 namespace TYPO3\CMS\Recordlist\Browser;
4
5 /*
6 * This file is part of the TYPO3 CMS project.
7 *
8 * It is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, either version 2
10 * of the License, or any later version.
11 *
12 * For the full copyright and license information, please read the
13 * LICENSE.txt file that was distributed with this source code.
14 *
15 * The TYPO3 project - inspiring people to share!
16 */
17
18 /**
19 * Extends the DatabaseBrowser for the specific needs of the LinkBrowser.
20 *
21 * Mostly this is about being able to set to some parameters that cannot
22 * be set from outside the DatabaseBrowser.
23 */
24 class RecordBrowser extends DatabaseBrowser
25 {
26 /**
27 * @var array
28 */
29 protected $urlParameters = [];
30
31 /**
32 * Main initialization
33 */
34 protected function initialize()
35 {
36 $this->determineScriptUrl();
37 $this->initVariables();
38 }
39
40 /**
41 * Avoid any initialization
42 */
43 protected function initVariables()
44 {
45 }
46
47 /**
48 * @param int $selectedPage Id of page
49 * @param string $tables Comma separated list of tables
50 * @param array $urlParameters url parameters
51 *
52 * @return string
53 */
54 public function displayRecordsForPage(int $selectedPage, string $tables, array $urlParameters): string
55 {
56 $this->urlParameters = $urlParameters;
57 $this->urlParameters['mode'] = 'db';
58 $this->expandPage = $selectedPage;
59
60 return $this->renderTableRecords($tables);
61 }
62
63 /**
64 * @param array $values Array of values to include into the parameters
65 * @return string[] Array of parameters which have to be added to URLs
66 */
67 public function getUrlParameters(array $values): array
68 {
69 return array_merge($this->urlParameters, $values);
70 }
71 }