• Модуль: wiki
  • Путь к файлу: ~/bitrix/modules/wiki/classes/general/wiki_utils.php
  • Класс: CWikiUtils
  • Вызов: CWikiUtils::SetCommentPath
static function SetCommentPath($forumID, $rightPath, $urlRewriterPath)
{
	if (!$forumID || !CModule::IncludeModule('forum') || !$rightPath || !$urlRewriterPath)
		return false;

	$arRewriter = CUrlRewriter::GetList(array("PATH"=>$urlRewriterPath));		//http://jabber.bx/view.php?id=25340

	if(!is_array($arRewriter) || empty($arRewriter))
		return false;

	$rewriteCondition = str_replace(array("#","^"),"",$arRewriter[0]["CONDITION"]);
	$rightCommentsPath = $rewriteCondition.$rightPath;

	$arActualCommentsPath = CWikiUtils::GetCommentPath($forumID);

	if(!is_array($arActualCommentsPath))
		return false;

	$arUpdateForum = array();

	foreach ($arActualCommentsPath as $site => $path)
		if($path!=$rightCommentsPath)
			$arUpdateForum["SITES"][$site] = $rightCommentsPath;

	if(!empty($arUpdateForum))
		CForumNew::Update($forumID, $arUpdateForum);

	return true;
}