From b87fd00a62994d24a3708cec5f5613ed2e9a67ed Mon Sep 17 00:00:00 2001
From: xue <>
Date: Tue, 30 May 2006 21:26:29 +0000
Subject: merge from 3.0 branch till 1111.
---
framework/Security/TUserManager.php | 24 ++++++++++++++++++++++
framework/Web/UI/WebControls/TCheckBox.php | 15 ++++++++++----
framework/Web/UI/WebControls/TDataGrid.php | 4 ++--
.../Web/UI/WebControls/TListControlValidator.php | 4 ++--
framework/Web/UI/WebControls/TRadioButton.php | 5 ++++-
5 files changed, 43 insertions(+), 9 deletions(-)
(limited to 'framework')
diff --git a/framework/Security/TUserManager.php b/framework/Security/TUserManager.php
index 45e55bd7..6b10fa8b 100644
--- a/framework/Security/TUserManager.php
+++ b/framework/Security/TUserManager.php
@@ -123,6 +123,30 @@ class TUserManager extends TModule implements IUserManager
}
}
+ /**
+ * Returns an array of all users.
+ * Each array element represents a single user.
+ * The array key is the username in lower case, and the array value is the
+ * corresponding user password.
+ * @return array list of users
+ */
+ public function getUsers()
+ {
+ return $this->_users;
+ }
+
+ /**
+ * Returns an array of user role information.
+ * Each array element represents the roles for a single user.
+ * The array key is the username in lower case, and the array value is
+ * the roles (represented as an array) that the user is in.
+ * @return array list of user role information
+ */
+ public function getRoles()
+ {
+ return $this->_roles;
+ }
+
/**
* @return string the full path to the file storing user/role information
*/
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php
index cb8fb30d..fda0480d 100644
--- a/framework/Web/UI/WebControls/TCheckBox.php
+++ b/framework/Web/UI/WebControls/TCheckBox.php
@@ -240,6 +240,8 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
{
$attributes=$this->getAttributes();
$value=$attributes->remove('value');
+ // onclick js should only be added to input tag
+ $onclick=$attributes->remove('onclick');
if($attributes->getCount())
{
$writer->addAttributes($attributes);
@@ -248,6 +250,8 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
if($value!==null)
$attributes->add('value',$value);
}
+ else
+ $onclick='';
if($needSpan)
$writer->renderBeginTag('span');
$clientID=$this->getClientID();
@@ -256,16 +260,16 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
if($this->getTextAlign()==='Left')
{
$this->renderLabel($writer,$clientID,$text);
- $this->renderInputTag($writer,$clientID);
+ $this->renderInputTag($writer,$clientID,$onclick);
}
else
{
- $this->renderInputTag($writer,$clientID);
+ $this->renderInputTag($writer,$clientID,$onclick);
$this->renderLabel($writer,$clientID,$text);
}
}
else
- $this->renderInputTag($writer,$clientID);
+ $this->renderInputTag($writer,$clientID,$onclick);
if($needSpan)
$writer->renderEndTag();
}
@@ -334,14 +338,17 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
* Renders a checkbox input element.
* @param THtmlWriter the writer for the rendering purpose
* @param string checkbox id
+ * @param string onclick js
*/
- protected function renderInputTag($writer,$clientID)
+ protected function renderInputTag($writer,$clientID,$onclick)
{
if($clientID!=='')
$writer->addAttribute('id',$clientID);
$writer->addAttribute('type','checkbox');
if(($value = $this->getValueAttribute()) !== '')
$writer->addAttribute('value',$value);
+ if($onclick!=='')
+ $writer->addAttribute('onclick',$onclick);
if(($uniqueID=$this->getUniqueID())!=='')
$writer->addAttribute('name',$uniqueID);
if($this->getChecked())
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 6ff6faba..82c243ca 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -1523,7 +1523,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
protected function renderTable($writer)
{
$this->renderBeginTag($writer);
- if($this->_header->getVisible())
+ if($this->_header && $this->_header->getVisible())
{
$writer->writeLine();
$writer->renderBeginTag('thead');
@@ -1536,7 +1536,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$item->renderControl($writer);
$writer->renderEndTag();
- if($this->_footer->getVisible())
+ if($this->_footer && $this->_footer->getVisible())
{
$writer->writeLine();
$writer->renderBeginTag('tfoot');
diff --git a/framework/Web/UI/WebControls/TListControlValidator.php b/framework/Web/UI/WebControls/TListControlValidator.php
index 0d0940ab..be69085d 100644
--- a/framework/Web/UI/WebControls/TListControlValidator.php
+++ b/framework/Web/UI/WebControls/TListControlValidator.php
@@ -36,7 +36,7 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
*
*
*
- *
@@ -49,7 +49,7 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
*
*
*
- * addAttribute('id',$clientID);
$writer->addAttribute('type','radio');
$writer->addAttribute('name',$this->getUniqueGroupName());
$writer->addAttribute('value',$this->getValueAttribute());
+ if($onclick!=='')
+ $writer->addAttribute('onclick',$onclick);
if($this->getChecked())
$writer->addAttribute('checked','checked');
if(!$this->getEnabled(true))
--
cgit v1.2.3