18 protected $_variations=[ ];
28 abstract public function addToProperty($name, $value, $separator=
" ");
30 abstract public function setProperty($name, $value);
32 abstract public function addContent($content,$before=
false);
34 abstract public function onCreate($jsCode);
37 return $this->_self->addToPropertyCtrlCheck(
"class", $variation, $this->_self->getVariations());
41 return $this->_self->addToPropertyCtrlCheck(
"class", $state, $this->_self->getStates());
45 $this->_self->setPropertyCtrl(
"class", $variation, $this->_self->getVariations());
46 return $this->_self->addToProperty(
"class", $this->_self->getBaseClass());
50 $this->_self->setProperty(
"class", $this->_self->getBaseClass());
51 if (\is_string($variations))
52 $variations=\explode(
" ", $variations);
53 foreach ( $variations as $variation ) {
54 $this->_self->addVariation($variation);
60 $this->_self->setPropertyCtrl(
"class", $state, $this->_self->getStates());
61 return $this->_self->addToProperty(
"class", $this->_self->getBaseClass());
65 if (\is_string($variations))
66 $variations=\explode(
" ", $variations);
67 foreach ( $variations as $variation ) {
68 $this->_self->addVariation($variation);
74 if (\is_string($states))
75 $states=\explode(
" ", $states);
76 foreach ( $states as $state ) {
77 $this->_self->addState($state);
83 $this->_self->setProperty(
"class", $this->_self->getBaseClass());
84 if (\is_string($states))
85 $states=\explode(
" ", $states);
86 foreach ( $states as $state ) {
87 $this->_self->addState($state);
92 public function addIcon($icon, $before=
true) {
93 return $this->_self->addContent(
new HtmlIcon(
"icon-" . $this->_self->getIdentifier(), $icon), $before);
97 $this->_self->onCreate(
"$('#".$this->_self->getIdentifier().
"').sticky({ context: '".$context.
"'});");
118 $this->_self->addToProperty(
"class",
"disabled");
136 return $this->_self->addToProperty(
"class",
"fluid");
144 return $this->_self->addToProperty(
"class",
"header");
153 $this->_self->addToProperty(
"class",
"active");
159 $this->_self->addToPropertyCtrl(
"class",
"attached", array (
"attached" ));
167 if($recursive===
true){
168 $content=$this->_self->getContent();
170 $content->setInverted($recursive);
171 elseif(\is_array($content) || $content instanceof \Traversable){
172 foreach ($content as $elm){
173 if($elm instanceof HtmlSemDoubleElement){
174 $elm->setInverted($recursive);
179 return $this->_self->addToProperty(
"class",
"inverted");
183 return $this->_self->addToProperty(
"class",
"circular");
191 return $this->_self->setFloated();
195 return $this->_self->setFloated(
"left");
202 protected function addBehavior(&$array,$key,$value,$before=
"",$after=
""){
203 if(\is_string($value)){
204 if(isset($array[$key])){
206 $array[$key]=$before.$p.$value.$after;
208 $array[$key]=$before.$value.$after;
216 return $this->_variations;
addSticky($context="body")
addToPropertyCtrlCheck($name, $value, $typeCtrl)
static replaceAtFirstAndLast($subject, $fromFirst, $toFirst, $fromLast, $toLast)
setActive($value=true)
show it is currently the active user selection
setFloated($direction="right")
setVariations($variations)
addToProperty($name, $value, $separator=" ")
static getConstantValues($postFix="", $prefixBefore=false)
Base class for Semantic double elements.
addBehavior(&$array, $key, $value, $before="", $after="")
addStates($states=array())
addVariations($variations=array())
setProperty($name, $value)
setDisabled($disable=true)
show it is currently unable to be interacted with
addToPropertyCtrl($name, $value, $typeCtrl)
addIcon($icon, $before=true)
setPropertyCtrl($name, $value, $typeCtrl)
setInverted($recursive=true)
can be formatted to appear on dark backgrounds
addContent($content, $before=false)