From 35c7ff28cbc311fba5e394b11fb756a4dc1edcb9 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Tue, 13 Dec 2005 07:08:30 +0000
Subject: Removed inline javascript from components. Adding TJavascriptLogger
and logger.js
---
framework/Web/UI/WebControls/TImageButton.php | 33 +--------------------------
1 file changed, 1 insertion(+), 32 deletions(-)
(limited to 'framework/Web/UI/WebControls/TImageButton.php')
diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php
index 96fbff67..131f7b1c 100644
--- a/framework/Web/UI/WebControls/TImageButton.php
+++ b/framework/Web/UI/WebControls/TImageButton.php
@@ -51,10 +51,6 @@ Prado::using('System.Web.UI.WebControls.TImage');
* You can change the postback target by setting the {@link setPostBackUrl PostBackUrl}
* property.
*
- * To set the client-side javascript associated with the user's click action,
- * use the {@link setOnClientClick OnClientClick} property. The value will be rendered
- * as the onclick attribute of the button.
- *
* TImageButton displays the {@link setText Text} property as the hint text to the displayed image.
*
* @author Qiang Xue
@@ -93,19 +89,8 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven
$writer->addAttribute('type','image');
if(($uniqueID=$this->getUniqueID())!=='')
$writer->addAttribute('name',$uniqueID);
-
- if($this->getEnabled(true))
- {
- $onclick=$this->removeAttribute('onclick');
- $onclick=THttpUtility::trimJavaScriptString($onclick).THttpUtility::trimJavaScriptString($this->getOnClientClick());
- $onclick.=$page->getClientScript()->getPostBackEventReference($this,'',$this->getPostBackOptions(),false);
- if(!empty($onclick))
- $writer->addAttribute('onclick','javascript:'.$onclick);
- }
- else if($this->getEnabled()) // in this case, parent will not render 'disabled'
+ if(!$this->getEnabled()) // in this case, parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');
- if($onclick!=='')
- $writer->addAttribute('onclick','javascript:'.$onclick);
parent::addAttributesToRender($writer);
}
@@ -279,22 +264,6 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven
$this->setViewState('PostBackUrl',$value,'');
}
- /**
- * @return string the javascript to be executed when the button is clicked.
- */
- public function getOnClientClick()
- {
- return $this->getViewState('OnClientClick','');
- }
-
- /**
- * @param string the javascript to be executed when the button is clicked.
- */
- public function setOnClientClick($value)
- {
- $this->setViewState('OnClientClick',$value,'');
- }
-
/**
* @return string caption of the button
*/
--
cgit v1.2.3