]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/framework/Web/UI/WebControls/TListItem.php
baculum: New Baculum API and Baculum Web
[bacula/bacula] / gui / baculum / framework / Web / UI / WebControls / TListItem.php
index cf5e487a0b56fa1efefdbcdb2460ef7846e8c610..0118a9178cb482468797b69a5dea9a4eca0c91ef 100644 (file)
@@ -3,9 +3,9 @@
  * TListItem class file
  *
  * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2014 PradoSoft
- * @license http://www.pradosoft.com/license/
+ * @link https://github.com/pradosoft/prado
+ * @copyright Copyright &copy; 2005-2016 The PRADO Group
+ * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
  * @package System.Web.UI.WebControls
  */
 
@@ -32,19 +32,19 @@ class TListItem extends TComponent
        /**
         * @var string text of the item
         */
-       private $_text;
+       private $_text='';
        /**
         * @var string value of the item
         */
-       private $_value;
+       private $_value='';
        /**
         * @var boolean whether the item is enabled
         */
-       private $_enabled;
+       private $_enabled=true;
        /**
         * @var boolean whether the item is selected
         */
-       private $_selected;
+       private $_selected=false;
 
        /**
         * Constructor.
@@ -61,6 +61,27 @@ class TListItem extends TComponent
                $this->setSelected($selected);
        }
 
+       /**
+        * Returns an array with the names of all variables of this object that should NOT be serialized
+        * because their value is the default one or useless to be cached for the next page loads.
+        * Reimplement in derived classes to add new variables, but remember to  also to call the parent
+        * implementation first.
+        */
+       protected function _getZappableSleepProps(&$exprops)
+       {
+               parent::_getZappableSleepProps($exprops);
+               if ($this->_attributes===null)
+                       $exprops[] = "\0TListItem\0_attributes";
+               if($this->_text==='')
+                       $exprops[] = "\0TListItem\0_text";
+               if($this->_value==='')
+                       $exprops[] = "\0TListItem\0_value";
+               if ($this->_enabled===true)
+                       $exprops[] = "\0TListItem\0_enabled";
+               if ($this->_selected===false)
+                       $exprops[] = "\0TListItem\0_selected";
+       }
+
        /**
         * @return boolean whether the item is enabled
         */