summaryrefslogtreecommitdiff
path: root/protected/controllers
diff options
context:
space:
mode:
authorPatrick Seeger <pseeger@ccwn.org>2012-06-26 16:59:26 +0200
committerPatrick Seeger <pseeger@ccwn.org>2012-06-26 16:59:26 +0200
commitd7f3ac205ced0e1f1c26599b277cbfb988e48900 (patch)
treefa2f976c67ee8d47146d07689982607dcaf92d3b /protected/controllers
parent66e981bd3d3f9946afed0efbcaf8efa7907c530f (diff)
Anzeige optimiert, Vereine und Veranstaltungen veröffentlicht
Diffstat (limited to 'protected/controllers')
-rw-r--r--protected/controllers/SearchController.php20
-rw-r--r--protected/controllers/VereinController.php2
2 files changed, 9 insertions, 13 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.:
diff --git a/protected/controllers/VereinController.php b/protected/controllers/VereinController.php
index 407a9e7..2056d6d 100644
--- a/protected/controllers/VereinController.php
+++ b/protected/controllers/VereinController.php
@@ -15,7 +15,7 @@ class VereinController extends Controller
{
return array(
'accessControl', // perform access control for CRUD operations
- array('COutputCache','duration'=>3600,'varyByParam'=>array('id','slug')),
+ //array('COutputCache','duration'=>3600,'varyByParam'=>array('id','slug')),
);
}