Exemplo n.º 1
0
 /**
  * The component to display a single forum (i.e. the threads in it)
  */
 public function executeShowForum()
 {
     $this->category = CategoryPeer::retrieveByPK($this->forumID);
     if ($this->category == NULL) {
         $this->category = ForumPeer::retrieveByPK($this->forumID);
     }
     $c = ThreadPeer::getCriteriaForCategory($this->forumID);
     $pager = new sfPropelPager('Thread', 10);
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $raykuPager = new RaykuPagerRenderer($pager);
     $raykuPager->setBaseUrl('@view_page?forum_id=' . $this->category->getId());
     $this->raykuPager = $raykuPager;
 }
Exemplo n.º 2
0
 public function executeSearch()
 {
     $this->keyword = $this->getRequestParameter('threadsearch');
     //	$this->forumId=$this->getRequestParameter('forum_id');
     $c = new Criteria();
     $s = $c->getNewCriterion(ThreadPeer::TITLE, '%' . $this->keyword . '%', Criteria::LIKE);
     $s->addOr($c->getNewCriterion(ThreadPeer::TAGS, '%' . $this->keyword . '%', Criteria::LIKE));
     $c->add($s);
     //Setup the pager and grab the appropriate resultset
     $pager = new sfPropelPager('Thread', 12);
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $raykuPager = new RaykuPagerRenderer($pager);
     $raykuPager->setBaseUrl('forum/search' . ($this->keyword != '' ? '?threadsearch=' . $this->keyword : ''));
     $this->raykuPager = $raykuPager;
 }
Exemplo n.º 3
0
 /**
  * Copied in from autousersActions... modification to the criteria (excludes
  * hidden accounts).
  */
 public function executeList()
 {
     // pager
     $pager = new sfPropelPager('User', false);
     $c = new Criteria();
     //Don't show hidden users
     $c->add(UserPeer::HIDDEN, false);
     //$this->addSortCriteria($c);
     //$this->addFiltersCriteria($c);
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $raykuPager = new RaykuPagerRenderer($pager);
     $pagerBaseUrl = 'admin.php/users/list';
     $raykuPager->setBaseUrl($pagerBaseUrl);
     $raykuPager->setLinkToRemoteElementId('admin_user');
     $this->raykuPager = $raykuPager;
 }
Exemplo n.º 4
0
 public function executeIndex()
 {
     $search = $this->getSearch();
     $sCriteria = $this->getRequestParameter('criteria');
     if (trim($sCriteria) == '') {
         return sfView::ERROR;
     }
     $findfrom = $this->getRequestParameter('findfrom', 'ALL');
     switch ($findfrom) {
         case "ALL":
             $search->withinUsers($this->getUser());
             $search->withinPosts();
             //          $search->withinGroups();
             break;
         case "people":
             $search->withinUsers($this->getUser());
             break;
         case "posts":
             $search->withinPosts();
             break;
             //			case "groups": $search->withinGroups(); break;
     }
     if ($search->nrOfObjects() == 0) {
         return sfView::ERROR;
     }
     //Setup the pager and grab the appropriate resultset
     $pager = new SearchPager('Search', 4);
     $pager->setSearch($search);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $raykuPager = new RaykuPagerRenderer($pager);
     $raykuPager->setBaseUrl('search/index' . ($sCriteria != '' ? '?criteria=' . $sCriteria : '') . '&findfrom=' . $findfrom);
     $raykuPager->setLinkToRemoteElementId('tcontent');
     if ($this->getRequest()->isXmlHttpRequest()) {
         sfProjectConfiguration::getActive()->loadHelpers('Partial');
         return $this->renderText(get_partial('allList', array('raykuPager' => $raykuPager, 'search' => $search)));
     }
     $this->raykuPager = $raykuPager;
     $this->search = $search;
 }