diff options
Diffstat (limited to 'framework/Web/UI')
-rw-r--r-- | framework/Web/UI/ActiveControls/TCallbackClientScript.php | 132 | ||||
-rw-r--r-- | framework/Web/UI/TControl.php | 11 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TCheckBox.php | 8 |
3 files changed, 76 insertions, 75 deletions
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php index e6f7555e..50766478 100644 --- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -164,8 +164,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function setAttribute($control, $name, $value)
{
- if ($control instanceof IControlContainer) - $control=$control->getContainerClientID(); + if ($control instanceof ISurroundable) + $control=$control->getSurroundingTagID(); $this->callClientFunction('Prado.Element.setAttribute',array($control, $name, $value));
}
@@ -193,8 +193,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function show($element)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Element.show', $element);
}
@@ -204,8 +204,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function hide($element)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Element.hide', $element);
}
@@ -217,8 +217,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function toggle($element, $effect=null, $options=array())
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Element.toggle', array($element,$effect,$options));
}
@@ -228,8 +228,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function remove($element)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Element.remove', $element);
}
@@ -246,8 +246,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function update($element, $content)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->replace($element, $content, 'Element.update');
}
@@ -258,8 +258,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function addCssClass($element, $cssClass)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Element.addClassName', array($element, $cssClass));
}
@@ -270,8 +270,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function removeCssClass($element, $cssClass)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Element.removeClassName', array($element, $cssClass));
}
@@ -292,8 +292,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function scrollTo($element)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Element.scrollTo', $element);
}
@@ -314,8 +314,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function setStyle($element, $styles)
{ - if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction('Prado.Element.setStyle', array($element, $styles));
}
@@ -326,8 +326,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function appendContent($element, $content)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->replace($element, $content, 'Prado.Element.Insert.append');
}
@@ -338,8 +338,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function prependContent($element, $content)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->replace($element, $content, 'Prado.Element.Insert.prepend');
}
@@ -350,8 +350,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function insertContentAfter($element, $content)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->replace($element, $content, 'Prado.Element.Insert.after');
}
@@ -362,8 +362,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function insertContentBefore($element, $content)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->replace($element, $content, 'Prado.Element.Insert.before');
}
@@ -406,8 +406,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function replaceContent($element,$content)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->replace($element, $content);
}
@@ -458,8 +458,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function visualEffect($type, $element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->callClientFunction($type, array($element, $options));
}
@@ -470,8 +470,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function appear($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Appear', $element, $options);
}
@@ -482,8 +482,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function blindDown($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.BlindDown', $element, $options);
}
@@ -494,8 +494,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function blindUp($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.BlindUp', $element, $options);
}
@@ -507,8 +507,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function dropOut($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.DropOut', $element, $options);
}
@@ -519,8 +519,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function fade($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Fade', $element, $options);
}
@@ -531,8 +531,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function fold($element, $options = null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Fold', $element, $options);
}
@@ -543,8 +543,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function grow($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Grow', $element, $options);
}
@@ -555,8 +555,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function puff($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Puff', $element, $options);
}
@@ -567,8 +567,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function pulsate($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Pulsate', $element, $options);
}
@@ -579,8 +579,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function shake($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Shake', $element, $options);
}
@@ -591,8 +591,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function shrink($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Shrink', $element, $options);
}
@@ -603,8 +603,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function slideDown($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.SlideDown', $element, $options);
}
@@ -615,8 +615,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function slideUp($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.SlideUp', $element, $options);
}
@@ -627,8 +627,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function squish($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.Squish', $element, $options);
}
@@ -639,8 +639,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function switchOff($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Effect.SwitchOff', $element, $options);
}
@@ -651,8 +651,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function highlight($element, $options=null)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $this->visualEffect('Prado.Effect.Highlight', $element, $options);
}
@@ -663,8 +663,8 @@ class TCallbackClientScript extends TApplicationComponent */
public function setOpacity($element, $value)
{
- if ($element instanceof IControlContainer) - $element=$element->getContainerClientID(); + if ($element instanceof ISurroundable) + $element=$element->getSurroundingTagID(); $value = TPropertyValue::ensureFloat($value);
$this->callClientFunction('Element.setOpacity', array($element,$value));
}
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index f20cd2d1..0e95e2b5 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -2152,19 +2152,20 @@ interface IButtonControl }
/**
- * IControlContainer interface
+ * ISurroundable interface
*
- * If a control can have an additional surrounding tag, it should implement this interface.
+ * Identifies controls that may create an additional surrounding tag. The id of the
+ * tag can be obtained with {@link getSurroundingTagID}.
*
* @package System.Web.UI
* @since 3.1.2
*/
-interface IControlContainer
+interface ISurroundable
{
/**
- * @return string the id of the container html tag or of the input control itself if no container present.
+ * @return string the id of the embedding tag of the control or the control's clientID if not surrounded
*/
- public function getContainerClientID();
+ public function getSurroundingTagID();
}
/**
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index 4061f217..b722ec3e 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -40,7 +40,7 @@ * @package System.Web.UI.WebControls
* @since 3.0
*/
-class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable, IDataRenderer, IControlContainer
+class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable, IDataRenderer, ISurroundable
{
private $_dataChanged=false;
@@ -268,9 +268,9 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl }
/**
- * @return string the id of the surrounding tag or this clientID if no such tag present
+ * @return string the id of the surrounding tag or this clientID if no such tag needed
*/
- public function getContainerClientID()
+ public function getSurroundingTagID()
{
return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID();
}
@@ -304,7 +304,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $onclick='';
if($needspan=$this->getSpanNeeded())
{
- $writer->addAttribute('id',$this->getContainerClientID());
+ $writer->addAttribute('id',$this->getSurroundingTagID());
$writer->renderBeginTag('span');
}
$clientID=$this->getClientID();
|