return; } //$arResult['TOPLINKS'] = CWikiUtils::getRightsLinks(array('article', 'history'), $arParams); $documentId = array('iblock', 'CWikiDocument', $arParams['ELEMENT_ID']); $bCanUserWrite = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::WriteDocument, $GLOBALS['USER']->GetID(), $documentId, array('UserGroups' => $GLOBALS['USER']->GetUserGroupArray())); if (!$bCanUserWrite) { $this->AbortResultCache(); ShowError(GetMessage('WIKI_ACCESS_DENIED')); return; } if (!empty($historyId) && check_bitrix_sessid()) { $this->AbortResultCache(); if (isset($_REQUEST['delete'])) { if (CWikiUtils::IsDeleteable()) { $historyService = new CBPHistoryService(); $historyService->DeleteHistory($historyId, array('iblock', 'CWikiDocument', $arParams['ELEMENT_ID'])); $CACHE_MANAGER->ClearByTag('wiki_' . $arParams['ELEMENT_ID']); LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId))); } else { $this->AbortResultCache(); ShowError(GetMessage('WIKI_ACCESS_DENIED')); return; } } else { try { $CWIKI = new CWiki(); if ($CWIKI->Recover($historyId, $arParams['ELEMENT_ID'], $arParams['IBLOCK_ID'])) { // $arResult["MESSAGE"] = GetMessage('WIKI_PAGE_RECOVER'); // so how could it change the name $arResult['ELEMENT_NEW'] = CWiki::GetElementById($arParams['ELEMENT_ID'], $arFilter); if (CWiki::GetDefaultPage($arParams['IBLOCK_ID']) == $arResult['ELEMENT']['NAME'] && $arResult['ELEMENT']['NAME'] != $arResult['ELEMENT_NEW']['NAME']) {
public static function Delete($id, $documentId = null) { $h = new CBPHistoryService(); $h->DeleteHistory($id, $documentId); }