protected function process_data(&$signal) { $result = parent::process_data($signal); if (empty($this->file_body)) { if (!empty($this->file) && is_readable($this->file)) { $this->file_body = file_get_contents($this->file); } } $params = $this->get_task_params(); $params['title'] = $signal->data_title($this->default_data_key); if (is_null($params['title'])) { return false; } require_once dirname(__FILE__) . '/../../../../core/tasks//upload_file.php'; $task = new Task_UploadFile($this->core); $result = $task->go($params); $this->set_jobdata($result, array('title' => $params['title'])); return $result; }
public function upload_file($filename, $comment, $file_body, $text = NULL, $watch = NULL, $ignorewarnings = NULL) { $params = array('title' => $filename, 'comment' => $comment, 'file' => $file_body, 'text' => $text, 'watch' => $watch, 'ignorewarnings' => $ignorewarnings); require_once dirname(__FILE__) . '/../../core/tasks/upload_file.php'; $task = new Task_UploadFile($this->core); return $task->go($params); }