summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-05-29 01:34:53 +0000
committerxue <>2006-05-29 01:34:53 +0000
commit17a098b1d984af47403678b55a3445a0aad3f89f (patch)
treeeaff92053b40bf88a7d2c01a493a50b7e0b5ab85
parentf4169ef12e83b93d9693c3e9278af6a6f02861d6 (diff)
added TListControl.SelectedValues property
added TThemeManager.AvailableThemes property
-rw-r--r--HISTORY5
-rw-r--r--framework/Security/TUser.php1
-rw-r--r--framework/Web/UI/TThemeManager.php17
-rw-r--r--framework/Web/UI/WebControls/TListControl.php39
4 files changed, 62 insertions, 0 deletions
diff --git a/HISTORY b/HISTORY
index 9dc9b436..8614bac0 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,8 +1,11 @@
Version 3.0.1 June 1, 2006
==========================
+BUG: Ticket#28 - OnClick does not work with Safari/KHTML (Wei)
BUG: Ticket#37 - Changes of config files do not trigger cache update (Qiang)
BUG: Ticket#44 - THtmlArea (tiny_mce) not working on some systems (Qiang)
+BUG: Ticket#162 - Missing currency sign in TNumberFormat if Value is 0 (Wei)
BUG: Ticket#167 - TSecurityManager issues warning when trying to encrypt/decrypt strings (Qiang)
+BUG: Ticket#169 - Validation of subclass of THtmlArea/TDatePicker fails (Wei)
BUG: Ticket#179 - CGI incompatibility causing clientscripts.php failure (Qiang)
BUG: Ticket#181 - Unable to change Content-Type in response header if charset is not set (Qiang)
ENH: Ticket#150 - TDataGrid and TDataList now render table section tags (Qiang)
@@ -12,6 +15,8 @@ ENH: added search for quickstart tutorials (Wei)
ENH: added support to property tags for template owner control (Qiang)
ENH: added Bulgarian requirement checker messages (StanProg)
ENH: added TTheme.BaseUrl and TTheme.BasePath property (Qiang)
+ENH: added TListControl.SelectedValues property (Qiang)
+ENH: added TThemeManager.AvailableThemes property (Qiang)
ENH: refactored TUserManager and TAuthManager so that they are easier to be extended (Qiang)
CHG: Ticket#151 - URL format is modified to handle empty GET values (Qiang)
CHG: Ticket#153 - TAssetManager now ignores .svn directories (Qiang)
diff --git a/framework/Security/TUser.php b/framework/Security/TUser.php
index 7b785add..ee52ceaa 100644
--- a/framework/Security/TUser.php
+++ b/framework/Security/TUser.php
@@ -57,6 +57,7 @@ class TUser extends TComponent implements IUser
public function __construct(IUserManager $manager)
{
$this->_manager=$manager;
+ $this->_name=$manager->getGuestName();
}
/**
diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php
index 6a908759..fcb20a81 100644
--- a/framework/Web/UI/TThemeManager.php
+++ b/framework/Web/UI/TThemeManager.php
@@ -79,6 +79,23 @@ class TThemeManager extends TModule
}
/**
+ * @return array list of available theme names
+ */
+ public function getAvailableThemes()
+ {
+ $themes=array();
+ $basePath=$this->getBasePath();
+ $folder=@opendir($basePath);
+ while($file=@readdir($folder))
+ {
+ if($file!=='.' && $file!=='..' && $file!=='.svn' && is_dir($basePath.'/'.$file))
+ $themes[]=$file;
+ }
+ closedir($folder);
+ return $themes;
+ }
+
+ /**
* @return string the base path for all themes. It is returned as an absolute path.
* @throws TConfigurationException if base path is not set and "themes" directory does not exist.
*/
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
*/