phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlReveal.php
Go to the documentation of this file.
1 <?php
2 
4 
10 
12 
13  public function __construct($identifier, $visibleContent,$hiddenContent,$type=RevealType::FADE,$attributeType=NULL) {
14  parent::__construct($identifier, "div", "ui reveal");
15  $this->setElement(0, $visibleContent);
16  $this->setElement(1, $hiddenContent);
17  $this->setType($type,$attributeType);
18  }
19 
20  private function setElement($index,$content){
21  if(!$content instanceof HtmlSingleElement){
22  $content=new HtmlLabel("",$content);
23  }
24  if($content instanceof HtmlSemDoubleElement){
25  $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content);
26  }elseif ($content instanceof HtmlImg){
27  $this->addToPropertyCtrl("class", "image", array("image"));
28  }
29  $content->addToProperty("class",(($index===0)?"visible":"hidden")." content");
30  $this->content[$index]=$content;
31  return $this;
32  }
33 
34  public function setVisibleContent($visibleContent){
35  return $this->setElement(0, $visibleContent);
36  }
37 
38  public function setHiddenContent($hiddenContent){
39  return $this->setElement(1, $hiddenContent);
40  }
41 
42  public function getVisibleContent(){
43  return $this->content[0];
44  }
45 
46  public function getHiddenContent(){
47  return $this->content[1];
48  }
49 
50  public function setType($type,$attribute=NULL){
51  $this->addToPropertyCtrl("class", $type, RevealType::getConstants());
52  if(isset($attribute)){
53  $this->addToPropertyCtrl("class", $attribute, Direction::getConstants());
54  }
55  return $this;
56  }
57 
58  public function setFade($attribute=NULL){
59  return $this->setType(RevealType::FADE,$attribute);
60  }
61 
62  public function setMove($attribute=NULL){
63  return $this->setType(RevealType::MOVE,$attribute);
64  }
65 
66  public function setRotate($attribute=NULL){
67  return $this->setType(RevealType::ROTATE,$attribute);
68  }
69 
70  public function setCircular(){
71  return $this->addToProperty("class", "circular");
72  }
73 
74 }
addToProperty($name, $value, $separator=" ")
static getConstants()
Definition: BaseEnum.php:17
Semantic Label component.
Definition: HtmlLabel.php:20
setType($type, $attribute=NULL)
Definition: HtmlReveal.php:50
__construct($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL)
Definition: HtmlReveal.php:13
Base class for Semantic double elements.
addToPropertyCtrl($name, $value, $typeCtrl)