From d4b19712c271c3bf9d16909768c4bd84d617afd5 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Mon, 20 Jun 2011 14:26:39 +0000 Subject: killed the experimental activecontrols implementation backported from yii --- framework/TComponent.php | 133 ----------------------------------------------- 1 file changed, 133 deletions(-) (limited to 'framework/TComponent.php') diff --git a/framework/TComponent.php b/framework/TComponent.php index ece83636..b29302ec 100644 --- a/framework/TComponent.php +++ b/framework/TComponent.php @@ -78,11 +78,6 @@ class TComponent */ private $_e=array(); - /** - * @var array models (ported from Yii) - */ - private $_m=array(); - /** * Returns a property value or an event handler list by property or event name. * Do not call this method. This is a PHP magic method that we override @@ -356,7 +351,6 @@ class TComponent $method=substr($handler,$pos+1); if(method_exists($object,$method)) $object->$method($sender,$param); - else throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,$handler); } @@ -457,133 +451,6 @@ class TComponent public function addParsedObject($object) { } - - /** - * Returns the named behavior object. - * The name 'asa' stands for 'as a'. - * @param string the behavior name - * @return IBehavior the behavior object, or null if the behavior does not exist - */ - public function asa($behavior) - { - return isset($this->_m[$behavior]) ? $this->_m[$behavior] : null; - } - - /** - * Attaches a list of behaviors to the component. - * Each behavior is indexed by its name and should be an instance of - * {@link IBehavior}, a string specifying the behavior class, or an - * array of the following structure: - *
-	 * array(
-	 *     'class'=>'path.to.BehaviorClass',
-	 *     'property1'=>'value1',
-	 *     'property2'=>'value2',
-	 * )
-	 * 
- * @param array list of behaviors to be attached to the component - */ - public function attachBehaviors($behaviors) - { - foreach($behaviors as $name=>$behavior) - $this->attachBehavior($name,$behavior); - } - - /** - * Detaches all behaviors from the component. - */ - public function detachBehaviors() - { - if($this->_m!==null) - { - foreach($this->_m as $name=>$behavior) - $this->detachBehavior($name); - $this->_m=null; - } - } - - /** - * Attaches a behavior to this component. - * This method will create the behavior object based on the given - * configuration. After that, the behavior object will be initialized - * by calling its {@link IBehavior::attach} method. - * @param string the behavior's name. It should uniquely identify this behavior. - * @param mixed the behavior configuration. This is passed as the first - * parameter to {@link PradoBase::createComponent} to create the behavior object. - * @return IBehavior the behavior object - */ - public function attachBehavior($name,$behavior) - { - if(!($behavior instanceof IBehavior)) - $behavior=Prado::createComponent($behavior); - $behavior->setEnabled(true); - $behavior->attach($this); - return $this->_m[$name]=$behavior; - } - - /** - * Detaches a behavior from the component. - * The behavior's {@link IBehavior::detach} method will be invoked. - * @param string the behavior's name. It uniquely identifies the behavior. - * @return IBehavior the detached behavior. Null if the behavior does not exist. - */ - public function detachBehavior($name) - { - if(isset($this->_m[$name])) - { - $this->_m[$name]->detach($this); - $behavior=$this->_m[$name]; - unset($this->_m[$name]); - return $behavior; - } - } - - /** - * Enables all behaviors attached to this component. - */ - public function enableBehaviors() - { - if($this->_m!==null) - { - foreach($this->_m as $behavior) - $behavior->setEnabled(true); - } - } - - /** - * Disables all behaviors attached to this component. - */ - public function disableBehaviors() - { - if($this->_m!==null) - { - foreach($this->_m as $behavior) - $behavior->setEnabled(false); - } - } - - /** - * Enables an attached behavior. - * A behavior is only effective when it is enabled. - * A behavior is enabled when first attached. - * @param string the behavior's name. It uniquely identifies the behavior. - */ - public function enableBehavior($name) - { - if(isset($this->_m[$name])) - $this->_m[$name]->setEnabled(true); - } - - /** - * Disables an attached behavior. - * A behavior is only effective when it is enabled. - * @param string the behavior's name. It uniquely identifies the behavior. - */ - public function disableBehavior($name) - { - if(isset($this->_m[$name])) - $this->_m[$name]->setEnabled(false); - } } /** -- cgit v1.2.3