Example #1
0
 /**
  * 
  * @param integer $id
  * @return DataSource_Section
  * @throws HTTP_Exception_404
  */
 public function section($id = NULL)
 {
     if ($this->_section instanceof DataSource_Section) {
         return $this->_section;
     }
     if ($id === NULL) {
         Messages::errors(__('Datasource section not loaded'));
         $this->go_home();
     }
     $this->_section = Datasource_Data_Manager::load((int) $id);
     if ($this->request->action() == 'index' and !$this->_section->has_access_view()) {
         $this->_deny_access();
     }
     if (empty($this->_section)) {
         Messages::errors(__('Datasource section :id not found', array(':id' => $id)));
         $this->go_home();
     }
     return $this->_section;
 }