[TASK] Re-work/simplify copyright header in PHP files - Part 1
[Packages/TYPO3.CMS.git] / typo3 / sysext / sys_note / Classes / Controller / NoteController.php
1 <?php
2 namespace TYPO3\CMS\SysNote\Controller;
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
17 /**
18 * Note controller
19 *
20 * @author Kai Vogel <kai.vogel@speedprogs.de>
21 */
22 class NoteController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
23
24 /**
25 * @var \TYPO3\CMS\SysNote\Domain\Repository\SysNoteRepository
26 * @inject
27 */
28 protected $sysNoteRepository;
29
30 /**
31 * @var \TYPO3\CMS\Extbase\Domain\Repository\BackendUserRepository
32 * @inject
33 */
34 protected $backendUserRepository;
35
36 /**
37 * Render notes by single PID or PID list
38 *
39 * @param string $pids Single PID or comma separated list of PIDs
40 * @return string
41 * @dontvalidate $pids
42 */
43 public function listAction($pids) {
44 if (empty($pids) || empty($GLOBALS['BE_USER']->user['uid'])) {
45 return '';
46 }
47 $author = $this->backendUserRepository->findByUid($GLOBALS['BE_USER']->user['uid']);
48 $notes = $this->sysNoteRepository->findByPidsAndAuthor($pids, $author);
49 $this->view->assign('notes', $notes);
50 }
51
52 }