‪TYPO3CMS  9.5
ProcessAvailableActionsViewHelper.php
Go to the documentation of this file.
1 <?php
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 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
18 
24 class ‪ProcessAvailableActionsViewHelper extends AbstractTagBasedViewHelper
25 {
26  const ‪SIGNAL_ProcessActions = 'processActions';
27 
31  protected ‪$signalSlotDispatcher;
32 
36  public function ‪injectSignalSlotDispatcher(\‪TYPO3\CMS\‪Extbase\SignalSlot\Dispatcher ‪$signalSlotDispatcher)
37  {
38  $this->signalSlotDispatcher = ‪$signalSlotDispatcher;
39  }
40 
44  public function ‪initializeArguments()
45  {
46  parent::initializeArguments();
47  $this->registerArgument('extension', 'string', '', true);
48  }
49 
55  public function ‪render()
56  {
57  $extension = $this->arguments['extension'];
58  $html = $this->renderChildren();
59  $actions = preg_split('#\\n\\s*#s', trim($html));
60 
61  $actions = $this->‪emitProcessActionsSignal($extension, $actions);
62 
63  return implode(' ', $actions);
64  }
65 
73  protected function ‪emitProcessActionsSignal($extension, array $actions)
74  {
75  $this->signalSlotDispatcher->dispatch(
76  __CLASS__,
77  static::SIGNAL_ProcessActions,
78  [
79  $extension,
80  &$actions,
81  ]
82  );
83  return $actions;
84  }
85 }
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ProcessAvailableActionsViewHelper\$signalSlotDispatcher
‪TYPO3 CMS Extbase SignalSlot Dispatcher $signalSlotDispatcher
Definition: ProcessAvailableActionsViewHelper.php:30
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ProcessAvailableActionsViewHelper\render
‪string render()
Definition: ProcessAvailableActionsViewHelper.php:54
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ProcessAvailableActionsViewHelper
Definition: ProcessAvailableActionsViewHelper.php:25
‪TYPO3
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ProcessAvailableActionsViewHelper\SIGNAL_ProcessActions
‪const SIGNAL_ProcessActions
Definition: ProcessAvailableActionsViewHelper.php:26
‪TYPO3\CMS\Extensionmanager\ViewHelpers
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ProcessAvailableActionsViewHelper\injectSignalSlotDispatcher
‪injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher)
Definition: ProcessAvailableActionsViewHelper.php:35
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ProcessAvailableActionsViewHelper\emitProcessActionsSignal
‪array emitProcessActionsSignal($extension, array $actions)
Definition: ProcessAvailableActionsViewHelper.php:72
‪TYPO3\CMS\Extensionmanager\ViewHelpers\ProcessAvailableActionsViewHelper\initializeArguments
‪initializeArguments()
Definition: ProcessAvailableActionsViewHelper.php:43