Exemplo n.º 1
0
 public function addElement($element, $asIcon = false)
 {
     $elementO = $element;
     if (\is_string($element)) {
         if ($asIcon) {
             $elementO = new HtmlButton("button-" . $this->identifier . "-" . \sizeof($this->content));
             $elementO->asIcon($element);
         } else {
             $elementO = new HtmlButton("button-" . $this->identifier . "-" . \sizeof($this->content), $element);
         }
     }
     $this->addContent($elementO);
 }
Exemplo n.º 2
0
 public function addAction($action, $direction = Direction::RIGHT, $icon = NULL, $labeled = false)
 {
     $actionO = $action;
     if (\is_object($action) === false) {
         $actionO = new HtmlButton("action-" . $this->identifier, $action);
         if (isset($icon)) {
             $actionO->addIcon($icon, true, $labeled);
         }
     }
     $this->addToProperty("class", $direction . " action");
     $this->addContent($actionO, \strstr($direction, Direction::LEFT) !== false);
     return $actionO;
 }
Exemplo n.º 3
0
 public function addAction($action)
 {
     if (!$action instanceof BaseHtml) {
         $class = "";
         if (\array_search($action, ["Okay", "Yes"]) !== false) {
             $class = "approve";
         }
         if (\array_search($action, ["Cancel", "No"]) !== false) {
             $class = "cancel";
         }
         $action = new HtmlButton("action-" . $this->identifier, $action);
         if ($class !== "") {
             $action->addToProperty("class", $class);
         }
     }
     return $this->addElementInPart($action, "actions");
 }
Exemplo n.º 4
0
 public static function icon($identifier, $icon)
 {
     $result = new HtmlButton($identifier);
     $result->asIcon($icon);
     return $result;
 }