Exemplo n.º 1
0
 public function treatImageAction()
 {
     $imageMapper = new ImageMapper();
     $id = $this->getRequest()->getParam('id');
     if ($this->getRequest()->getPost()) {
         $imageTitle = $this->getRequest()->getPost('imageTitle');
         $imageDesc = $this->getRequest()->getPost('imageDesc');
         $model = new \Modules\Gallery\Models\Image();
         $model->setId($id);
         $model->setImageTitle($imageTitle);
         $model->setImageDesc($imageDesc);
         $imageMapper->saveImageTreat($model);
         $this->addMessage('Success');
     }
     $this->getView()->set('image', $imageMapper->getImageById($id));
 }
Exemplo n.º 2
0
 public function treatImageAction()
 {
     $imageMapper = new ImageMapper();
     $id = (int) $this->getRequest()->getParam('id');
     $gallery = (int) $this->getRequest()->getParam('gallery');
     $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('gallery'), array('action' => 'index'))->add($this->getTranslator()->trans('treatImage'), array('action' => 'treatimage', 'gallery' => $gallery, 'id' => $id));
     if ($this->getRequest()->getPost()) {
         $imageTitle = $this->getRequest()->getPost('imageTitle');
         $imageDesc = $this->getRequest()->getPost('imageDesc');
         $model = new \Modules\Gallery\Models\Image();
         $model->setId($id);
         $model->setImageTitle($imageTitle);
         $model->setImageDesc($imageDesc);
         $imageMapper->saveImageTreat($model);
         $this->addMessage('Success');
     }
     $this->getView()->set('image', $imageMapper->getImageById($id));
 }