本文整理汇总了PHP中BOL_QuestionService::updateQuestionValues方法的典型用法代码示例。如果您正苦于以下问题:PHP BOL_QuestionService::updateQuestionValues方法的具体用法?PHP BOL_QuestionService::updateQuestionValues怎么用?PHP BOL_QuestionService::updateQuestionValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOL_QuestionService
的用法示例。
在下文中一共展示了BOL_QuestionService::updateQuestionValues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxResponder
//.........这里部分代码省略.........
echo json_encode(array('result' => $result));
break;
case 'deleteAccountType':
if (!empty($_POST['accountType']) && mb_strlen($_POST['accountType']) > 0) {
$accountTypes = $this->questionService->findAllAccountTypes();
$accountTypeList = array();
foreach ($accountTypes as $key => $account) {
if ($account->name != $_POST['accountType']) {
$accountTypeList[$account->name] = $account->name;
}
}
if (empty($accountTypeList)) {
echo json_encode(array('result' => "false", 'message' => OW::getLanguage()->text('admin', 'questions_cant_delete_last_account_type')));
exit;
} else {
if ($this->questionService->deleteAccountType($_POST['accountType'])) {
echo json_encode(array('result' => "success", 'message' => OW::getLanguage()->text('admin', 'questions_account_type_was_deleted')));
exit;
}
}
}
echo json_encode(array('result' => "false"));
exit;
break;
case 'AddQuestionValues':
$result = false;
$questionId = (int) $_POST["questionId"];
$question = $this->questionService->findQuestionById($questionId);
$values = !empty($_POST["values"]) && is_array($_POST["values"]) ? $_POST["values"] : array();
if (empty($question) || empty($values)) {
echo json_encode(array('result' => $result));
return;
}
if ($this->questionService->updateQuestionValues($question, $values)) {
$result = true;
}
echo json_encode(array('result' => $result));
break;
case 'AddAccountType':
$result = false;
$name = htmlspecialchars($_POST["accountTypeName"]);
$roleId = (int) $_POST["role"];
$accountType = new BOL_QuestionAccountType();
$accountType->name = $name;
$accountType->roleId = $roleId;
$form = new ADMIN_CLASS_AddAccountTypeForm($accountType);
$result = false;
if ($form->isValid($_POST)) {
$result = $form->process($_POST);
}
echo json_encode(array('result' => $result, 'accountTypeName' => $name, 'roleId' => $roleId));
break;
case 'sortAccountType':
$sortAccountType = json_decode($_POST['accountTypeList'], true);
$result = false;
if (isset($sortAccountType) && is_array($sortAccountType) && count($sortAccountType) > 0) {
$result = $this->questionService->reOrderAccountType($sortAccountType);
}
echo json_encode(array('result' => $result));
break;
case 'sortQuestions':
$sectionName = htmlspecialchars($_POST['sectionName']);
$sectionQuestionOrder = json_decode($_POST['questionOrder'], true);
$check = true;
if (!isset($sectionName)) {
$check = false;