984b02bd353952b58223b8e9b981647505b727af
[Packages/TYPO3.CMS.git] / typo3 / sysext / scheduler / Classes / ViewHelpers / ModuleLinkViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Scheduler\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
17 use TYPO3\CMS\Backend\Utility\BackendUtility;
18 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
19
20 /**
21 * Create internal link within backend app
22 * @internal
23 */
24 class ModuleLinkViewHelper extends AbstractViewHelper {
25
26 /**
27 * Render module link with command and arguments
28 *
29 * @param string $controller The "controller" of scheduler. Possible values are "scheduler", "check", "info"
30 * @param string $action The action to be called within each controller
31 * @param array $arguments Arguments for the action
32 * @return string
33 */
34 public function render($controller, $action, array $arguments = array()) {
35 $moduleArguments = array();
36 $moduleArguments['SET']['function'] = $controller;
37 $moduleArguments['CMD'] = $action;
38 if (!empty($arguments)) {
39 $moduleArguments['tx_scheduler'] = $arguments;
40 }
41
42 return BackendUtility::getModuleUrl('system_txschedulerM1', $moduleArguments);
43 }
44
45 }