Пример #1
0
 /**
  * Pergunta sobre a exclusão de registro
  */
 function onDelete($param)
 {
     $id = $param['id'];
     // obtém o parâmetro $id
     $action1 = new Action(array($this, 'Delete'));
     $action1->setParameter('id', $id);
     new Question('Deseja realmente excluir o registro?', $action1);
 }
 public function __construct()
 {
     parent::__construct();
     $action1 = new Action(array($this, 'executaAcao1'));
     $action1->setParameter('codigo', 4);
     $action1->setParameter('nome', 'teste');
     print $action1->serialize();
 }
 public function __construct()
 {
     parent::__construct();
     $button1 = new Element('a');
     $button1->add('Ação 1');
     $button1->class = 'btn btn-success';
     $button2 = new Element('a');
     $button2->add('Ação 2');
     $button2->class = 'btn btn-primary';
     $action1 = new Action(array($this, 'executaAcao1'));
     $action1->setParameter('codigo', 4);
     $action2 = new Action(array($this, 'executaAcao2'));
     $action2->setParameter('codigo', 5);
     $button1->href = $action1->serialize();
     $button2->href = $action2->serialize();
     $button1->show();
     $button2->show();
 }
 function __construct($message, Action $action_yes, Action $action_no = NULL)
 {
     $div = new Element('div');
     $div->class = 'alert alert-warning';
     $url_yes = $action_yes->serialize();
     $link_yes = new Element('a');
     $link_yes->href = $url_yes;
     $link_yes->class = 'btn btn-success';
     $link_yes->add('Sim');
     $message .= ' ' . $link_yes;
     if ($action_no) {
         $url_no = $action_no->serialize();
         $link_no = new Element('a');
         $link_no->href = $url_no;
         $link_no->class = 'btn btn-default';
         $link_no->add('Não');
         $message .= $link_no;
     }
     $div->add($message);
     $div->show();
 }
Пример #5
0
 /**
  * Pergunta sobre a exclusão de registro
  */
 public function onDelete($param)
 {
     $key = $param['key'];
     // obtém o parâmetro $key
     $action1 = new Action(array($this, 'Delete'));
     $action1->setParameter('key', $key);
     new Question('Deseja realmente excluir o registro?', $action1);
 }