public function actionWorkshops()
 {
     $plannedWorkshopData = WorkshopPlanned::getPlannedWorkshops();
     $workshopData = Workshop::getUpcomingWorkshops();
     /*$workshopData->pagination = new CPagination(self::listingsPerPage);*/
     $this->breadcrumbs = array('Workshops');
     $this->tabMenus = array(array('label' => 'Articles', 'url' => array('/site/articles')), array('label' => 'News', 'url' => array('/site/news')), array('label' => 'Events', 'url' => array('/event/event/index')), array('label' => 'Workshops', 'active' => true));
     $this->render('workshops', array('plannedWorkshopData' => $plannedWorkshopData, 'workshopData' => $workshopData));
 }
 public function __construct($scenario = '', $id = null, $checkApproved = false)
 {
     if ($scenario == 'view' && $id != null) {
         $this->workshopPlanned = WorkshopPlanned::model()->with('postItem')->findByPk($id);
         if ($this->workshopPlanned != null) {
             $this->postItem = $this->workshopPlanned->postItem;
         } else {
             throw new CHttpException(400, 'Cannot find the planned workshop.');
         }
     } else {
         $this->_new();
     }
 }
 /**
  * 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
  */
 public function loadModel($id)
 {
     $model = WorkshopPlanned::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }