$redirect_msg = '4'; $faqObj->setVar('status', _SF_STATUS_SUBMITTED); $newAnswerObj->setVar('status', _SF_AN_STATUS_APPROVED); $notifCase = 4; } else { // New submitted answer need approbation $redirect_msg = _MD_SF_FAQ_NEW_ANSWER_NEED_APPROBATION; $faqObj->setVar('status', _SF_STATUS_NEW_ANSWER); $newAnswerObj->setVar('status', _SF_AN_STATUS_PROPOSED); $notifCase = 5; } break; } // Storing the FAQ object in the database if (!$faqObj->store()) { redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($faqObj->getErrors())); exit; } // Storing the answer object in the database if (!$newAnswerObj->store()) { redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($newAnswerObj->getErrors())); exit; } $notification_handler =& xoops_gethandler('notification'); switch ($notifCase) { case 1: // Question submitted, auto-approved; became Q&A, auto-approved // We do not not subscribe user to notification on publish since we publish it right away // Send notifications $faqObj->sendNotifications(array(_SF_NOT_FAQ_PUBLISHED)); break;