2 namespace TYPO3\CMS\Extensionmanager\ViewHelpers
;
5 * This file is part of the TYPO3 CMS project.
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.
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
14 * The TYPO3 project - inspiring people to share!
18 * View helper to let 3rd-party extensions process the list of available
19 * actions for a given extension.
21 * @author Xavier Perseguers <xavier@typo3.org>
23 class ProcessAvailableActionsViewHelper
extends \TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper
{
25 const SIGNAL_ProcessActions
= 'processActions';
28 * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
31 protected $signalSlotDispatcher;
34 * Processes the list of actions.
36 * @param string $extension
37 * @return string the rendered list of actions
39 public function render($extension) {
40 $html = $this->renderChildren();
41 $actions = preg_split('#\\n\\s*#s', trim($html));
43 $actions = $this->emitProcessActionsSignal($extension, $actions);
45 return implode(' ', $actions);
49 * Emits a signal after the list of actions is processed
51 * @param string $extension
52 * @param array $actions
53 * @return array Modified action array
55 protected function emitProcessActionsSignal($extension, array $actions) {
56 $signalArguments = $this->signalSlotDispatcher
->dispatch(
58 static::SIGNAL_ProcessActions
,
64 return $signalArguments[1];