24 parent::__construct(
$identifier,
'div',
'ui modal');
31 if (isset($actions)) {
37 $this->content[
'header'] =
new HtmlSemDoubleElement(
'header-' . $this->identifier,
'a',
'header', $value);
42 $this->content[
'content'] =
new HtmlSemDoubleElement(
'content-' . $this->identifier,
'div',
'content', $value);
53 $this->content[
'actions'] = new
HtmlSemDoubleElement(
'content-' . $this->identifier,
'div',
'actions');
55 if (\is_array($actions)) {
56 foreach ($actions as $action) {
73 if (\array_search($action, [
80 if (\array_search($action, [
87 $action =
new HtmlButton(
'action-' . $this->identifier .
'-' . JArray::count($this->content[
'actions']->getContent()), $action);
89 $action->addToProperty(
'class', $class);
91 return $this->addElementInPart($action,
'actions');
100 return $this->content[
'actions']->getContent()[$index];
104 $this->content[
'content']->addContent($content, $before);
109 $content = $this->content[
'content'];
110 if (isset($description)) {
111 $description =
new HtmlSemDoubleElement(
'description-' . $this->identifier,
'div',
'description', $description);
112 $content->addContent($description,
true);
115 $img =
new HtmlImage(
'image-' . $this->identifier, $image,
'',
'medium');
116 $content->addContent($img,
true);
117 $content->addToProperty(
'class',
'image');
123 $content = $this->content[
'content'];
124 if (isset($description)) {
125 $description =
new HtmlSemDoubleElement(
'description-' . $this->identifier,
'div',
'description', $description);
126 $content->addContent($description,
true);
129 $img =
new HtmlIcon(
'image-' . $this->identifier, $icon);
130 $content->addContent($img,
true);
131 $content->addToProperty(
'class',
'image');
137 $this->content[$part]->addContent($element);
142 $value = $value ?
'show' :
'hide';
143 $this->_paramParts[] = [
144 "'" . $value .
" dimmer'"
150 $this->_params[
'inverted'] =
true;
155 return $this->addToProperty(
'class',
'basic');
159 $this->_paramParts[] = [
176 return $this->setContent($js->
renderContent($initialController, $viewName, $params));
190 public function forward(
JsUtils $js, $initialControllerInstance, $controllerName, $actionName, $params = NULL) {
191 return $this->setContent($js->
forward($initialControllerInstance, $controllerName, $actionName, $params));
201 $this->content = JArray::sortAssociative($this->content, [
206 if (isset($this->_params[
'inverted']) && $this->_params[
'inverted']) {
207 parent::setInverted(
true);
209 return parent::compile($js, $view);
217 if (isset($this->_bsComponent) ===
false)
218 $this->_bsComponent = $js->
semantic()->modal(
'#' . $this->identifier, $this->_params, $this->_paramParts);
219 $this->addEventsOnRun($js);
220 return $this->_bsComponent;
223 public function jsDo($behavior) {
224 return "$('#" . $this->identifier .
"').modal('" . $behavior .
"');";
228 return $this->jsDo(
'hide');
232 $this->_params[
'onHidden'] = $js;
forward($initialController, $controller, $action, $params)
Forwards to.
renderContent($initialControllerInstance, $viewName, $params=NULL)
render the content of an existing view : $viewName and set the response to the modal content Used int...
semantic(Semantic $semantic=NULL)
getter or setter of the Semantic-UI variable
BaseHtml for HTML components.
Base class for Semantic double elements.
Semantic Image component.
addElementInPart($element, $part)
run(JsUtils $js)
{{SimpleExtComponent\Ajax\common\html\BaseHtmlrun()\Ajax\common\html\BaseHtmlrun()}HtmlDoubleElement:...
renderView(JsUtils $js, $initialController, $viewName, $params=array())
render the content of an existing view : $controller/$action and set the response to the modal conten...
__construct($identifier, $header='', $content='', $actions=null)
setInverted($recursive=true)
can be formatted to appear on dark backgrounds
setActions($actions)
Adds the modal actions (buttons).
compile(JsUtils $js=NULL, &$view=NULL)
{{}BaseHtml::compile()}
addImageContent($image, $description=NULL)
forward(JsUtils $js, $initialControllerInstance, $controllerName, $actionName, $params=NULL)
render the content of
addContent($content, $before=false)
addIconContent($icon, $description=NULL)