2 namespace TYPO3\CMS\Scheduler\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!
17 use TYPO3\CMS\Backend\Utility\BackendUtility
;
18 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
;
19 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
;
20 use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
;
23 * Create internal link within backend app
26 class ModuleLinkViewHelper
extends AbstractViewHelper
implements CompilableInterface
{
29 * Render module link with command and arguments
31 * @param string $controller The "controller" of scheduler. Possible values are "scheduler", "check", "info"
32 * @param string $action The action to be called within each controller
33 * @param array $arguments Arguments for the action
36 public function render($controller, $action, array $arguments = array()) {
37 return static::renderStatic(
39 'controller' => $controller,
41 'arguments' => $arguments,
43 $this->buildRenderChildrenClosure(),
44 $this->renderingContext
49 * @param array $arguments
50 * @param callable $renderChildrenClosure
51 * @param RenderingContextInterface $renderingContext
55 static public function renderStatic(array $arguments, \Closure
$renderChildrenClosure, RenderingContextInterface
$renderingContext) {
56 $moduleArguments = array();
57 $moduleArguments['SET']['function'] = $arguments['controller'];
58 $moduleArguments['CMD'] = $arguments['action'];
59 if (!empty($arguments['arguments'])) {
60 $moduleArguments['tx_scheduler'] = $arguments['arguments'];
63 return BackendUtility
::getModuleUrl('system_txschedulerM1', $moduleArguments);