uawdijnntqw1x1x1
IP : 216.73.216.180
Hostname : xhost1.intravision.ru
Kernel : Linux xhost1.intravision.ru 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
files
/
need-2-delete
/
.
/
mini-borishof.ru1
/
bitrix
/
modules
/
forum
/
lib
/
comments
/
eventmanager.php
/
/
<?php namespace Bitrix\Forum\Comments; use \Bitrix\Main\Loader; class EventManager { public static function init() { if (IsModuleInstalled("iblock")) { AddEventHandler("forum", "onAfterMessageAdd", array(__CLASS__, "updateIBlockPropertyAfterAddingMessage")); AddEventHandler("forum", "onMessageModerate", array(__CLASS__, "updateIBlockProperty")); AddEventHandler("forum", "onAfterMessageDelete", array(__CLASS__, "updateIBlockPropertyAfterDeletingMessage")); } AddEventHandler("forum", "onMessageIsIndexed", array(__CLASS__, "onMessageIsIndexed")); } public static function updateIBlockPropertyAfterAddingMessage($ID, $arFields, $arTopic = array()) { if ($ID > 0 && $arFields["PARAM1"] != "IB" && $arFields["APPROVED"] == "Y") { self::updateIBlockProperty($ID, "SHOW", $arFields, $arTopic); } } public static function updateIBlockPropertyAfterDeletingMessage($ID, $arFields) { if ($ID > 0 && $arFields["PARAM1"] != "IB" && $arFields["APPROVED"] == "Y") { self::updateIBlockProperty($ID, "HIDE", $arFields); } } public static function updateIBlockProperty($ID, $TYPE, $arMessage, $arTopic = array()) { if ($ID > 0 && $arMessage["PARAM1"] != "IB" && IsModuleInstalled("iblock")) { $arTopic = (empty($arTopic) ? \CForumTopic::GetByID($arMessage["TOPIC_ID"]) : $arTopic); if (!empty($arTopic) && $arTopic["XML_ID"] == "IBLOCK_".$arMessage["PARAM2"] && \CModule::IncludeModule("iblock")) { \CIBlockElement::SetPropertyValuesEx($arMessage["PARAM2"], 0, array( "FORUM_MESSAGE_CNT" => array( "VALUE" => \CForumMessage::GetList(array(), array("TOPIC_ID" => $arMessage["TOPIC_ID"], "APPROVED" => "Y", "!PARAM1" => "IB"), true), "DESCRIPTION" => "", ) )); } } } /** * Event before indexing message. * @param integer $id Message ID. * @param array $message Message data. * @param array &$index Search index array. * @return boolean */ public static function onMessageIsIndexed($id, array $message, array &$index) { if (!empty($message["PARAM1"]) && !empty($message["PARAM2"])) return false; if (isset($message["XML_ID"]) && !empty($message["XML_ID"])) { if ( ($protoEntity = Entity::getEntityByXmlId($message["XML_ID"])) && (!is_null($protoEntity)) && (empty($protoEntity["moduleId"]) || Loader::includeModule($protoEntity["moduleId"])) && is_callable(array($protoEntity["className"], "onmessageisindexed")) ) { $b = call_user_func_array( array($protoEntity["className"], "onmessageisindexed"), array($id, $message, &$index) ); if ($b === false) return false; } } return true; } }
/var/files/need-2-delete/./mini-borishof.ru1/bitrix/modules/forum/lib/comments/eventmanager.php