summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/THyperLink.php
diff options
context:
space:
mode:
authorrojaro <>2009-11-01 21:19:12 +0000
committerrojaro <>2009-11-01 21:19:12 +0000
commit704dd5ead2bf3a6858bb07f1186183c84210d307 (patch)
tree0d4b0a451d7f8e4f07441cb8c90915f5d3f3a9c4 /framework/Web/UI/WebControls/THyperLink.php
parent628c6ec94c81935d9906640829635737276244d7 (diff)
Added ability to set width and height for images in both THyperLink and THyperLinkColumn (plus the imageurl for the latter) as suggested by junkee in http://www.pradosoft.com/forum/index.php?topic=8745.0
Diffstat (limited to 'framework/Web/UI/WebControls/THyperLink.php')
-rw-r--r--framework/Web/UI/WebControls/THyperLink.php40
1 files changed, 39 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/THyperLink.php b/framework/Web/UI/WebControls/THyperLink.php
index 217fa267..d215cfe5 100644
--- a/framework/Web/UI/WebControls/THyperLink.php
+++ b/framework/Web/UI/WebControls/THyperLink.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.xisc.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version $Id$
* @package System.Web.UI.WebControls
@@ -84,6 +84,10 @@ class THyperLink extends TWebControl implements IDataRenderer
{
$image=Prado::createComponent('System.Web.UI.WebControls.TImage');
$image->setImageUrl($imageUrl);
+ if(($width=$this->getImageWidth())!=='')
+ $image->setWidth($width);
+ if(($height=$this->getImageHeight())!=='')
+ $image->setHeight($height);
if(($toolTip=$this->getToolTip())!=='')
$image->setToolTip($toolTip);
if(($text=$this->getText())!=='')
@@ -110,6 +114,23 @@ class THyperLink extends TWebControl implements IDataRenderer
}
/**
+ * @return string height of the image in the THyperLink
+ */
+ public function getImageHeight()
+ {
+ return $this->getViewState('ImageHeight','');
+ }
+
+ /**
+ * Sets the height of the image in the THyperLink
+ * @param string height of the image in the THyperLink
+ */
+ public function setImageHeight($value)
+ {
+ $this->setViewSTate('ImageHeight',$value,'');
+ }
+
+ /**
* @return string the location of the image file for the THyperLink
*/
public function getImageUrl()
@@ -125,6 +146,23 @@ class THyperLink extends TWebControl implements IDataRenderer
{
$this->setViewState('ImageUrl',$value,'');
}
+
+ /**
+ * @return string width of the image in the THyperLink
+ */
+ public function getImageWidth()
+ {
+ return $this->getViewState('ImageWidth','');
+ }
+
+ /**
+ * Sets the width of the image in the THyperLink
+ * @param string width of the image
+ */
+ public function setImageWidth($value)
+ {
+ $this->setViewState('ImageWidth',$value,'');
+ }
/**
* @return string the URL to link to when the THyperLink component is clicked.