本文整理汇总了PHP中BOL_QuestionService::reOrderSection方法的典型用法代码示例。如果您正苦于以下问题:PHP BOL_QuestionService::reOrderSection方法的具体用法?PHP BOL_QuestionService::reOrderSection怎么用?PHP BOL_QuestionService::reOrderSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOL_QuestionService
的用法示例。
在下文中一共展示了BOL_QuestionService::reOrderSection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxResponder
//.........这里部分代码省略.........
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;
}
if (!isset($sectionQuestionOrder) || !is_array($sectionQuestionOrder) || !count($sectionQuestionOrder) > 0) {
$check = false;
}
if ($sectionName === 'no_section') {
$sectionName = null;
}
$result = false;
if ($check) {
$result = $this->questionService->reOrderQuestion($sectionName, $sectionQuestionOrder);
}
echo json_encode(array('result' => $result));
break;
case 'sortSection':
$sectionOrder = json_decode($_POST['sectionOrder'], true);
if (!isset($sectionOrder) || !is_array($sectionOrder) || !count($sectionOrder) > 0) {
return false;
}
$result = $this->questionService->reOrderSection($sectionOrder);
echo json_encode(array('result' => $result));
break;
case 'questionPages':
$question = $_POST['question'];
$required = $_POST['required'] == 'true';
$onJoin = $_POST['onJoin'] == 'true';
$onEdit = $_POST['onEdit'] == 'true';
$onView = $_POST['onView'] == 'true';
$onSearch = $_POST['onSearch'] == 'true';
$changed = !empty($_POST['changed']) ? $_POST['changed'] : null;
if (empty($question)) {
echo json_encode(array('result' => false));
exit;
}
$questionDto = $this->questionService->findQuestionByName($question);
if (!empty($questionDto)) {
$disableActionList = BOL_QuestionService::getInstance()->getQuestionDisableActionList($questionDto);
switch ($changed) {
case 'required':
if (!$disableActionList['disable_required']) {
$questionDto->required = $required;
}
break;
case 'onJoin':
if (!$disableActionList['disable_on_join']) {
$questionDto->onJoin = $onJoin;
}
break;
case 'onEdit':
if (!$disableActionList['disable_on_edit']) {
$questionDto->onEdit = $onEdit;
}
示例2: ajaxResponder
public function ajaxResponder()
{
if (empty($_POST["command"]) || !OW::getRequest()->isAjax()) {
throw new Redirect404Exception();
}
$command = (string) $_POST["command"];
switch ($command) {
case 'DeleteQuestionValue':
$result = false;
$questionName = htmlspecialchars($_POST["questionName"]);
if ($questionName === null) {
echo json_encode(array('result' => $result));
return;
}
$questionName = trim($questionName);
$value = (int) $_POST["value"];
if ($this->questionService->deleteQuestionValue($questionName, $value)) {
$result = true;
}
echo json_encode(array('result' => $result));
break;
case 'submit_add_values_form':
$questionId = (int) $_POST["questionId"];
$addQuestionValuesForm = new AddValuesForm($questionId);
$addQuestionValuesForm->isValid($_POST);
$addQuestionValuesForm->process();
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;
}
if (!isset($sectionQuestionOrder) || !is_array($sectionQuestionOrder) || !count($sectionQuestionOrder) > 0) {
$check = false;
}
if ($sectionName === 'no_section') {
$sectionName = null;
}
$result = false;
if ($check) {
$result = $this->questionService->reOrderQuestion($sectionName, $sectionQuestionOrder);
}
echo json_encode(array('result' => $result));
break;
case 'sortSection':
$sectionOrder = json_decode($_POST['sectionOrder'], true);
if (!isset($sectionOrder) || !is_array($sectionOrder) || !count($sectionOrder) > 0) {
return false;
}
$result = $this->questionService->reOrderSection($sectionOrder);
echo json_encode(array('result' => $result));
break;
default:
}
exit;
}