diff options
| author | Patrick Seeger <pseeger@ccwn.org> | 2014-06-18 11:02:38 +0200 |
|---|---|---|
| committer | Patrick Seeger <pseeger@ccwn.org> | 2014-06-18 11:02:38 +0200 |
| commit | 5a44c2c532f6375972bc5686b541e860b24590f9 (patch) | |
| tree | 7554c8ed1eb19ae46dd8750c92aa226adc25a0e6 | |
| parent | 2e3cd85aded2980adb9ff7aedfe138d8c0def309 (diff) | |
Erster Draft für Bühnenprogramm
| -rw-r--r-- | protected/controllers/VeranstaltungController.php | 19 | ||||
| -rw-r--r-- | protected/views/veranstaltung/stage.php | 50 |
2 files changed, 67 insertions, 2 deletions
diff --git a/protected/controllers/VeranstaltungController.php b/protected/controllers/VeranstaltungController.php index 1f55d0b..6333702 100644 --- a/protected/controllers/VeranstaltungController.php +++ b/protected/controllers/VeranstaltungController.php @@ -15,7 +15,7 @@ class VeranstaltungController extends Controller { return array( 'accessControl', // perform access control for CRUD operations - array('COutputCache - index,now','duration'=>3600,'varyByParam'=>array('id','slug')), + array('COutputCache - index,now,stage','duration'=>3600,'varyByParam'=>array('id','slug')), ); } @@ -28,7 +28,7 @@ class VeranstaltungController extends Controller { return array( array('allow', // allow admin user to perform 'admin' and 'delete' actions - 'actions'=>array('index','view','now'), + 'actions'=>array('index','view','now', 'stage'), 'users'=>array('*'), ), array('deny', // deny all users @@ -79,6 +79,21 @@ class VeranstaltungController extends Controller } /** + * Displays a particular model. + * @param integer $id the ID of the model to be displayed + */ + public function actionStage($id) + { + $model = Standort::model()->findByPk($id); + if($model===null) + throw new CHttpException(404,'The requested page does not exist.'); + + $this->render('stage',array( + 'model'=>$model, + )); + } + + /** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded diff --git a/protected/views/veranstaltung/stage.php b/protected/views/veranstaltung/stage.php new file mode 100644 index 0000000..a38d1de --- /dev/null +++ b/protected/views/veranstaltung/stage.php @@ -0,0 +1,50 @@ +<?php +$this->breadcrumbs=array( + 'Veranstaltungen', +); +$this->pageTitle = 'Programmpunkte auf der Bühne '.$model->name.' - ' . Yii::app()->name; + +$this->menu=array( + array('label'=>'Jetzt auf dem Fest', 'url'=>array('now')), + //array('label'=>'Veranstaltung suchen', 'url'=>array('search')), +);?> + +<h3>Bühnenprogramm <?php echo $model->name?> </h3> +<?php +$freitag=new CActiveDataProvider('Veranstaltung', array( + 'criteria'=>array( + 'condition'=>'standort_id='.$model->id." and published=1 and dayofweek(startzeit)=6", + ), +)); +$samstag=new CActiveDataProvider('Veranstaltung', array( + 'criteria'=>array( + 'condition'=>'standort_id='.$model->id." and published=1 and dayofweek(startzeit)=7", + ), +)); +$sonntag=new CActiveDataProvider('Veranstaltung', array( + 'criteria'=>array( + 'condition'=>'standort_id='.$model->id." and published=1 and dayofweek(startzeit)=1", + ), +)); +?> +<h4>Freitag</h4> +<?php +$this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$freitag, + 'itemView'=>'/veranstaltung/_short', + + ));?> +<h4>Samstag</h4> +<?php +$this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$samstag, + 'itemView'=>'/veranstaltung/_short', + + ));?> +<h4>Sonntag</h4> +<?php +$this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$sonntag, + 'itemView'=>'/veranstaltung/_short', + ));?> + |
