18 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
19 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
20 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
59 use CompileWithContentArgumentAndRenderStatic;
81 $this->registerArgument(
'message',
'string',
'The message of the info box, if NULL tag content is used');
82 $this->registerArgument(
'title',
'string',
'The title of the info box');
83 $this->registerArgument(
'state',
'int',
'The state of the box, InfoboxViewHelper::STATE_*',
false, self::STATE_NOTICE);
84 $this->registerArgument(
'iconName',
'string',
'The icon name from font awesome, NULL sets default icon');
85 $this->registerArgument(
'disableIcon',
'bool',
'If set to TRUE, the icon is not rendered.',
false,
false);
95 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
97 $title = $arguments[
'title'];
98 $message = $renderChildrenClosure();
99 $state = $arguments[
'state'];
105 $iconName = $arguments[
'iconName'];
106 $disableIcon = $arguments[
'disableIcon'];
108 self::STATE_NOTICE =>
'notice',
109 self::STATE_INFO =>
'info',
110 self::STATE_OK =>
'success',
111 self::STATE_WARNING =>
'warning',
112 self::STATE_ERROR =>
'danger'
115 self::STATE_NOTICE =>
'lightbulb-o',
116 self::STATE_INFO =>
'info',
117 self::STATE_OK =>
'check',
118 self::STATE_WARNING =>
'exclamation',
119 self::STATE_ERROR =>
'times'
121 $stateClass = $classes[$state];
123 if ($iconName !==
null) {
129 '<div class="media-left">' .
130 '<span class="fa-stack fa-lg callout-icon">' .
131 '<i class="fa fa-circle fa-stack-2x"></i>' .
132 '<i class="fa fa-' . htmlspecialchars($icon) .
' fa-stack-1x"></i>' .
137 if ($title !==
null) {
138 $titleTemplate =
'<h4 class="callout-title">' . htmlspecialchars($title) .
'</h4>';
140 return '<div class="callout callout-' . htmlspecialchars($stateClass) .
'">' .
141 '<div class="media">' .
143 '<div class="media-body">' .
145 '<div class="callout-body">' . $message .
'</div>' .