Exemplo n.º 1
0
 public function request()
 {
     if (!$this->getRequestVar('id')) {
         return false;
     }
     $id = $this->getRequestVar('id', array(7, 9));
     $this->message = new \fpcm\modules\nkorg\inactivity_manager\model\message($id);
     if ($this->buttonClicked('msgSave')) {
         $newmessage = $this->getRequestVar('msg');
         $this->message->setText($newmessage['text']);
         $starttime = strtotime($newmessage['start']);
         $this->message->setStarttime($starttime);
         $stoptime = strtotime($newmessage['stop']);
         $this->message->setStoptime($stoptime);
         $commentsDiabled = isset($newmessage['nocomments']) ? true : false;
         $this->message->setNocomments($commentsDiabled);
         $res = $this->message->update();
         if ($res) {
             $this->redirect('modules/config', array('key' => \fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__), 'added' => 1));
             return true;
         }
         $this->view->addErrorMessage('NKORGINACTIVITY_MANAGER_SAVED_FAILED');
     }
     return parent::request();
 }
Exemplo n.º 2
0
 public function request()
 {
     if (!$this->getRequestVar('id')) {
         return false;
     }
     $id = (int) $this->getRequestVar('id');
     $this->term = new \fpcm\modules\nkorg\tweetextender\model\term($id);
     if ($this->buttonClicked('termSave')) {
         $newterm = $this->getRequestVar('term');
         $this->term->setSearchterm($newterm['search']);
         $this->term->setReplaceterm($newterm['replace']);
         $res = $this->term->update();
         if ($res) {
             $this->redirect('modules/config', array('key' => \fpcm\model\abstracts\module::getModuleKeyByFolder(__DIR__), 'added' => 1));
             return true;
         }
         $this->view->addErrorMessage('NKORG_TWEETENTENDER_SAVED_FAILED');
     }
     return parent::request();
 }