Пример #1
0
 public static function addAdminSettings($params = array())
 {
     if (self::_isPost()) {
         CMA_AnswerThread::setQuestionAutoApproved(isset($_POST['questions_auto_approve']) && $_POST['questions_auto_approve'] == 1);
         CMA_AnswerThread::setAnswerAutoApproved(isset($_POST['answers_auto_approve']) && $_POST['answers_auto_approve'] == 1);
         CMA_AnswerThread::setRatingAllowed(isset($_POST['ratings']) && $_POST['ratings'] == 1);
         CMA_AnswerThread::setNegativeRatingAllowed(isset($_POST['negative_ratings']) && $_POST['negative_ratings'] == 1);
         CMA_AnswerThread::setNewQuestionNotification(stripslashes($_POST['notification_new_questions']));
         CMA_AnswerThread::setNewQuestionNotificationTitle(stripslashes($_POST['new_question_notification_title']));
         CMA_AnswerThread::setNewQuestionNotificationContent($_POST['new_question_notification_content']);
         CMA_AnswerThread::setNotificationTitle(stripslashes($_POST['notification_title']));
         CMA_AnswerThread::setNotificationContent(stripslashes($_POST['notification_content']));
         CMA_AnswerThread::setVotesMode((int) $_POST['votes_mode']);
         CMA_AnswerThread::setSidebarEnabled(isset($_POST['sidebar_enable']) && $_POST['sidebar_enable'] == 1);
         CMA_AnswerThread::setSidebarMaxWidth((int) $_POST['sidebar_max_width']);
         if (!empty($_POST['questions_title'])) {
             update_option(CMA_AnswerThread::OPTION_QUESTIONS_TITLE, $_POST['questions_title']);
         }
         self::setAnswersMenu(isset($_POST['add_menu']) && $_POST['add_menu'] == 1);
     }
     $params['ratings'] = CMA_AnswerThread::isRatingAllowed();
     $params['negativeRatings'] = CMA_AnswerThread::isNegativeRatingAllowed();
     $params['questionAutoApproved'] = CMA_AnswerThread::isQuestionAutoApproved();
     $params['answerAutoApproved'] = CMA_AnswerThread::isAnswerAutoApproved();
     $params['notificationNewQuestions'] = CMA_AnswerThread::getNewQuestionNotification();
     $params['newQuestionNotificationTitle'] = CMA_AnswerThread::getNewQuestionNotificationTitle();
     $params['newQuestionNotificationContent'] = CMA_AnswerThread::getNewQuestionNotificationContent();
     $params['notificationTitle'] = CMA_AnswerThread::getNotificationTitle();
     $params['notificationContent'] = CMA_AnswerThread::getNotificationContent();
     $params['votesMode'] = CMA_AnswerThread::getVotesMode();
     $params['sidebarEnable'] = CMA_AnswerThread::isSidebarEnabled();
     $params['sidebarMaxWidth'] = CMA_AnswerThread::getSidebarMaxWidth();
     $params['addMenu'] = self::addAnswersMenu();
     $params['questions_title'] = CMA_AnswerThread::getQuestionsTitle();
     return $params;
 }