summaryrefslogtreecommitdiff
path: root/protected/controllers/SearchController.php
diff options
context:
space:
mode:
Diffstat (limited to 'protected/controllers/SearchController.php')
-rw-r--r--protected/controllers/SearchController.php20
1 files changed, 8 insertions, 12 deletions
diff --git a/protected/controllers/SearchController.php b/protected/controllers/SearchController.php
index 1dd2414..603ad7c 100644
--- a/protected/controllers/SearchController.php
+++ b/protected/controllers/SearchController.php
@@ -2,44 +2,40 @@
class SearchController extends Controller
{
- public static $Searchables = array('Verein' => array('beschreibung'),'Sitecontent'=>array('content','title'));
+ public static $Searchables = array('Veranstaltung'=>array('titel','beschreibung'),'Verein' => array('beschreibung','name'),'Sitecontent'=>array('content','title'));
public function actionIndex()
{
$this->render('index');
}
- public function actionSearch()
+ public function actionSearch($search)
{
foreach (SearchController::$Searchables as $searchable => $columns) {
$q = new CDbCriteria();
foreach ($columns as $col) {
- $q->addSearchCondition($col,$_POST['search'],true,'OR');
+ $q->addSearchCondition($col,$search,true,'OR');
}
- $results[$searchable]=CActiveRecord::model($searchable)->findAll($q);
+ $results[$searchable]=CActiveRecord::model($searchable)->published()->findAll($q);
}
$this->render('results', array(
'results' => $results,
- 'search' => $_POST['search']));
+ 'search' => $search));
}
// Uncomment the following methods and override them if needed
- /*
+
public function filters()
{
// return the filter configuration for this controller, e.g.:
return array(
- 'inlineFilterName',
- array(
- 'class'=>'path.to.FilterClass',
- 'propertyName'=>'propertyValue',
- ),
+ array('COutputCache','duration'=>3600,'varyByParam'=>array('search')),
);
}
-
+ /*
public function actions()
{
// return external action classes, e.g.: