Example #1
0
 public function actionList($status, $flags, $q)
 {
     if ($status) {
         $this->songy = $this->songList->findByStatus($status);
     } else {
         $this->songy = $this->songList->findAll();
     }
     //Simple song searching
     if ($q) {
         $searcher = new \Searcher();
         $searcher->setModel($this->songy);
         $searcher->setMask("%?%");
         $searcher->setColumns(array("name", "interpret_name"));
         $searcher->search($q);
         $this->template->q = $q;
     }
     //Filtering by flags
     if ($flags) {
         $this->setFilterDefaults($flags);
         $filter = new \FlagFilter();
         $filter->setModel($this->songy);
         $filter->setFlags(array("r" => "remix", "i" => "instro", "p" => "pecka", "w" => "wishlist_only", "n" => array("column" => "note", "by" => " != ''")));
         $filter->filter($flags);
     }
     //Store list page and filtering
     $this->getSession()->getSection("SongList")->listing = $this->getHttpRequest()->getQuery();
     $this->template->summary = $this->songList->getSummary();
     $this->template->status = $status;
 }