[TASK] Rebuild extension translation list in lang module
[Packages/TYPO3.CMS.git] / typo3 / sysext / lang / Classes / ViewHelpers / Be / SpriteIconViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Lang\ViewHelpers\Be;
3 /***************************************************************
4 * Copyright notice
5 *
6 * (c) 2012 Kai Vogel <kai.vogel@speedprogs.de>
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 *
18 * This script is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * This copyright notice MUST APPEAR in all copies of the script!
24 ***************************************************************/
25
26 /**
27 * Sprite icon view helper
28 *
29 * Usage:
30 *
31 * {namespace myext=ENET\MyExt\ViewHelpers}
32 * <myext:be.spriteIcon icon="actions-document-close" title="Close" class="myClass" />
33 *
34 * @author Kai Vogel <kai.vogel@speedprogs.de>
35 * @package lang
36 * @subpackage ViewHelpers
37 */
38 class SpriteIconViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper {
39
40 /**
41 * Renders an icon as known from the TYPO3 backend
42 *
43 * @param string $icon Icon to be used
44 * @param string $title Title attribte
45 * @param string $class Class attribte
46 * @return string the rendered icon
47 */
48 public function render($icon, $title = '', $class = '') {
49 $options = array(
50 'title' => $title,
51 'class' => $class,
52 );
53 return \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon($icon, $options);
54 }
55
56 }
57 ?>