Skip to content
This repository
Browse code

add Button::isClicked() wrapper

  • Loading branch information...
commit 03fd2256b20736b466b3c15342c07505fd2cf9a5 1 parent 0a96d49
Romans Malinovskis authored May 02, 2011

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  lib/View/Button.php
11  lib/View/Button.php
@@ -69,8 +69,19 @@ function render(){
69 69
 		return parent::render();
70 70
 	}
71 71
 	function onClick(){
  72
+        // Obsolete. Use js('click') directly
  73
+        $this->exception('Use generic form of js("click")->univ() instead of onClick()','Obsolete');
72 74
 		return $this->js('click')->univ();
73 75
 	}
  76
+    function isClicked($confirm=null){
  77
+
  78
+        $cl=$this->js('click')->univ();
  79
+        if($confirm)$cl->confirm($confirm);
  80
+
  81
+        $cl->ajaxec($this->api->getDestinationURL(null,array($this->name=>'clicked')));
  82
+
  83
+        return isset($_GET[$this->name]);
  84
+    }
74 85
 	function setAction($js=null,$page=null){
75 86
 		if(strpos($page,'.')===false && strpos($page,':')===false && $page){
76 87
 			$page=$this->api->getDestinationURL($page);

0 notes on commit 03fd225

Please sign in to comment.
Something went wrong with that request. Please try again.