コード例 #1
0
ファイル: TeamsController.php プロジェクト: aniston/Platypus
 protected function _init()
 {
     parent::_init();
     $this->team = Teams::find($this->request->id);
     if ($this->team) {
         $this->set(array('team' => $this->team));
     }
 }
コード例 #2
0
 protected function _init()
 {
     parent::_init();
     // Profile Controller requires an existing user
     if (!isset($this->CURRENT_USER)) {
         $this->flashMessage('You must be logged in to view that page.', array('alertType' => 'error'));
         return $this->redirect('/');
     }
 }
コード例 #3
0
ファイル: GamesController.php プロジェクト: aniston/Platypus
 protected function _init()
 {
     parent::_init();
     // TODO: Save filter to automatically set winner?
     $this->game = Games::find($this->request->id);
     if ($this->game) {
         $this->set(array('game' => $this->game));
     }
 }
コード例 #4
0
 protected function _init()
 {
     parent::_init();
     $this->league = Leagues::find($this->request->id);
     if ($this->league) {
         $this->set(array('league' => $this->league));
     }
     // Keep empty fields from being converted to zeros.
     if ($this->request->data and isset($this->request->data['player_limit'])) {
         if ($this->request->data['player_limit']['male'] === '') {
             unset($this->request->data['player_limit']['male']);
         }
         if ($this->request->data['player_limit']['female'] === '') {
             unset($this->request->data['player_limit']['female']);
         }
     }
 }
コード例 #5
0
ファイル: FieldsController.php プロジェクト: aniston/Platypus
 protected function _init()
 {
     parent::_init();
     $this->field = FieldSites::find($this->request->id);
     if ($this->field) {
         $this->set(array('field' => $this->field));
     }
     // Keep empty fields from being converted to zeros.
     if ($this->request->data and isset($this->request->data['latitude'])) {
         if ($this->request->data['latitude'] === '') {
             unset($this->request->data['latitude']);
         }
         if ($this->request->data['longitude'] === '') {
             unset($this->request->data['longitude']);
         }
     }
 }
コード例 #6
0
 protected function _init()
 {
     parent::_init();
     if (!isset($this->CURRENT_USER)) {
         $this->flashMessage('You must be logged in to view that page.', array('alertType' => 'error'));
         return $this->redirect('Leagues::index');
     }
     if (!isset($this->request->id)) {
         #$this->flashMessage('Registration ID not supplied.', array('alertType' => 'error'));
         return $this->redirect('Leagues::index');
     }
     $this->_registration = Registrations::find($this->request->id);
     if (!isset($this->_registration)) {
         $this->flashMessage('Could not load that registration.', array('alertType' => 'error'));
         return $this->redirect('Leagues::index');
     }
     $this->set(array('registration' => $this->_registration, 'league' => $this->_registration->getLeague(), 'user' => $this->_registration->getUser()));
 }