diff options
| author | Patrick Seeger <pseeger@ccwn.org> | 2014-05-08 14:36:06 +0200 |
|---|---|---|
| committer | Patrick Seeger <pseeger@ccwn.org> | 2014-05-08 14:36:06 +0200 |
| commit | 1605cc08545606471973f6be130afca015bb35fe (patch) | |
| tree | 0e145401b8c09e55b27ad60f28798ca6c2aa2f17 | |
| parent | 94a8598fa257e8838e7761e0b003677c0bb908d2 (diff) | |
Ausblenden von alten Veranstaltungen und alte Dinge
| -rw-r--r-- | protected/components/Controller.php | 2 | ||||
| -rw-r--r-- | protected/controllers/SearchController.php | 2 | ||||
| -rw-r--r-- | protected/controllers/VeranstaltungController.php | 1 | ||||
| -rw-r--r-- | protected/models/Angebot.php | 8 | ||||
| -rw-r--r-- | protected/models/Veranstaltung.php | 4 | ||||
| -rw-r--r-- | protected/views/angebot/_short.php | 11 | ||||
| -rw-r--r-- | protected/views/veranstaltung/index.php | 2 | ||||
| -rw-r--r-- | protected/views/verein/view.php | 3 | ||||
| -rw-r--r-- | themes/astaf/views/layouts/main.php | 2 |
9 files changed, 32 insertions, 3 deletions
diff --git a/protected/components/Controller.php b/protected/components/Controller.php index 4d27862..c364e50 100644 --- a/protected/components/Controller.php +++ b/protected/components/Controller.php @@ -20,4 +20,6 @@ class Controller extends CController * for more details on how to specify this property. */ public $breadcrumbs=array(); + + public $astafAdditionalStyle =""; }
\ No newline at end of file diff --git a/protected/controllers/SearchController.php b/protected/controllers/SearchController.php index acf0aec..275fc6a 100644 --- a/protected/controllers/SearchController.php +++ b/protected/controllers/SearchController.php @@ -2,7 +2,7 @@ class SearchController extends Controller { - public static $Searchables = array('Veranstaltung'=>array('titel','beschreibung'),'Verein' => array('beschreibung','name'),'Sitecontent'=>array('content','title')); + public static $Searchables = array('Veranstaltung'=>array('titel','beschreibung'),'Angebot'=> array('name','beschreibung'),'Verein' => array('beschreibung','name'),'Sitecontent'=>array('content','title')); public function actionIndex() { $this->render('index'); diff --git a/protected/controllers/VeranstaltungController.php b/protected/controllers/VeranstaltungController.php index 619f7fe..1f55d0b 100644 --- a/protected/controllers/VeranstaltungController.php +++ b/protected/controllers/VeranstaltungController.php @@ -64,6 +64,7 @@ class VeranstaltungController extends Controller )); } + public function actionNow() { $model=new Veranstaltung('now'); diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php index 61e4d54..c3abe92 100644 --- a/protected/models/Angebot.php +++ b/protected/models/Angebot.php @@ -103,4 +103,12 @@ class Angebot extends CActiveRecord // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } + public function scopes() + { + return array( + 'published'=>array( + 'condition'=>'1=1', + ), + ); + } }
\ No newline at end of file diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php index 60536cf..843d430 100644 --- a/protected/models/Veranstaltung.php +++ b/protected/models/Veranstaltung.php @@ -115,6 +115,7 @@ class Veranstaltung extends CActiveRecord )); } + public function now() { @@ -155,6 +156,9 @@ class Veranstaltung extends CActiveRecord ), 'sorted'=>array( 'order'=>'startzeit ASC', + ), + 'thisYear'=>array( + 'condition'=>"startzeit > STR_TO_DATE('".Yii::app()->params['start_date']."',GET_FORMAT(DATE,'EUR'))", ), ); diff --git a/protected/views/angebot/_short.php b/protected/views/angebot/_short.php new file mode 100644 index 0000000..ccbb0ff --- /dev/null +++ b/protected/views/angebot/_short.php @@ -0,0 +1,11 @@ +<?php +if(strlen(strip_tags($data->beschreibung))>50) { + $tmp = str_split(strip_tags($data->beschreibung),47); + $myBeschreibung = $tmp[0]."..."; +} else { + $myBeschreibung = strip_tags($data->beschreibung); +} +if(strlen($myBeschreibung)> 0) { + $myBeschreibung=" (Beschreibung:".$myBeschreibung.")"; +} +echo CHTML::link("<strong>".$data->name."</strong>".$myBeschreibung,array("speisTrank/view","id"=>$data->id)); ?><br /><br />
\ No newline at end of file diff --git a/protected/views/veranstaltung/index.php b/protected/views/veranstaltung/index.php index c7e1145..4415f85 100644 --- a/protected/views/veranstaltung/index.php +++ b/protected/views/veranstaltung/index.php @@ -13,7 +13,7 @@ $this->menu=array( <?php $this->widget('zii.widgets.CListView', array( - 'dataProvider'=>$model->published()->sorted()->search(), + 'dataProvider'=>$model->published()->thisYear()->sorted()->search(), 'itemView'=>'_short_all', // refers to the partial view named '_post' 'sortableAttributes'=>array( 'startzeit', 'titel' diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php index 937a99b..76ddd88 100644 --- a/protected/views/verein/view.php +++ b/protected/views/verein/view.php @@ -9,6 +9,9 @@ $this->pageTitle = $model->name . ' - ' . Yii::app()->name; array('label'=>'Vereine verwalten', 'url'=>array('index')), );*/ +if ($model->hintergrund && ""!=$model->hintergrund) { + $this->astafAdditionalStyle="background-repeat:no-repeat;background-image: url('".$model->hintergrund."');"; +} ?> <h3><?php echo $model->name; ?></h3> diff --git a/themes/astaf/views/layouts/main.php b/themes/astaf/views/layouts/main.php index 4a517b6..092ff25 100644 --- a/themes/astaf/views/layouts/main.php +++ b/themes/astaf/views/layouts/main.php @@ -128,7 +128,7 @@ */?> <section class="ym-grid linearize-level-1"> <article class="ym-g66 ym-gl content"> - <div class="ym-gbox-left ym-clearfix"> + <div class="ym-gbox-left ym-clearfix" style="<?php echo $this->astafAdditionalStyle; ?>" > <?php echo $content; ?><?php /* ?> <!--<img src="http://dummyimage.com/240x160/cccccc/fff.png" alt="" class="float-left bordered"/> |
