diff options
author | xue <> | 2006-05-29 01:34:53 +0000 |
---|---|---|
committer | xue <> | 2006-05-29 01:34:53 +0000 |
commit | 17a098b1d984af47403678b55a3445a0aad3f89f (patch) | |
tree | eaff92053b40bf88a7d2c01a493a50b7e0b5ab85 /framework/Web/UI/WebControls | |
parent | f4169ef12e83b93d9693c3e9278af6a6f02861d6 (diff) |
added TListControl.SelectedValues property
added TThemeManager.AvailableThemes property
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/TListControl.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index 46fab074..5a635297 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -494,6 +494,45 @@ abstract class TListControl extends TDataBoundControl $this->_cachedSelectedValue=$value;
}
+
+ /**
+ * @return array list of the selected item values (strings)
+ */
+ public function getSelectedValues()
+ {
+ $values=array();
+ if($this->_items)
+ {
+ foreach($this->_items as $item)
+ {
+ if($item->getSelected())
+ $values[]=$item->getValue();
+ }
+ }
+ return $values;
+ }
+
+ /**
+ * @param array list of the selected item values
+ */
+ public function setSelectedValues($values)
+ {
+ if($this->_items)
+ {
+ $this->clearSelection();
+ $lookup=array();
+ foreach($this->_items as $item)
+ $lookup[$item->getValue()]=$item;
+ foreach($values as $value)
+ {
+ if(isset($lookup["$value"]))
+ $lookup["$value"]->setSelected(true);
+ else
+ throw new TInvalidDataValueException('listcontrol_selectedvalue_invalid',get_class($this),$value);
+ }
+ }
+ }
+
/**
* @return string selected value
*/
|