| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* TActiveImage class file.
|
|
|
4 |
*
|
|
|
5 |
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
|
|
|
6 |
* @link http://www.pradosoft.com/
|
|
|
7 |
* @copyright Copyright © 2005-2008 PradoSoft
|
|
|
8 |
* @license http://www.pradosoft.com/license/
|
|
|
9 |
* @version $Id: TActiveImage.php 2482 2008-07-30 02:07:13Z knut $
|
|
|
10 |
* @package System.Web.UI.ActiveControls
|
|
|
11 |
*/
|
|
|
12 |
|
|
|
13 |
/**
|
|
|
14 |
* TActiveImage class.
|
|
|
15 |
*
|
|
|
16 |
* TActiveImage allows the {@link setAlternateText AlternateText},
|
|
|
17 |
* {@link setImageAlign ImageAlign}, {@link setImageUrl ImageUrl},
|
|
|
18 |
* and {@link setDescriptionUrl DescriptionUrl} to be updated during
|
|
|
19 |
* a callback request.
|
|
|
20 |
*
|
|
|
21 |
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
|
|
|
22 |
* @version $Id: TActiveImage.php 2482 2008-07-30 02:07:13Z knut $
|
|
|
23 |
* @package System.Web.UI.ActiveControls
|
|
|
24 |
* @since 3.1
|
|
|
25 |
*/
|
|
|
26 |
class TActiveImage extends TImage implements IActiveControl
|
|
|
27 |
{
|
|
|
28 |
/**
|
|
|
29 |
* Creates a new callback control, sets the adapter to
|
|
|
30 |
* TActiveControlAdapter. If you override this class, be sure to set the
|
|
|
31 |
* adapter appropriately by, for example, by calling this constructor.
|
|
|
32 |
*/
|
|
|
33 |
public function __construct()
|
|
|
34 |
{
|
|
|
35 |
parent::__construct();
|
|
|
36 |
$this->setAdapter(new TActiveControlAdapter($this));
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
/**
|
|
|
40 |
* @return TBaseActiveControl basic active control options.
|
|
|
41 |
*/
|
|
|
42 |
public function getActiveControl()
|
|
|
43 |
{
|
|
|
44 |
return $this->getAdapter()->getBaseActiveControl();
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
/**
|
|
|
48 |
* Sets the alternative text to be displayed in the TImage when the image is unavailable.
|
|
|
49 |
* @param string the alternative text
|
|
|
50 |
*/
|
|
|
51 |
public function setAlternateText($value)
|
|
|
52 |
{
|
|
|
53 |
parent::setAlternateText($value);
|
|
|
54 |
if($this->getActiveControl()->canUpdateClientSide())
|
|
|
55 |
$this->getPage()->getCallbackClient()->setAttribute($this, 'alt', $value);
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
/**
|
|
|
59 |
* Sets the alignment of the image with respective to other elements on the page.
|
|
|
60 |
* Possible values include: absbottom, absmiddle, baseline, bottom, left,
|
|
|
61 |
* middle, right, texttop, and top. If an empty string is passed in,
|
|
|
62 |
* imagealign attribute will not be rendered.
|
|
|
63 |
* @param string the alignment of the image
|
|
|
64 |
*/
|
|
|
65 |
public function setImageAlign($value)
|
|
|
66 |
{
|
|
|
67 |
parent::setImageAlign($value);
|
|
|
68 |
if($this->getActiveControl()->canUpdateClientSide())
|
|
|
69 |
$this->getPage()->getCallbackClient()->setAttribute($this, 'align', $value);
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
/**
|
|
|
73 |
* @param string the URL of the image file
|
|
|
74 |
*/
|
|
|
75 |
public function setImageUrl($value)
|
|
|
76 |
{
|
|
|
77 |
parent::setImageUrl($value);
|
|
|
78 |
if($this->getActiveControl()->canUpdateClientSide())
|
|
|
79 |
$this->getPage()->getCallbackClient()->setAttribute($this, 'src', $value);
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
/**
|
|
|
83 |
* @param string the URL to the long description of the image.
|
|
|
84 |
*/
|
|
|
85 |
public function setDescriptionUrl($value)
|
|
|
86 |
{
|
|
|
87 |
parent::setDescriptionUrl($value);
|
|
|
88 |
if($this->getActiveControl()->canUpdateClientSide())
|
|
|
89 |
$this->getPage()->getCallbackClient()->setAttribute($this, 'longdesc', $value);
|
|
|
90 |
}
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
?>
|