Exemplo n.º 1
0
 public function viewAction()
 {
     $id = Zend_Filter::filterStatic($this->_getParam('id'), 'int');
     $string = $this->_getParam('string');
     $session = new Zend_Session_Namespace('data');
     $restriction = Content_Model_Restriction::verify($id);
     if (empty($restriction['has'])) {
         $table = new Tri_Db_Table('content');
         $contentAccess = new Tri_Db_Table('content_access');
         $this->view->data = $table->find($id)->current();
         $data['content_id'] = $id;
         $data['user_id'] = Zend_Auth::getInstance()->getIdentity()->id;
         $data['classroom_id'] = $session->classroom_id;
         $contentAccess->createRow($data)->save();
     } else {
         $this->view->restriction = $this->view->translate($restriction['content']) . " " . $restriction['value'];
     }
 }