From 03142d666493516ca86dede5380344f8c05b7633 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 6 Dec 2005 20:31:44 +0000 Subject: --- framework/Web/UI/WebControls/TContent.php | 6 ++-- .../Web/UI/WebControls/TContentPlaceHolder.php | 6 ++-- framework/Web/UI/WebControls/THiddenField.php | 4 +-- framework/Web/UI/WebControls/THyperLink.php | 34 ++++++++++++++-------- 4 files changed, 29 insertions(+), 21 deletions(-) (limited to 'framework') diff --git a/framework/Web/UI/WebControls/TContent.php b/framework/Web/UI/WebControls/TContent.php index 61786c01..20cd1dc5 100644 --- a/framework/Web/UI/WebControls/TContent.php +++ b/framework/Web/UI/WebControls/TContent.php @@ -3,9 +3,9 @@ * TContent class file. * * @author Qiang Xue - * @link http://www.xisc.com/ - * @copyright Copyright © 2004-2005, Qiang Xue - * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005 PradoSoft + * @license http://www.pradosoft.com/license/ * @version $Revision: $ $Date: $ * @package System.Web.UI.WebControls */ diff --git a/framework/Web/UI/WebControls/TContentPlaceHolder.php b/framework/Web/UI/WebControls/TContentPlaceHolder.php index fc832fae..32106e82 100644 --- a/framework/Web/UI/WebControls/TContentPlaceHolder.php +++ b/framework/Web/UI/WebControls/TContentPlaceHolder.php @@ -3,9 +3,9 @@ * TContentPlaceHolder class file. * * @author Qiang Xue - * @link http://www.xisc.com/ - * @copyright Copyright © 2004-2005, Qiang Xue - * @license http://www.opensource.org/licenses/bsd-license.php BSD License + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005 PradoSoft + * @license http://www.pradosoft.com/license/ * @version $Revision: $ $Date: $ * @package System.Web.UI.WebControls */ diff --git a/framework/Web/UI/WebControls/THiddenField.php b/framework/Web/UI/WebControls/THiddenField.php index 5c8605f7..fe758c6b 100644 --- a/framework/Web/UI/WebControls/THiddenField.php +++ b/framework/Web/UI/WebControls/THiddenField.php @@ -51,9 +51,7 @@ class THiddenField extends TControl implements IPostBackDataHandler protected function render($writer) { $uniqueID=$this->getUniqueID(); - $page=$this->getPage(); - $page->ensureRenderInForm($this); - //$page->getClientScript()->registerForEventValidation($uniqueID); + $this->getPage()->ensureRenderInForm($this); $writer->addAttribute('type','hidden'); if($uniqueID!=='') $writer->addAttribute('name',$uniqueID); diff --git a/framework/Web/UI/WebControls/THyperLink.php b/framework/Web/UI/WebControls/THyperLink.php index a2efe43a..c47cc1c4 100644 --- a/framework/Web/UI/WebControls/THyperLink.php +++ b/framework/Web/UI/WebControls/THyperLink.php @@ -13,6 +13,19 @@ /** * THyperLink class * + * THyperLink displays a hyperlink on a page. The hyperlink URL is specified + * via the {@link setNavigateUrl NavigateUrl} property, and link text is via + * the {@link setText Text} property. It is also possible to display an image + * by setting the {@link setImageUrl ImageUrl} property. In this case, + * {@link getText Text} is displayed as the alternate text of the image. + * The link target is specified via the {@link setTarget Target} property. + * If both {@link getImageUrl ImageUrl} and {@link getText Text} are empty, + * the content enclosed within the control tag will be rendered. + * + * Note, {@link getText Text} is not HTML-encoded when displayed. + * Make sure it does not contain unwanted characters that may bring + * security vulnerabilities. + * * @author Qiang Xue * @version $Revision: $ $Date: $ * @package System.Web.UI.WebControls @@ -20,7 +33,6 @@ */ class THyperLink extends TWebControl { - // todo: TControl::resolveClientUrl /** * @return string tag name of the hyperlink */ @@ -29,6 +41,10 @@ class THyperLink extends TWebControl return 'a'; } + /** + * Adds attributes related to a hyperlink element to renderer. + * @param THtmlWriter the writer used for the rendering purpose + */ protected function addAttributesToRender($writer) { $isEnabled=$this->getEnabled(true); @@ -36,11 +52,7 @@ class THyperLink extends TWebControl $writer->addAttribute('disabled','disabled'); parent::addAttributesToRender($writer); if(($url=$this->getNavigateUrl())!=='' && $isEnabled) - { - // todo - //$url=$this->resolveClientUrl($url); $writer->addAttribute('href',$url); - } if(($target=$this->getTarget())!=='') $writer->addAttribute('target',$target); } @@ -53,17 +65,17 @@ class THyperLink extends TWebControl { if(($imageUrl=$this->getImageUrl())==='') { - if($this->getHasControls()) - parent::renderContents($writer); + if(($text=$this->getText())!=='') + $writer->write($text); else - $writer->write($this->getText()); + parent::renderContents($writer); } else { $image=new TImage; - $image->setImageUrl($this->resolveClientUrl($imageUrl)); + $image->setImageUrl($imageUrl); if(($toolTip=$this->getToolTip())!=='') - $image->setAlternateText($toolTip); + $image->setToolTip($toolTip); if(($text=$this->getText())!=='') $image->setAlternateText($text); $image->renderControl($writer); @@ -84,8 +96,6 @@ class THyperLink extends TWebControl */ public function setText($value) { - if($this->getHasControls()) - $this->getControls()->clear(); $this->setViewState('Text',$value,''); } -- cgit v1.2.3