Exemple #1
0
 /**
  * $cells : cells of this table row
  * $name : name of the form (arbitrary at this point)
  * $buttonText : text of the confirm button
  * $buttonIconName : icon name of the confirm button, defaults to the buttonText
  * $method : form method, default GET
  * $action : form action, default current page
  */
 public function __construct($cells, $name, $buttonText, $buttonIconName = null, $method = 'GET', $action = null, $confirmmessage = null)
 {
     parent::__construct($cells);
     if ($action == null) {
         $action = Server::currentPageName();
     }
     $this->method = $method;
     $this->action = $action;
     $this->name = $name . self::nextID();
     if ($confirmmessage) {
         $js = "doConfirm('" . addslashes(htmlspecialchars($confirmmessage)) . "', document." . $this->name . ");";
     } else {
         $js = $this->name . ".submit();";
     }
     if (!$buttonIconName) {
         $buttonIconName = $buttonText;
     }
     $submitButton = UIButton::javascriptButton($buttonText, $js, $buttonIconName);
     $this->addButton($submitButton);
     require_js('validate');
     require_css('form');
 }
Exemple #2
0
 public function icon()
 {
     return $this->form . parent::icon();
 }