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; }
public function setLabel($label) { parent::setLabel($label); $this->item->setButtonLabel($label); return $this; }
public function enable() { parent::enable(); $this->hint->setAttribute('display', 'none'); }
protected function doInit() { parent::doInit(); $this->html->addClass('\\Psc\\ajax-button'); }
/** * @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; }