From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- demos/blog/protected/Pages/SearchPost.php | 134 +++++++++++++++--------------- 1 file changed, 67 insertions(+), 67 deletions(-) (limited to 'demos/blog/protected/Pages/SearchPost.php') diff --git a/demos/blog/protected/Pages/SearchPost.php b/demos/blog/protected/Pages/SearchPost.php index dc483f9a..437435f9 100644 --- a/demos/blog/protected/Pages/SearchPost.php +++ b/demos/blog/protected/Pages/SearchPost.php @@ -1,68 +1,68 @@ -_posts=$this->DataAccess->queryPostsSearch( - $this->getPostKeywords(), - 'ORDER BY create_time DESC', - 'LIMIT '.$this->getPageOffset().','.$this->getPageSize()); - } - - private function getPostKeywords() - { - return explode(' ',$this->Request['keyword']); - } - - private function getPageOffset() - { - if(($offset=TPropertyValue::ensureInteger($this->Request['offset']))<=0) - $offset=0; - return $offset; - } - - private function getPageSize() - { - if(($limit=TPropertyValue::ensureInteger($this->Request['limit']))<=0) - $limit=TPropertyValue::ensureInteger($this->Application->Parameters['PostPerPage']); - return $limit; - } - - private function formUrl($newOffset) - { - $gets=array(); - $gets['offset']=$newOffset; - if($this->Request['limit']!==null) - $gets['limit']=$this->Request['limit']; - if($this->Request['time']!==null) - $gets['time']=$this->Request['time']; - if($this->Request['cat']!==null) - $gets['cat']=$this->Request['cat']; - return $this->Service->constructUrl('Posts.ListPost',$gets); - } - - public function onLoad($param) - { - parent::onLoad($param); - $this->PostList->DataSource=$this->_posts; - $this->PostList->dataBind(); - if($this->getPageOffset()>0) - { - if(($offset=$this->getPageOffset()-$this->getPageSize())<0) - $offset=0; - $this->PrevPage->NavigateUrl=$this->formUrl($offset); - $this->PrevPage->Visible=true; - } - if(count($this->_posts)===$this->getPageSize()) - { - $this->NextPage->NavigateUrl=$this->formUrl($this->getPageOffset()+$this->getPageSize()); - $this->NextPage->Visible=true; - } - } -} - +_posts=$this->DataAccess->queryPostsSearch( + $this->getPostKeywords(), + 'ORDER BY create_time DESC', + 'LIMIT '.$this->getPageOffset().','.$this->getPageSize()); + } + + private function getPostKeywords() + { + return explode(' ',$this->Request['keyword']); + } + + private function getPageOffset() + { + if(($offset=TPropertyValue::ensureInteger($this->Request['offset']))<=0) + $offset=0; + return $offset; + } + + private function getPageSize() + { + if(($limit=TPropertyValue::ensureInteger($this->Request['limit']))<=0) + $limit=TPropertyValue::ensureInteger($this->Application->Parameters['PostPerPage']); + return $limit; + } + + private function formUrl($newOffset) + { + $gets=array(); + $gets['offset']=$newOffset; + if($this->Request['limit']!==null) + $gets['limit']=$this->Request['limit']; + if($this->Request['time']!==null) + $gets['time']=$this->Request['time']; + if($this->Request['cat']!==null) + $gets['cat']=$this->Request['cat']; + return $this->Service->constructUrl('Posts.ListPost',$gets); + } + + public function onLoad($param) + { + parent::onLoad($param); + $this->PostList->DataSource=$this->_posts; + $this->PostList->dataBind(); + if($this->getPageOffset()>0) + { + if(($offset=$this->getPageOffset()-$this->getPageSize())<0) + $offset=0; + $this->PrevPage->NavigateUrl=$this->formUrl($offset); + $this->PrevPage->Visible=true; + } + if(count($this->_posts)===$this->getPageSize()) + { + $this->NextPage->NavigateUrl=$this->formUrl($this->getPageOffset()+$this->getPageSize()); + $this->NextPage->Visible=true; + } + } +} + ?> \ No newline at end of file -- cgit v1.2.3