TYPO3  7.6
ProcessAvailableActionsViewHelper.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
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 
23 {
24  const SIGNAL_ProcessActions = 'processActions';
25 
30 
34  public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher)
35  {
36  $this->signalSlotDispatcher = $signalSlotDispatcher;
37  }
38 
45  public function render($extension)
46  {
47  $html = $this->renderChildren();
48  $actions = preg_split('#\\n\\s*#s', trim($html));
49 
50  $actions = $this->emitProcessActionsSignal($extension, $actions);
51 
52  return implode(' ', $actions);
53  }
54 
62  protected function emitProcessActionsSignal($extension, array $actions)
63  {
64  $this->signalSlotDispatcher->dispatch(
65  __CLASS__,
66  static::SIGNAL_ProcessActions,
67  array(
68  $extension,
69  &$actions,
70  )
71  );
72  return $actions;
73  }
74 }