summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Pages/Admin/UserMan.php
diff options
context:
space:
mode:
authorctrlaltca <>2012-07-12 11:21:01 +0000
committerctrlaltca <>2012-07-12 11:21:01 +0000
commit903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch)
treee08bf04f0823650a231227ac3499121270172a23 /demos/blog/protected/Pages/Admin/UserMan.php
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'demos/blog/protected/Pages/Admin/UserMan.php')
-rw-r--r--demos/blog/protected/Pages/Admin/UserMan.php148
1 files changed, 74 insertions, 74 deletions
diff --git a/demos/blog/protected/Pages/Admin/UserMan.php b/demos/blog/protected/Pages/Admin/UserMan.php
index 5901c334..231f6c84 100644
--- a/demos/blog/protected/Pages/Admin/UserMan.php
+++ b/demos/blog/protected/Pages/Admin/UserMan.php
@@ -1,75 +1,75 @@
-<?php
-/**
- * UserMan class file
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- * @version $Id$
- */
-
-/**
- * UserMan class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- */
-class UserMan extends BlogPage
-{
- protected function bindData()
- {
- $author=$this->User->ID;
- $offset=$this->UserGrid->CurrentPageIndex*$this->UserGrid->PageSize;
- $limit=$this->UserGrid->PageSize;
- $this->UserGrid->DataSource=$this->DataAccess->queryUsers('','ORDER BY status DESC, name ASC',"LIMIT $offset,$limit");
- $this->UserGrid->VirtualItemCount=$this->DataAccess->queryUserCount('');
- $this->UserGrid->dataBind();
- }
-
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- $this->bindData();
- }
-
- public function changePage($sender,$param)
- {
- $this->UserGrid->CurrentPageIndex=$param->NewPageIndex;
- $this->bindData();
- }
-
- public function pagerCreated($sender,$param)
- {
- $param->Pager->Controls->insertAt(0,'Page: ');
- }
-
- public function editItem($sender,$param)
- {
- $this->UserGrid->EditItemIndex=$param->Item->ItemIndex;
- $this->bindData();
- }
-
- public function saveItem($sender,$param)
- {
- $item=$param->Item;
- $userID=$this->UserGrid->DataKeys[$item->ItemIndex];
- $userRecord=$this->DataAccess->queryUserByID($userID);
- $userRecord->Role=TPropertyValue::ensureInteger($item->Cells[1]->UserRole->SelectedValue);
- $userRecord->Status=TPropertyValue::ensureInteger($item->Cells[2]->UserStatus->SelectedValue);
- $this->DataAccess->updateUser($userRecord);
- $this->UserGrid->EditItemIndex=-1;
- $this->bindData();
- }
-
- public function cancelItem($sender,$param)
- {
- $this->UserGrid->EditItemIndex=-1;
- $this->bindData();
- }
-}
-
+<?php
+/**
+ * UserMan class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ */
+
+/**
+ * UserMan class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ */
+class UserMan extends BlogPage
+{
+ protected function bindData()
+ {
+ $author=$this->User->ID;
+ $offset=$this->UserGrid->CurrentPageIndex*$this->UserGrid->PageSize;
+ $limit=$this->UserGrid->PageSize;
+ $this->UserGrid->DataSource=$this->DataAccess->queryUsers('','ORDER BY status DESC, name ASC',"LIMIT $offset,$limit");
+ $this->UserGrid->VirtualItemCount=$this->DataAccess->queryUserCount('');
+ $this->UserGrid->dataBind();
+ }
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ $this->bindData();
+ }
+
+ public function changePage($sender,$param)
+ {
+ $this->UserGrid->CurrentPageIndex=$param->NewPageIndex;
+ $this->bindData();
+ }
+
+ public function pagerCreated($sender,$param)
+ {
+ $param->Pager->Controls->insertAt(0,'Page: ');
+ }
+
+ public function editItem($sender,$param)
+ {
+ $this->UserGrid->EditItemIndex=$param->Item->ItemIndex;
+ $this->bindData();
+ }
+
+ public function saveItem($sender,$param)
+ {
+ $item=$param->Item;
+ $userID=$this->UserGrid->DataKeys[$item->ItemIndex];
+ $userRecord=$this->DataAccess->queryUserByID($userID);
+ $userRecord->Role=TPropertyValue::ensureInteger($item->Cells[1]->UserRole->SelectedValue);
+ $userRecord->Status=TPropertyValue::ensureInteger($item->Cells[2]->UserStatus->SelectedValue);
+ $this->DataAccess->updateUser($userRecord);
+ $this->UserGrid->EditItemIndex=-1;
+ $this->bindData();
+ }
+
+ public function cancelItem($sender,$param)
+ {
+ $this->UserGrid->EditItemIndex=-1;
+ $this->bindData();
+ }
+}
+
?> \ No newline at end of file