setControlState('Month', TPropertyValue::ensureInteger($month)); } public function getMonth() { return $this->getControlState('Month'); } public function setYear($year) { $this->setControlState('Year', TPropertyValue::ensureInteger($year)); } public function getYear() { return $this->getControlState('Year'); } public function setUserToDisplay(DbUser $user) { $this->setControlState('User', $user); } public function getUserToDisplay() { return $this->getControlState('User'); } private function _getGrid() { return $this->getFacade()->getCalendarListForUser( $this->UserToDisplay, $this->Month, $this->Year ); } public function onPreRender($param) { parent::onPreRender($param); $this->Weeks->DataSource = $this->_getGrid()->Weeks; $this->Weeks->dataBind(); } public function weekDataBind($sender, $param) { $param->Item->Days->DataSource = $param->Item->Data; $param->Item->Days->dataBind(); } public function dayDataBind($sender, $param) { $param->Item->Events->DataSource = $param->Item->Data->Events; $param->Item->Events->dataBind(); } public function eventCreate($sender, $param) { if (preg_match('/Item$/', $param->Item->ItemType)) { $renderer = 'Dummy'; if ($param->Item->Data) { $renderer = $param->Item->Data->getRendererClass(); } $eventTemplate = Prado::createComponent( 'Application.controls.grid.' . $renderer . 'GridElement' ); $eventTemplate->setData($param->Item->Data); $param->Item->addParsedObject($eventTemplate); } } } ?>