/** * Save data to DB */ function save() { $plugin = $this->object->getPlugin(); $result = $this->writePostData(); if ($result == 1) { ilUtil::sendFailure($plugin->txt("errorInput"), true); $this->editQuestion(); } else { parent::save(); } }
/** * Command: save the question */ public function save() { // assQuestionGUI::save() // - calls writePostData // - redirects after successful saving // - otherwise does nothing parent::save(); // question couldn't be saved $this->form->setValuesByPost(); $this->getQuestionTemplate(); $this->tpl->setVariable("QUESTION_DATA", $this->form->getHTML()); }
function save() { $unfilled_answer = false; foreach ($_POST as $key => $value) { if (preg_match("/answer_(\\d+)/", $key, $matches)) { if (!$value) { $unfilled_answer = true; } } } if ($unfilled_answer) { ilUtil::sendInfo($this->lng->txt("qpl_answertext_fields_not_filled")); $this->writePostData(); $this->editQuestion(); } else { parent::save(); } }