Esempio n. 1
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('A', $attributes);
 }
Esempio n. 2
0
 public function __construct($tagName, array $attributes = array())
 {
     parent::__construct($tagName, $attributes);
     $this->ignoreAttribute(array('PULL', 'VISIBLE', 'HIDDEN', 'TEXT-ALIGN', 'TEXT-THEME'));
     //Responsive utilities
     if ($this->hasAttribute('VISIBLE')) {
         $visible = explode(' ', $this->getAttribute('VISIBLE'));
         foreach ($visible as $v) {
             switch ($v) {
                 case 'xs':
                 case 'phone':
                     $this->addClass('visible-xs');
                     break;
                 case 'sm':
                 case 'tablet':
                     $this->addClass('visible-sm');
                     break;
                 case 'md':
                 case 'desktop':
                     $this->addClass('visible-md');
                     break;
                 case 'lg':
                 case 'tv':
                     $this->addClass('visible-lg');
                     break;
                 case 'p':
                 case 'print':
                     $this->addClass('visible-print');
                     break;
             }
         }
     }
     if ($this->hasAttribute('HIDDEN')) {
         $hidden = explode(' ', $this->getAttribute('HIDDEN'));
         foreach ($hidden as $h) {
             switch ($h) {
                 case 'xs':
                 case 'phone':
                     $this->addClass('hidden-xs');
                     break;
                 case 'sm':
                 case 'tablet':
                     $this->addClass('hidden-sm');
                     break;
                 case 'md':
                 case 'desktop':
                     $this->addClass('hidden-md');
                     break;
                 case 'lg':
                 case 'tv':
                     $this->addClass('hidden-lg');
                     break;
                 case 'p':
                 case 'print':
                     $this->addClass('hidden-print');
                     break;
             }
         }
     }
     //Text style manipulation
     if ($this->hasAttribute('TEXT-ALIGN')) {
         switch ($this->getAttribute('TEXT-ALIGN')) {
             case 'left':
                 $this->addClass('text-left');
                 break;
             case 'center':
                 $this->addClass('text-center');
                 break;
             case 'right':
                 $this->addClass('text-right');
                 break;
         }
     }
     if ($this->hasAttribute('TEXT-THEME')) {
         switch ($this->getAttribute('TEXT-THEME')) {
             case 'muted':
                 $this->addClass('text-muted');
                 break;
             case 'primary':
                 $this->addClass('text-primary');
                 break;
             case 'success':
                 $this->addClass('text-success');
                 break;
             case 'info':
                 $this->addClass('text-info');
                 break;
             case 'warning':
                 $this->addClass('text-warning');
                 break;
             case 'danger':
                 $this->addClass('text-danger');
                 break;
         }
     }
     if ($this->hasAttribute('OPEN-MODAL')) {
         $this->ignoreAttribute('OPEN-MODAL');
         $this->setAttribute('DATA-TOGGLE', 'modal');
         $this->setAttribute('DATA-TARGET', '#xtpl-bootstrap-modal-' . $this->getAttribute('OPEN-MODAL'));
     }
 }