예제 #1
0
 public function ViewQuestionAction()
 {
     $request = Project::getRequest();
     $this->BaseSiteData($data);
     $id = (int) $request->getKeyByNumber(0);
     $question_cat_model = new QuestionCatModel();
     $data['question_cat_list'] = $question_cat_model->loadAll();
     if ($id > 0) {
         $question_model = new QuestionModel();
         $data['question'] = $question_model->loadQuestion($id);
         $data['question_tab'] = $question_model->getNWordsFromText($question_model->q_text, 8);
         $controller = new BaseCommentController();
         $data['comment_list'] = $controller->CommentList($id, $request->getKeyByNumber(1), 0, 'QuestionAnswer', 'ViewQuestion', 'questions', array($id));
         //			if($question_model->user_id == Project::getUser()->getDbUser()->id) $data['managed'] = true;
         $this->_view->assign('tab_list', TabController::getOwnTabs(false, false, false, false, false, false, true, false, false, false));
         //$this->_view->assign('tab_list', TabController::getQuestionAnswerTabs(true, false, false, false, false));
         $this->_view->ViewQuestion($data);
         $this->_view->parse();
     } else {
         Project::getResponse()->redirect($request->createUrl('QuestionAnswer', 'List'));
     }
 }