本文整理汇总了PHP中BOL_QuestionService::getQuestionDisableActionList方法的典型用法代码示例。如果您正苦于以下问题:PHP BOL_QuestionService::getQuestionDisableActionList方法的具体用法?PHP BOL_QuestionService::getQuestionDisableActionList怎么用?PHP BOL_QuestionService::getQuestionDisableActionList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOL_QuestionService
的用法示例。
在下文中一共展示了BOL_QuestionService::getQuestionDisableActionList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: accountTypes
public function accountTypes($params = array())
{
$serviceLang = BOL_LanguageService::getInstance();
$language = OW::getLanguage();
$currentLanguageId = OW::getLanguage()->getCurrentId();
// -- Get all section, questions and question values --
$questions = $this->questionService->findAllQuestionsBySectionForAccountType('all');
$section = null;
$questionBySectionList = array();
$sectionDeleteUrlList = array();
$parentList = array();
$questionNameList = array();
$questionList = array();
$deleteEditButtonsContent = array();
$previewQuestionValuesContent = array();
$accountTypesCheckboxContent = array();
$sectionsNameList = array_keys($questions);
$sectionDtoList = BOL_QuestionService::getInstance()->findSectionBySectionNameList($sectionsNameList);
foreach ($questions as $section => $list) {
$sectionDeleteUrlList[$section] = OW::getRouter()->urlFor('ADMIN_CTRL_Questions', 'deleteSection', array("sectionName" => $section));
$questionBySectionList[$section] = array();
foreach ($list as $question) {
$questionList[$question['name']] = $question;
//$question['questionEditUrl'] = OW::getRouter()->urlFor('ADMIN_CTRL_Questions', 'edit', array("questionId" => $question['id']));
//$question['questionDeleteUrl'] = OW::getRouter()->urlFor('ADMIN_CTRL_Questions', 'deleteQuestion', array("questionId" => $question['id']));
if (!empty($question['parent'])) {
$parent = $this->questionService->findQuestionByName($question['parent']);
if (!empty($parent)) {
$question['parentUrl'] = 'javascript://';
$question['parentLabel'] = $this->questionService->getQuestionLang($parent->name);
$question['parentId'] = $parent->id;
$parentList[$question['parent']][] = array('name' => $question['name'], 'editUrl' => 'javascript://');
} else {
$question['parent'] = '';
}
}
$questionBySectionList[$section][] = $question;
$questionNameList[] = $question['name'];
$event = new OW_Event('admin.questions.get_edit_delete_question_buttons_content', array('question' => $question), null);
OW::getEventManager()->trigger($event);
$data = $event->getData();
$deleteEditButtonsContent[$question['name']] = $data;
$event = new OW_Event('admin.questions.get_preview_question_values_content', array('question' => $question), null);
OW::getEventManager()->trigger($event);
$data = $event->getData();
$previewQuestionValuesContent[$question['name']] = $data;
$event = new OW_Event('admin.questions.get_account_types_checkbox_content', array('question' => $question), null);
OW::getEventManager()->trigger($event);
$data = $event->getData();
$accountTypesCheckboxContent[$question['name']] = $data;
}
}
$questionDtoList = BOL_QuestionService::getInstance()->findQuestionByNameList($questionNameList);
foreach ($questionList as $sort => $question) {
if (empty($question['name'])) {
continue;
}
$text = $language->text('admin', 'questions_delete_question_confirmation');
if (array_key_exists($question['name'], $parentList)) {
$questionStringList = array();
foreach ($parentList[$question['name']] as $child) {
$questionStringList[] = BOL_QuestionService::getInstance()->getQuestionLang($child['name']);
}
$text = $language->text('admin', 'questions_delete_question_parent_confirmation', array('questions' => implode(', ', $questionStringList)));
}
$text = json_encode($text);
OW::getDocument()->addOnloadScript("OW.registerLanguageKey('admin', 'questions_delete_question_confirmation_" . (int) $question['id'] . "', {$text});");
// ------------------------------------------------------------
$disableActionList = $this->questionService->getQuestionDisableActionList($questionDtoList[$question['name']]);
$questionList[$sort] = array_merge($questionList[$sort], $disableActionList);
// ------------------------------------------------------------
}
$questionValues = $this->questionService->findQuestionsValuesByQuestionNameList($questionNameList);
$accountTypeDtoList = $this->questionService->findAllAccountTypes();
$accountTypeList = array();
$valueLabels = array();
foreach ($questionValues as $name => $value) {
if (empty($valueLabels[$name])) {
$valueLabels[$name] = array();
}
/* @var $value BOL_QuestionValue */
foreach ($value['values'] as $item) {
$valueLabels[$item->questionName][$item->value] = BOL_QuestionService::getInstance()->getQuestionValueLang($item->questionName, $item->value);
}
}
foreach ($accountTypeDtoList as $dto) {
$accountTypeList[$dto->name] = $dto->name;
}
$accountTypesToQuestionsDtoList = $this->getAccountTypesToQuestionsList();
$this->assign('questionList', $questionList);
$this->assign('td_width', (int) (375 / (count($accountTypeDtoList) + 1)));
$this->assign('div_width', (int) (375 / (count($accountTypeDtoList) + 1)) - 18);
$this->assign('accountTypeDtoList', $accountTypeDtoList);
$this->assign('accountTypesCount', count($accountTypeDtoList) + 1);
$this->assign('tableColumnCount', count($accountTypeDtoList) + 5);
$this->assign('accountTypesToQuestionsDtoList', $accountTypesToQuestionsDtoList);
$this->assign('questionsBySections', $questionBySectionList);
$this->assign('questionValues', $questionValues);
$this->assign('valueLabels', $valueLabels);
$this->assign('sectionDeleteUrlList', $sectionDeleteUrlList);
//.........这里部分代码省略.........