<commit_before><?php
/*---------------------------------------------------------------------------
 * @Project: Alto CMS
 * @Project URI: http://altocms.com
 * @Description: Advanced Community Engine
 * @Copyright: Alto CMS Team
 * @License: GNU GPL v2 & MIT
 *----------------------------------------------------------------------------
 * Based on
 *   LiveStreet Engine Social Networking by <NAME>
 *   Site: www.livestreet.ru
 *   E-mail: <EMAIL>
 *----------------------------------------------------------------------------
 */

/**
 * Экшен обработки ajax запросов
 * Ответ отдает в JSON фомате
 *
 * @package actions
 * @since   1.0
 */
class ActionAjax extends Action {
    /**
     * Текущий пользователь
     *
     * @var ModuleUser_EntityUser|null
     */
    protected $oUserCurrent = null;

    /**
     * Инициализация
     */
    public function Init() {

        // * Устанавливаем формат ответа
        E::ModuleViewer()->SetResponseAjax('json');

        // * Получаем текущего пользователя
        $this->oUserCurrent = E::ModuleUser()->GetUserCurrent();
    }

    /**
     * Регистрация евентов
     */
    protected function RegisterEvent() {
        if (C::Get('rating.enabled')) {
            $this->AddEventPreg('/^vote$/i', '/^comment$/', 'EventVoteComment');
            $this->AddEventPreg('/^vote$/i', '/^topic$/', 'EventVoteTopic');
            $this->AddEventPreg('/^vote$/i', '/^blog$/', 'EventVoteBlog');
            $this->AddEventPreg('/^vote$/i', '/^user$/', 'EventVoteUser');
            $this->AddEventPreg('/^vote$/i', '/^poll$/', 'EventVotePoll');
            $this->AddEventPreg('/^vote$/i', '/^question$/', 'EventVoteQuestion');
        }

        $this->AddEventPreg('/^favourite$/i', '/^save-tags/', 'EventFavouriteSaveTags');
        $this->AddEventPreg('/^favourite$/i', '/^topic$/', 'EventFavouriteTopic');
        $this->AddEventPreg('/^favourite$/i', '/^comment$/', 'EventFavouriteComment');
        $this->AddEventPreg('/^favourite$/i', '/^talk$/', 'EventFavouriteTalk');

        $this->AddEventPreg('/^stream$/i', '/^comment$/', 'EventStreamComment');<commit_msg>Исправлено голосование за варианты ответов в опросе, #353<commit_after><?php
/*---------------------------------------------------------------------------
 * @Project: Alto CMS
 * @Project URI: http://altocms.com
 * @Description: Advanced Community Engine
 * @Copyright: Alto CMS Team
 * @License: GNU GPL v2 & MIT
 *----------------------------------------------------------------------------
 * Based on
 *   LiveStreet Engine Social Networking by <NAME>
 *   Site: www.livestreet.ru
 *   E-mail: <EMAIL>
 *----------------------------------------------------------------------------
 */

/**
 * Экшен обработки ajax запросов
 * Ответ отдает в JSON фомате
 *
 * @package actions
 * @since   1.0
 */
class ActionAjax extends Action {
    /**
     * Текущий пользователь
     *
     * @var ModuleUser_EntityUser|null
     */
    protected $oUserCurrent = null;

    /**
     * Инициализация
     */
    public function Init() {

        // * Устанавливаем формат ответа
        E::ModuleViewer()->SetResponseAjax('json');

        // * Получаем текущего пользователя
        $this->oUserCurrent = E::ModuleUser()->GetUserCurrent();
    }

    /**
     * Регистрация евентов
     */
    protected function RegisterEvent() {
        if (C::Get('rating.enabled')) {
            $this->AddEventPreg('/^vote$/i', '/^comment$/', 'EventVoteComment');
            $this->AddEventPreg('/^vote$/i', '/^topic$/', 'EventVoteTopic');
            $this->AddEventPreg('/^vote$/i', '/^blog$/', 'EventVoteBlog');
            $this->AddEventPreg('/^vote$/i', '/^user$/', 'EventVoteUser');
        }

        $this->AddEventPreg('/^vote$/i', '/^poll$/', 'EventVotePoll');
        $this->AddEventPreg('/^vote$/i', '/^question$/', 'EventVoteQuestion');

        $this->AddEventPreg('/^favourite$/i', '/^save-tags/', 'EventFavouriteSaveTags');
        $this->AddEventPreg('/^favourite$/i', '/^topic$/', 'EventFavouriteTopic');
        $this->AddEventPreg('/^favourite$/i', '/^comment$/', 'EventFavouriteComment');
        $this->AddEventPreg('/^favourite$/i', '/^talk$/', 'EventFavouriteTalk');

        $this->AddEventPreg('/^stream$/i', '/^comment$/', 'EventStreamComment');
{'fraction_non_alphanumeric': 0.28143291969093887, 'fraction_numerical': 0.002107234839616015, 'mean_word_length': 1.9604989604989604, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4728876', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1321, 'n_words': 224}