From 5a44c2c532f6375972bc5686b541e860b24590f9 Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Wed, 18 Jun 2014 11:02:38 +0200 Subject: =?UTF-8?q?Erster=20Draft=20f=C3=BCr=20B=C3=BChnenprogramm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protected/controllers/VeranstaltungController.php | 19 ++++++++- protected/views/veranstaltung/stage.php | 50 +++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 protected/views/veranstaltung/stage.php 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 @@ +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')), +);?> + +

Bühnenprogramm name?>

+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", + ), +)); +?> +

Freitag

+widget('zii.widgets.CListView', array( + 'dataProvider'=>$freitag, + 'itemView'=>'/veranstaltung/_short', + + ));?> +

Samstag

+widget('zii.widgets.CListView', array( + 'dataProvider'=>$samstag, + 'itemView'=>'/veranstaltung/_short', + + ));?> +

Sonntag

+widget('zii.widgets.CListView', array( + 'dataProvider'=>$sonntag, + 'itemView'=>'/veranstaltung/_short', + ));?> + -- cgit v1.0-28-g1787