示例#1
0
 public function executeSearch(sfWebRequest $request)
 {
     if (isset($request['id'])) {
         $this->album = Doctrine::getTable('Album')->find($request['id']);
         $this->setTemplate('searchId');
         return sfView::SUCCESS;
     }
     $this->keyword = $request['keyword'];
     $keywords = opAlbumPluginToolkit::parseKeyword($this->keyword);
     $this->forwardUnless($keywords, 'album', 'list');
     $this->pager = Doctrine::getTable('Album')->getAlbumSearchPager($keywords, $request['page'], 20, AlbumTable::PUBLIC_FLAG_PRIVATE);
     $this->setTemplate('list');
 }
示例#2
0
 public function executeSearch(sfWebRequest $request)
 {
     if (isset($request['album_id'])) {
         $this->albumId = $request['album_id'];
         $this->pager = Doctrine::getTable('AlbumImage')->getAlbumImagePagerForAlbum($this->albumId, $request['page'], 20);
     } elseif (isset($request['keyword'])) {
         $this->keyword = $request['keyword'];
         $keywords = opAlbumPluginToolkit::parseKeyword($this->keyword);
         $this->pager = Doctrine::getTable('AlbumImage')->getAlbumImageSearchPager($keywords, $request['page'], 20);
     } else {
         $this->forward('albumImage', 'list');
     }
     $this->setTemplate('list');
 }