Example #1
0
 public static function button($label, $flags = 0x0, $iconLeft = NULL, $iconRight = NULL)
 {
     $button = new UIButton($label);
     if ($iconLeft) {
         $button->setLeftIcon($iconLeft);
     }
     if ($iconRight) {
         $button->setRightIcon($iconRight);
     }
     if (($flags & self::ALIGN_RIGHT) == self::ALIGN_RIGHT) {
         $button->getHTML()->setStyle('float', 'right')->addClass('\\Psc\\button-right');
     }
     if (($flags & self::ALIGN_LEFT) == self::ALIGN_LEFT) {
         $button->getHTML()->setStyle('float', 'left')->addClass('\\Psc\\button-left');
     }
     if (($flags & self::CLEAR) == self::CLEAR) {
         $button->getHTML()->templateAppend("\n" . '<div class="clear"></div>');
     }
     return $button;
 }
Example #2
0
 public function setLabel($label)
 {
     parent::setLabel($label);
     $this->item->setButtonLabel($label);
     return $this;
 }
Example #3
0
 public function enable()
 {
     parent::enable();
     $this->hint->setAttribute('display', 'none');
 }
Example #4
0
 protected function doInit()
 {
     parent::doInit();
     $this->html->addClass('\\Psc\\ajax-button');
 }
Example #5
0
 /**
  * @param ButtonInterface|string $button
  */
 public function addButton($button, $flags = 0x0, $iconLeft = NULL, $iconRight = NULL)
 {
     if (!$button instanceof ButtonInterface) {
         $button = new Button($button);
     }
     if ($iconLeft) {
         $button->setLeftIcon($iconLeft);
     }
     if ($iconRight) {
         $button->setRightIcon($iconRight);
     }
     if (($flags & self::ALIGN_RIGHT) == self::ALIGN_RIGHT) {
         $button->getHTML()->setStyle('float', 'right')->addClass('\\Psc\\button-right');
     }
     if (($flags & self::ALIGN_LEFT) == self::ALIGN_LEFT) {
         $button->getHTML()->setStyle('float', 'left')->addClass('\\Psc\\button-left');
     }
     if (($flags & self::CLEAR) == self::CLEAR) {
         $button->getHTML()->templateAppend("\n" . '<div class="clear"></div>');
     }
     if (($flags & self::PREPEND) == self::PREPEND) {
         array_unshift($this->buttons, $button);
     } else {
         $this->buttons[] = $button;
     }
     return $button;
 }