15 parent::__construct(
$identifier,
"div",
"content",[]);
20 if (\is_array($value)) {
21 $header=JArray::getValue($value,
"header", 0);
22 $metas=JArray::getValue($value,
"metas", 1);
23 $description=JArray::getValue($value,
"description", 2);
24 $image=JArray::getValue($value,
"image", 3);
25 $extra=JArray::getValue($value,
"extra", 4);
35 $count=\sizeof($this->content);
37 $result->setClass($baseClass);
42 public function addMeta($value, $direction=Direction::LEFT) {
43 if (\array_key_exists(
"meta", $this->content) ===
false) {
44 $this->content[
"meta"]=
new HtmlSemDoubleElement(
"meta-" . $this->identifier,
"div",
"meta", array ());
46 if ($direction === Direction::RIGHT) {
48 $value->setFloated($direction);
50 $this->content[
"meta"]->addContent($value);
51 return $this->content[
"meta"];
55 if (\array_key_exists(
"extra", $this->content) ===
false) {
56 $this->content[
"extra"]=
new HtmlSemDoubleElement(
"extra-" . $this->identifier,
"div",
"extra", array ());
58 $this->content[
"extra"]->addContent($value);
59 return $this->content[
"extra"];
62 public function addImage($src=
"", $alt=
"", $size=NULL) {
63 $image=
new HtmlImg(
"img-", $src, $alt);
65 $image->setSize($size);
66 $this->content[
'image']=$image;
77 public function addContentButtons($elements=array(), $asIcons=
false,$part=
"extra",$before=
false){
78 $buttons=
new HtmlButtonGroups(
"buttons-".$this->identifier,$elements,$asIcons);
84 if (\is_array($metas)) {
85 foreach ( $metas as $meta ) {
93 public function addContentIcon($icon, $caption=NULL, $direction=Direction::LEFT) {
94 if ($direction === Direction::RIGHT) {
95 if (isset($caption)) {
97 $result->addIcon($icon);
103 $result->setFloated($direction);
112 if ($direction === Direction::RIGHT) {
115 $result->setFloated($direction);
122 foreach ( $icons as $icon ) {
132 if (isset($description)) {
133 $this->
addElement($description,
"description");
142 return parent::compile($js, $view);
addContent($content, $before=false)
Base class for Semantic double elements.
addIcon($icon, $before=true)
addElementInPart($element, $partKey, $before=false, $force=false)
addImage($src="", $alt="", $size=NULL)
addMeta($value, $direction=Direction::LEFT)
__construct($identifier, $content=array())
compile(JsUtils $js=NULL, &$view=NULL)
{{}BaseHtml::compile()}
addElement($content, $baseClass="")
addContentButtons($elements=array(), $asIcons=false, $part="extra", $before=false)
addContentIcons($icons, $direction=Direction::LEFT)
addContentText($caption, $direction=Direction::LEFT)
addHeaderContent($header, $metas=array(), $description=NULL, $extra=NULL)
addContentIcon($icon, $caption=NULL, $direction=Direction::LEFT)