summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Pages/Admin
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
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'demos/blog/protected/Pages/Admin')
-rw-r--r--demos/blog/protected/Pages/Admin/AdminMenu.php46
-rw-r--r--demos/blog/protected/Pages/Admin/ConfigMan.php152
-rw-r--r--demos/blog/protected/Pages/Admin/PostMan.php144
-rw-r--r--demos/blog/protected/Pages/Admin/UserMan.php148
4 files changed, 245 insertions, 245 deletions
diff --git a/demos/blog/protected/Pages/Admin/AdminMenu.php b/demos/blog/protected/Pages/Admin/AdminMenu.php
index a631d5b5..4687a5ce 100644
--- a/demos/blog/protected/Pages/Admin/AdminMenu.php
+++ b/demos/blog/protected/Pages/Admin/AdminMenu.php
@@ -1,24 +1,24 @@
-<?php
-/**
- * AdminMenu 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$
- */
-
-/**
- * AdminMenu 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 AdminMenu extends TTemplateControl
-{
-}
-
+<?php
+/**
+ * AdminMenu 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$
+ */
+
+/**
+ * AdminMenu 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 AdminMenu extends TTemplateControl
+{
+}
+
?> \ No newline at end of file
diff --git a/demos/blog/protected/Pages/Admin/ConfigMan.php b/demos/blog/protected/Pages/Admin/ConfigMan.php
index 61516c27..c60a04e8 100644
--- a/demos/blog/protected/Pages/Admin/ConfigMan.php
+++ b/demos/blog/protected/Pages/Admin/ConfigMan.php
@@ -1,77 +1,77 @@
-<?php
-/**
- * ConfigMan 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$
- */
-
-/**
- * ConfigMan 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 ConfigMan extends BlogPage
-{
- const CONFIG_FILE='Application.Data.Settings';
-
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- {
- $parameters=$this->Application->Parameters;
- $this->SiteTitle->Text=$parameters['SiteTitle'];
- $this->SiteSubtitle->Text=$parameters['SiteSubtitle'];
- $this->SiteOwner->Text=$parameters['SiteOwner'];
- $this->AdminEmail->Text=$parameters['AdminEmail'];
- $this->MultipleUser->Checked=TPropertyValue::ensureBoolean($parameters['MultipleUser']);
- $this->AccountApproval->Checked=TPropertyValue::ensureBoolean($parameters['AccountApproval']);
- $this->PostPerPage->Text=$parameters['PostPerPage'];
- $this->RecentComments->Text=$parameters['RecentComments'];
- $this->PostApproval->Checked=TPropertyValue::ensureBoolean($parameters['PostApproval']);
- $themes=$this->Service->ThemeManager->AvailableThemes;
- $this->ThemeName->DataSource=$themes;
- $this->ThemeName->dataBind();
- $this->ThemeName->SelectedValue=array_search($parameters['ThemeName'],$themes);
- }
- }
-
- public function saveButtonClicked($sender,$param)
- {
- $dom=new TXmlDocument;
- $dom->Encoding='utf-8';
- $dom->TagName='parameters';
- $elements=$dom->Elements;
- $elements[]=$this->createParameter('SiteTitle',$this->SiteTitle->Text);
- $elements[]=$this->createParameter('SiteSubtitle',$this->SiteSubtitle->Text);
- $elements[]=$this->createParameter('SiteOwner',$this->SiteOwner->Text);
- $elements[]=$this->createParameter('AdminEmail',$this->AdminEmail->Text);
- $elements[]=$this->createParameter('MultipleUser',$this->MultipleUser->Checked);
- $elements[]=$this->createParameter('AccountApproval',$this->AccountApproval->Checked);
- $elements[]=$this->createParameter('PostPerPage',$this->PostPerPage->Text);
- $elements[]=$this->createParameter('RecentComments',$this->RecentComments->Text);
- $elements[]=$this->createParameter('PostApproval',$this->PostApproval->Checked);
- $themeName=$this->ThemeName->SelectedItem->Text;
- $elements[]=$this->createParameter('ThemeName',$themeName);
- $dom->saveToFile(Prado::getPathOfNamespace(self::CONFIG_FILE,'.xml'));
- if($themeName!==$this->Theme->Name)
- $this->Response->reload();
- }
-
- private function createParameter($id,$value)
- {
- $element=new TXmlElement('parameter');
- $element->Attributes['id']=$id;
- $element->Attributes['value']=TPropertyValue::ensureString($value);
- return $element;
- }
-}
-
+<?php
+/**
+ * ConfigMan 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$
+ */
+
+/**
+ * ConfigMan 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 ConfigMan extends BlogPage
+{
+ const CONFIG_FILE='Application.Data.Settings';
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $parameters=$this->Application->Parameters;
+ $this->SiteTitle->Text=$parameters['SiteTitle'];
+ $this->SiteSubtitle->Text=$parameters['SiteSubtitle'];
+ $this->SiteOwner->Text=$parameters['SiteOwner'];
+ $this->AdminEmail->Text=$parameters['AdminEmail'];
+ $this->MultipleUser->Checked=TPropertyValue::ensureBoolean($parameters['MultipleUser']);
+ $this->AccountApproval->Checked=TPropertyValue::ensureBoolean($parameters['AccountApproval']);
+ $this->PostPerPage->Text=$parameters['PostPerPage'];
+ $this->RecentComments->Text=$parameters['RecentComments'];
+ $this->PostApproval->Checked=TPropertyValue::ensureBoolean($parameters['PostApproval']);
+ $themes=$this->Service->ThemeManager->AvailableThemes;
+ $this->ThemeName->DataSource=$themes;
+ $this->ThemeName->dataBind();
+ $this->ThemeName->SelectedValue=array_search($parameters['ThemeName'],$themes);
+ }
+ }
+
+ public function saveButtonClicked($sender,$param)
+ {
+ $dom=new TXmlDocument;
+ $dom->Encoding='utf-8';
+ $dom->TagName='parameters';
+ $elements=$dom->Elements;
+ $elements[]=$this->createParameter('SiteTitle',$this->SiteTitle->Text);
+ $elements[]=$this->createParameter('SiteSubtitle',$this->SiteSubtitle->Text);
+ $elements[]=$this->createParameter('SiteOwner',$this->SiteOwner->Text);
+ $elements[]=$this->createParameter('AdminEmail',$this->AdminEmail->Text);
+ $elements[]=$this->createParameter('MultipleUser',$this->MultipleUser->Checked);
+ $elements[]=$this->createParameter('AccountApproval',$this->AccountApproval->Checked);
+ $elements[]=$this->createParameter('PostPerPage',$this->PostPerPage->Text);
+ $elements[]=$this->createParameter('RecentComments',$this->RecentComments->Text);
+ $elements[]=$this->createParameter('PostApproval',$this->PostApproval->Checked);
+ $themeName=$this->ThemeName->SelectedItem->Text;
+ $elements[]=$this->createParameter('ThemeName',$themeName);
+ $dom->saveToFile(Prado::getPathOfNamespace(self::CONFIG_FILE,'.xml'));
+ if($themeName!==$this->Theme->Name)
+ $this->Response->reload();
+ }
+
+ private function createParameter($id,$value)
+ {
+ $element=new TXmlElement('parameter');
+ $element->Attributes['id']=$id;
+ $element->Attributes['value']=TPropertyValue::ensureString($value);
+ return $element;
+ }
+}
+
?> \ No newline at end of file
diff --git a/demos/blog/protected/Pages/Admin/PostMan.php b/demos/blog/protected/Pages/Admin/PostMan.php
index bf6597b1..c2ceb73f 100644
--- a/demos/blog/protected/Pages/Admin/PostMan.php
+++ b/demos/blog/protected/Pages/Admin/PostMan.php
@@ -1,73 +1,73 @@
-<?php
-/**
- * PostMan 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$
- */
-
-/**
- * PostMan 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 PostMan extends BlogPage
-{
- protected function bindData()
- {
- $offset=$this->PostGrid->CurrentPageIndex*$this->PostGrid->PageSize;
- $limit=$this->PostGrid->PageSize;
- $this->PostGrid->DataSource=$this->DataAccess->queryPosts('','','ORDER BY a.status DESC, modify_time DESC',"LIMIT $offset,$limit");
- $this->PostGrid->VirtualItemCount=$this->DataAccess->queryPostCount('','');
- $this->PostGrid->dataBind();
- }
-
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- $this->bindData();
- }
-
- public function changePage($sender,$param)
- {
- $this->PostGrid->CurrentPageIndex=$param->NewPageIndex;
- $this->bindData();
- }
-
- public function pagerCreated($sender,$param)
- {
- $param->Pager->Controls->insertAt(0,'Page: ');
- }
-
- public function editItem($sender,$param)
- {
- $this->PostGrid->EditItemIndex=$param->Item->ItemIndex;
- $this->bindData();
- }
-
- public function saveItem($sender,$param)
- {
- $item=$param->Item;
- $postID=$this->PostGrid->DataKeys[$item->ItemIndex];
- $postRecord=$this->DataAccess->queryPostByID($postID);
- $postRecord->Status=TPropertyValue::ensureInteger($item->Cells[2]->PostStatus->SelectedValue);
- $this->DataAccess->updatePost($postRecord);
- $this->PostGrid->EditItemIndex=-1;
- $this->bindData();
- }
-
- public function cancelItem($sender,$param)
- {
- $this->PostGrid->EditItemIndex=-1;
- $this->bindData();
- }
-}
-
+<?php
+/**
+ * PostMan 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$
+ */
+
+/**
+ * PostMan 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 PostMan extends BlogPage
+{
+ protected function bindData()
+ {
+ $offset=$this->PostGrid->CurrentPageIndex*$this->PostGrid->PageSize;
+ $limit=$this->PostGrid->PageSize;
+ $this->PostGrid->DataSource=$this->DataAccess->queryPosts('','','ORDER BY a.status DESC, modify_time DESC',"LIMIT $offset,$limit");
+ $this->PostGrid->VirtualItemCount=$this->DataAccess->queryPostCount('','');
+ $this->PostGrid->dataBind();
+ }
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ $this->bindData();
+ }
+
+ public function changePage($sender,$param)
+ {
+ $this->PostGrid->CurrentPageIndex=$param->NewPageIndex;
+ $this->bindData();
+ }
+
+ public function pagerCreated($sender,$param)
+ {
+ $param->Pager->Controls->insertAt(0,'Page: ');
+ }
+
+ public function editItem($sender,$param)
+ {
+ $this->PostGrid->EditItemIndex=$param->Item->ItemIndex;
+ $this->bindData();
+ }
+
+ public function saveItem($sender,$param)
+ {
+ $item=$param->Item;
+ $postID=$this->PostGrid->DataKeys[$item->ItemIndex];
+ $postRecord=$this->DataAccess->queryPostByID($postID);
+ $postRecord->Status=TPropertyValue::ensureInteger($item->Cells[2]->PostStatus->SelectedValue);
+ $this->DataAccess->updatePost($postRecord);
+ $this->PostGrid->EditItemIndex=-1;
+ $this->bindData();
+ }
+
+ public function cancelItem($sender,$param)
+ {
+ $this->PostGrid->EditItemIndex=-1;
+ $this->bindData();
+ }
+}
+
?> \ No newline at end of file
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