public function __construct(array $attributes = array()) { parent::__construct($attributes); $this->addClass('panel'); if ($this->hasAttribute('THEME')) { $this->ignoreAttribute('THEME'); switch ($this->getAttribute('THEME')) { case 'default': $this->addClass('panel-default'); break; case 'primary': $this->addClass('panel-primary'); break; case 'success': $this->addClass('panel-success'); break; case 'info': $this->addClass('panel-info'); break; case 'warning': $this->addClass('panel-warning'); break; case 'danger': $this->addClass('panel-danger'); break; } } }
public function __construct(array $attributes = array()) { parent::__construct($attributes); if ($this->hasAttribute('HREF')) { $this->setTagName('A'); } $this->addClass('thumbnail'); }
public function __construct(array $attributes = array()) { parent::__construct($attributes); if (!$this->hasAttribute('ID')) { $this->setAttribute('ID', 'xtpl-bootstrap-carousel-' . $this->getUniqueId()); } $this->ignoreAttribute('CONTROLS', 'INDICATORS', 'ICON-LEFT', 'ICON-RIGHT'); $this->addClass('carousel slide'); }
public function __construct(array $attributes = array()) { parent::__construct($attributes); if (!$this->hasAttribute('NAME')) { throw new \Exception("Modals need a name attribute!"); } $this->addClass('modal fade'); $this->ignoreAttribute('NAME'); $this->setAttribute('ID', 'xtpl-bootstrap-modal-' . $this->getAttribute('NAME')); $this->setAttribute('ROLE', 'dialog'); $this->setAttribute('ARIA-HIDDEN', 'true'); }
public function __construct(array $attributes = array()) { parent::__construct($attributes); $this->addClass('progress'); if ($this->hasAttribute('THEME')) { $styles = explode(' ', $this->getAttribute('THEME')); foreach ($styles as $style) { switch ($style) { case 'striped': $this->addClass('progress-striped'); break; case 'active': $this->addClass('active'); break; } } } }
public function __construct(array $attributes = array()) { parent::__construct($attributes); $this->addClass('well'); if ($this->hasAttribute('SIZE')) { $size = $this->getAttribute('SIZE'); $this->ignoreAttribute('SIZE'); switch ($size) { case 'large': case 'lg': $this->addClass('well-lg'); break; case 'small': case 'sm': $this->addClass('well-sm'); break; } } }
public function __construct(array $attributes = array()) { parent::__construct($attributes); foreach ($this->sizes as $size => $alt) { foreach ($this->modes as $mode) { $attr = strtoupper("{$mode}{$size}"); $altAttr = strtoupper("{$mode}{$alt}"); $val = ''; if ($this->hasAttribute($attr)) { $val = $this->getAttribute($attr); $this->ignoreAttribute($attr); } else { if ($this->hasAttribute($altAttr)) { $val = $this->getAttribute($altAttr); $this->ignoreAttribute($altAttr); } } if (!empty($val)) { $this->addClass("col-{$size}-{$mode}{$val}"); } } } }
public function __construct(array $attributes = array()) { parent::__construct($attributes); $this->addClass('row'); }
public function __construct(array $attributes = array()) { parent::__construct($attributes); }