function UnInstallDB($arParams = array()) { global $DB, $APPLICATION; $this->errors = false; if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") { $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/meeting/install/db/" . strtolower($DB->type) . "/uninstall.sql"); if ($this->errors === false && CModule::IncludeModule('forum')) { $dbRes = CSite::GetList($by = 'sort', $order = 'asc', array()); while ($arSite = $dbRes->Fetch()) { $forumId = COption::GetOptionInt('meeting', 'comments_forum_id', 0, $arSite['ID']); if ($forumId > 0) { CForumNew::Delete($forumId); } } } } UnRegisterModuleDependences("calendar", "OnAfterCalendarConvert", "meeting", "CMeetingEventHandlers", "OnAfterCalendarConvert"); UnRegisterModuleDependences("tasks", "OnTaskDelete", "meeting", "CMeetingEventHandlers", "OnTaskDelete"); UnRegisterModule("meeting"); if ($this->errors !== false) { $APPLICATION->ThrowException(implode("<br>", $this->errors)); return false; } return true; }
$arID[] = $arResult['ID']; } } foreach ($arID as $ID) { if (strlen($ID) <= 0) { continue; } switch ($_REQUEST['action']) { case "delete": if (!CForumNew::CanUserDeleteForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) { $lAdmin->AddGroupError(GetMessage("FA_DELETE_NO_PERMS"), $ID); continue; } @set_time_limit(0); $DB->StartTransaction(); if (!CForumNew::Delete($ID)) { $DB->Rollback(); if ($ex = $APPLICATION->GetException()) { $lAdmin->AddGroupError($ex->GetString(), $ID); } else { $lAdmin->AddGroupError(GetMessage("FA_DELETE_ERROR"), $ID); } } $DB->Commit(); break; case "activate": case "deactivate": if (!CForumNew::CanUserUpdateForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) { $lAdmin->AddUpdateError(GetMessage("FA_NO_PERMS2UPDATE") . " " . $ID . "", $ID); continue; }
$arUsers[1] = array("USER_ID" => 1, "SHOW_ABC" => "admin"); } $arAdmin = $arUsers[1]; unset($arUsers[1]); $arUser = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST1")); $arUser2 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST2")); $arUser3 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST3")); $arUser4 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST4")); $arUser5 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST5")); $arUser6 = !empty($arUsers) ? array_shift($arUsers) : array("USER_ID" => 0, "SHOW_ABC" => GetMessage("GUEST6")); $arForums = array(array("XML_ID" => "COMMUNITY_PHOTO_COMMENTS", "NAME" => GetMessage("PHOTOGALLERY_COMMENTS_FORUM_NAME"), "DESCRIPTION" => "", "SORT" => 3, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "INDEXATION" => "Y", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("2" => "M", "1" => "Y")), array("XML_ID" => "COMMUNITY_USERS_AND_GROUPS", "NAME" => GetMessage("USERS_AND_GROUPS_FORUM_NAME"), "DESCRIPTION" => GetMessage("USERS_AND_GROUPS_FORUM_DESCRIPTION"), "SORT" => 4, "ACTIVE" => "Y", "ALLOW_HTML" => "N", "ALLOW_ANCHOR" => "Y", "ALLOW_BIU" => "Y", "ALLOW_IMG" => "Y", "ALLOW_LIST" => "Y", "ALLOW_QUOTE" => "Y", "ALLOW_CODE" => "Y", "ALLOW_FONT" => "Y", "ALLOW_SMILES" => "Y", "ALLOW_UPLOAD" => "Y", "ALLOW_NL2BR" => "N", "MODERATION" => "N", "ALLOW_MOVE_TOPIC" => "Y", "ORDER_BY" => "P", "ORDER_DIRECTION" => "DESC", "LID" => LANGUAGE_ID, "PATH2FORUM_MESSAGE" => "", "ALLOW_UPLOAD_EXT" => "", "FORUM_GROUP_ID" => $arGroupID["HIDDEN"], "ASK_GUEST_EMAIL" => "N", "USE_CAPTCHA" => "N", "INDEXATION" => "Y", "SITES" => array(WIZARD_SITE_ID => WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"), "EVENT1" => "forum", "EVENT2" => "message", "EVENT3" => "", "GROUP_ID" => array("1" => "Y"))); foreach ($arForums as $arForum) { $dbForum = CForumNew::GetList(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => $arForum["XML_ID"])); if ($resForum = $dbForum->Fetch()) { if (WIZARD_INSTALL_DEMO_DATA) { CForumNew::Delete($resForum["ID"]); } else { $res = CForumNew::GetSites($resForum["ID"]); if (!array_key_exists(WIZARD_SITE_ID, $res)) { $res[WIZARD_SITE_ID] = WIZARD_SITE_DIR . "forum/messages/forum#FORUM_ID#/topic#TOPIC_ID#/message#MESSAGE_ID#/#message#MESSAGE_ID#"; CForumNew::Update($resForum["ID"], array("SITES" => $res)); } continue; } } $forumID = CForumNew::Add($arForum); if ($forumID < 1 || !isset($arForum["TOPICS"]) || !is_array($arForum["TOPICS"])) { continue; } foreach ($arForum["TOPICS"] as $arTopic) { $arTopic["FORUM_ID"] = $forumID;