[TASK] Simplify rendering in EXT:scheduler
[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 /**
18 * Create internal link within backend app
19 * @TODO: Later I want to be an AbstractTagBasedViewHelper
20 */
21 class ModuleLinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
22
23 /**
24 * Generate module link
25 *
26 * @param string $function
27 * @param string $cms
28 * @param array $arguments
29 * @return string
30 */
31 public function render($function = '', $cmd = '', array $arguments = array()) {
32 $link = $GLOBALS['MCONF']['_'] . '&SET[function]=' . $function . '&CMD=' . $cmd;
33
34 if (!empty($arguments)) {
35 foreach ($arguments as $key => $value) {
36 $link .= '&tx_scheduler[' . $key . ']=' . $value;
37 }
38 }
39
40 return htmlspecialchars($link);
41 }
42
43 }