Exemple #1
0
 /**
  * handle user request
  */
 function handle()
 {
     global $INPUT;
     //Send the data
     if ($INPUT->has('data')) {
         $this->sentStatus = $this->helper->sendData($INPUT->str('data'));
         if ($this->sentStatus === '') {
             //Update the last time we sent the data
             touch($this->helper->popularityLastSubmitFile);
         }
         //Deal with the autosubmit option
         $this->_enableAutosubmit($INPUT->has('autosubmit'));
     }
 }
Exemple #2
0
 function _autosubmit(Doku_Event &$event, $param)
 {
     //Do we have to send the data now
     if (!$this->helper->isAutosubmitEnabled() || $this->_isTooEarlyToSubmit()) {
         return;
     }
     //Actually send it
     $status = $this->helper->sendData($this->helper->gatherAsString());
     if ($status !== '') {
         //If an error occured, log it
         io_saveFile($this->helper->autosubmitErrorFile, $status);
     } else {
         //If the data has been sent successfully, previous log of errors are useless
         @unlink($this->helper->autosubmitErrorFile);
         //Update the last time we sent data
         touch($this->helper->autosubmitFile);
     }
     $event->stopPropagation();
     $event->preventDefault();
 }