summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TMultiView.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TMultiView.php')
-rw-r--r--framework/Web/UI/WebControls/TMultiView.php110
1 files changed, 1 insertions, 109 deletions
diff --git a/framework/Web/UI/WebControls/TMultiView.php b/framework/Web/UI/WebControls/TMultiView.php
index 05725ff7..b1756bb3 100644
--- a/framework/Web/UI/WebControls/TMultiView.php
+++ b/framework/Web/UI/WebControls/TMultiView.php
@@ -263,112 +263,4 @@ class TMultiView extends TControl
if(($view=$this->getActiveView())!==null)
$view->renderControl($writer);
}
-}
-
-/**
- * TViewCollection class.
- * TViewCollection represents a collection that only takes {@link TView} instances
- * as collection elements.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TViewCollection extends TControlCollection
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by ensuring only {@link TView}
- * controls be added into the collection.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is neither a string nor a TControl.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TView)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('viewcollection_view_required');
- }
-}
-
-/**
- * TView class
- *
- * TView is a container for a group of controls. TView must be contained
- * within a {@link TMultiView} control in which only one view can be active
- * at one time.
- *
- * To activate a view, set {@link setActive Active} to true.
- * When a view is activated, it raises {@link onActivate OnActivate} event;
- * and when a view is deactivated, it raises {@link onDeactivate OnDeactivate}.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TView extends TControl
-{
- private $_active=false;
-
- /**
- * Raises <b>OnActivate</b> event.
- * @param TEventParameter event parameter
- */
- public function onActivate($param)
- {
- $this->raiseEvent('OnActivate',$this,$param);
- }
-
- /**
- * Raises <b>OnDeactivate</b> event.
- * @param TEventParameter event parameter
- */
- public function onDeactivate($param)
- {
- $this->raiseEvent('OnDeactivate',$this,$param);
- }
-
- /**
- * @return boolean whether this view is active. Defaults to false.
- */
- public function getActive()
- {
- return $this->_active;
- }
-
- /**
- * @param boolean whether this view is active.
- */
- public function setActive($value)
- {
- $value=TPropertyValue::ensureBoolean($value);
- $this->_active=$value;
- parent::setVisible($value);
- }
-
- /**
- * @param boolean whether the parents should also be checked if visible
- * @return boolean whether this view is visible.
- * The view is visible if it is active and its parent is visible.
- */
- public function getVisible($checkParents=true)
- {
- if(($parent=$this->getParent())===null)
- return $this->getActive();
- else if($this->getActive())
- return $parent->getVisible($checkParents);
- else
- return false;
- }
-
- /**
- * @param boolean
- * @throws TInvalidOperationException whenever this method is invoked.
- */
- public function setVisible($value)
- {
- throw new TInvalidOperationException('view_visible_readonly');
- }
-}
-
+} \ No newline at end of file