/**
  * define the button size
  * available values : "btn-lg","","btn-sm","btn-xs"
  * @param string|int $size
  * @return \Ajax\bootstrap\html\HtmlButton default : ""
  */
 public function setSize($size)
 {
     if (is_int($size)) {
         return $this->addToPropertyUnique("class", CssRef::sizes()[$size], CssRef::sizes());
     }
     return $this->addToPropertyCtrl("class", $size, CssRef::sizes());
 }
 /**
  * (non-PHPdoc)
  * @see \Ajax\bootstrap\html\HtmlDropdown::setSize()
  * @return HtmlSplitbutton
  */
 public function setSize($size)
 {
     if (is_int($size)) {
         return $this->addToMember($this->mClass, CssRef::sizes("btn-group")[$size]);
     }
     return $this->addToMemberCtrl($this->mClass, $size, CssRef::sizes("btn-group"));
 }
 /**
  * define the Panel style
  * avaible values : "list-group-item-default","list-group-item-primary","list-group-item-success","list-group-item-info","list-group-item-warning","list-group-item-danger"
  * @param string|int $cssStyle
  * @return \Ajax\bootstrap\html\HtmlListgroupItem default : "list-group-item-default"
  */
 public function setStyle($cssStyle)
 {
     if (!PhalconUtils::startsWith($cssStyle, "list-group-item")) {
         $cssStyle = "list-group-item" . $cssStyle;
     }
     $this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item"));
     return $this->element;
 }
 /**
  * return a valid style
  * avaible values : "default","primary","success","info","warning","danger"
  * @param string|int $cssStyle
  * @return string
  */
 public static function getStyle($cssStyle, $prefix)
 {
     if (is_int($cssStyle)) {
         $styles = CssRef::Styles($prefix);
         if ($cssStyle < sizeof($styles) && $cssStyle >= 0) {
             return CssRef::styles($prefix)[$cssStyle];
         } else {
             throw new \Exception("La valeur passée a propriété `Style` ne fait pas partie des valeurs possibles : index '" . $cssStyle . "' inexistant");
         }
     }
     if (PhalconUtils::startsWith($cssStyle, "-") === true) {
         $cssStyle = substr($cssStyle, 1);
     }
     if (PhalconUtils::startsWith($cssStyle, $prefix) === false) {
         $cssStyle = $prefix . "-" . $cssStyle;
     }
     return $cssStyle;
 }
 public function setAlignment($alignment)
 {
     if (is_int($alignment)) {
         $alignment = "dropdown-menu-" . CssRef::alignment()[$alignment];
     }
     return $this->addToMemberCtrl($this->class, $alignment, CssRef::alignment());
 }
 /**
  * define the progressbar style
  * avaible values : "success","info","warning","danger"
  * @param string|int $cssStyle
  * @return \Ajax\bootstrap\html\HtmlProgressbar default : ""
  */
 public function setStyle($cssStyle)
 {
     return $this->setMemberCtrl($this->style, CssRef::getStyle($cssStyle, "progress-bar"), CssRef::Styles("progress-bar"));
 }
 public function setLeftGlyph($glyphicon)
 {
     $glyphs = CssRef::glyphIcons();
     if (array_search($glyphicon, $glyphs) !== false) {
         $this->_glyphs["left"] = $glyphicon;
     }
 }
Beispiel #8
0
 /**
  * define the alert style
  * avaible values : "alert-success","alert-info","alert-warning","alert-danger"
  * @param string|int $cssStyle
  * @return \Ajax\bootstrap\html\HtmlAlert default : "alert-success"
  */
 public function setStyle($cssStyle)
 {
     return $this->addToPropertyCtrl("class", CssRef::getStyle($cssStyle, "alert"), CssRef::Styles("alert"));
 }
Beispiel #9
0
 public function setClass($value)
 {
     $this->setMemberCtrl($this->class, $value, CssRef::navbarZoneClasses());
 }
 public function setAlignment($value)
 {
     if (is_int($value)) {
         $value = CssRef::alignment("btn-group")[$value];
     } else {
         $value = "btn-group-" . $value;
     }
     if (strstr($value, "justified")) {
         foreach ($this->elements as $element) {
             $element->wrap('<div class="btn-group" role="group">', '</div>');
         }
     }
     $this->addToPropertyCtrl("class", $value, CssRef::alignment("btn-group-"));
 }
Beispiel #11
0
 /**
  * How to position the tooltip - top | bottom | left | right | auto.
  * When "auto" is specified, it will dynamically reorient the tooltip.
  * For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right.
  * When a function is used to determine the placement,
  * it is called with the tooltip DOM node as its first argument and the triggering element DOM node as its second.
  * The this context is set to the tooltip instance.
  * @param string $value
  * @return $this default : top
  */
 public function setPlacement($value)
 {
     return $this->setParamCtrl("placement", $value, CssRef::position());
 }
Beispiel #12
0
 /**
  * define the Panel style
  * avaible values : "panel-default","panel-primary","panel-success","panel-info","panel-warning","panel-danger"
  * @param string|int $cssStyle
  * @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default"
  */
 public function setStyle($cssStyle)
 {
     if (!PhalconUtils::startsWith($cssStyle, "panel")) {
         $cssStyle = "panel" . $cssStyle;
     }
     return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel"));
 }
 /**
  * define the buttons size
  * available values : "lg","","sm","xs"
  * @param string|int $size
  * @return HtmlPagination default : ""
  */
 public function setSize($size)
 {
     if (is_int($size)) {
         return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
     }
     if (!PhalconUtils::startsWith($size, "pagination-") && $size !== "") {
         $size = "pagination-" . $size;
     }
     return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
 }