TYPO3  7.6
PagesViewHelper.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
20 
26 {
33  public function render($uids = '')
34  {
35  return static::renderStatic(
36  array(
37  'uids' => $uids,
38  ),
40  $this->renderingContext
41  );
42  }
43 
52  {
53  $uids = $arguments['uids'];
54  if (!$uids) {
55  return '';
56  }
57 
58  $content = '';
59  $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
60  'uid, title',
61  'pages',
62  'uid IN (' . $GLOBALS['TYPO3_DB']->cleanIntList($uids) . ')',
63  'uid ASC'
64  );
65  while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
66  $content .= '<li>' . htmlspecialchars($row['title']) . ' [' . htmlspecialchars($row['uid']) . ']</li>';
67  }
68  $GLOBALS['TYPO3_DB']->sql_free_result($res);
69  return '<ul>' . $content . '</ul>';
70  }
71 }