示例#1
0
 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;
         }
     }
 }
示例#2
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if ($this->hasAttribute('HREF')) {
         $this->setTagName('A');
     }
     $this->addClass('thumbnail');
 }
示例#3
0
 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');
 }
示例#4
0
 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');
 }
示例#5
0
 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;
             }
         }
     }
 }
示例#6
0
 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;
         }
     }
 }
示例#7
0
 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}");
             }
         }
     }
 }
示例#8
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     $this->addClass('row');
 }
示例#9
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
 }