/** * 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; }
/** * 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")); }
/** * 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")); }
/** * 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")); }