summaryrefslogtreecommitdiff
path: root/demos/blog/protected/Pages/Posts/NewPost.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/Posts/NewPost.php
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'demos/blog/protected/Pages/Posts/NewPost.php')
-rw-r--r--demos/blog/protected/Pages/Posts/NewPost.php112
1 files changed, 56 insertions, 56 deletions
diff --git a/demos/blog/protected/Pages/Posts/NewPost.php b/demos/blog/protected/Pages/Posts/NewPost.php
index 2f894cd5..45b1a794 100644
--- a/demos/blog/protected/Pages/Posts/NewPost.php
+++ b/demos/blog/protected/Pages/Posts/NewPost.php
@@ -1,57 +1,57 @@
-<?php
-/**
- * NewPost 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$
- */
-
-/**
- * NewPost 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 NewPost extends BlogPage
-{
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- {
- $this->Categories->DataSource=$this->DataAccess->queryCategories();
- $this->Categories->dataBind();
- }
- }
-
- public function saveButtonClicked($sender,$param)
- {
- if($this->IsValid)
- {
- $postRecord=new PostRecord;
- $postRecord->Title=$this->Title->SafeText;
- $postRecord->Content=$this->Content->SafeText;
- if($this->DraftMode->Checked)
- $postRecord->Status=PostRecord::STATUS_DRAFT;
- else if(!$this->User->IsAdmin && TPropertyValue::ensureBoolean($this->Application->Parameters['PostApproval']))
- $postRecord->Status=PostRecord::STATUS_PENDING;
- else
- $postRecord->Status=PostRecord::STATUS_PUBLISHED;
- $postRecord->CreateTime=time();
- $postRecord->ModifyTime=$postRecord->CreateTime;
- $postRecord->AuthorID=$this->User->ID;
- $cats=array();
- foreach($this->Categories->SelectedValues as $value)
- $cats[]=TPropertyValue::ensureInteger($value);
- $this->DataAccess->insertPost($postRecord,$cats);
- $this->gotoPage('Posts.ViewPost',array('id'=>$postRecord->ID));
- }
- }
-}
-
+<?php
+/**
+ * NewPost 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$
+ */
+
+/**
+ * NewPost 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 NewPost extends BlogPage
+{
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $this->Categories->DataSource=$this->DataAccess->queryCategories();
+ $this->Categories->dataBind();
+ }
+ }
+
+ public function saveButtonClicked($sender,$param)
+ {
+ if($this->IsValid)
+ {
+ $postRecord=new PostRecord;
+ $postRecord->Title=$this->Title->SafeText;
+ $postRecord->Content=$this->Content->SafeText;
+ if($this->DraftMode->Checked)
+ $postRecord->Status=PostRecord::STATUS_DRAFT;
+ else if(!$this->User->IsAdmin && TPropertyValue::ensureBoolean($this->Application->Parameters['PostApproval']))
+ $postRecord->Status=PostRecord::STATUS_PENDING;
+ else
+ $postRecord->Status=PostRecord::STATUS_PUBLISHED;
+ $postRecord->CreateTime=time();
+ $postRecord->ModifyTime=$postRecord->CreateTime;
+ $postRecord->AuthorID=$this->User->ID;
+ $cats=array();
+ foreach($this->Categories->SelectedValues as $value)
+ $cats[]=TPropertyValue::ensureInteger($value);
+ $this->DataAccess->insertPost($postRecord,$cats);
+ $this->gotoPage('Posts.ViewPost',array('id'=>$postRecord->ID));
+ }
+ }
+}
+
?> \ No newline at end of file