$arFields["GROUP_ID"] = $arUGroupsEx; } $ID = $ib->Add($arFields); if ($ID <= 0) { $arError[] = array("code" => "iblock is not added", "title" => $ib->LAST_ERROR); $DB->Rollback(); } else { $DB->Commit(); $_REQUEST["new_iblock_name"] = ""; $_REQUEST["new_iblock"] = "created"; } } } if (!empty($arError)) { require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/webdav/include.php'; $strWarning = WDShowError($arError); ShowError($strWarning); } else { ?> <script> window.location='/bitrix/admin/module_admin.php?step=2&lang=<?php echo LANGUAGE_ID; ?> &id=webdav&install=y<?php echo $ID > 0 ? "&iblock=" . $ID : ""; ?> &<?php echo bitrix_sessid_get(); ?> '; </script>
$uploader["url"] = WDAddPageParams($uploader["url"], array('result' => 'doc' . $file_res['id'])); $uploader["element_id"] = $file_res["id"]; } } $arResult["RETURN_DATA"] = $uploader; if ($_REQUEST["FORMAT_ANSWER"] != "return") { if ($_REQUEST["AJAX_CALL"] == "Y") { $APPLICATION->RestartBuffer(); //if ($_REQUEST["CONVERT"] == "Y") //array_walk($uploader, '__Escape'); echo CUtil::PhpToJSObject($uploader); die; } elseif (!$bVarsFromForm) { LocalRedirect($url); } } else { $arResult["RETURN_DATA"]["current_files"] = $result["FILE_INFO"]; $arResult["RETURN_DATA"]["url"] = $url; if ($_REQUEST["AJAX_CALL"] == "Y" || !$bVarsFromForm) { return $arResult["RETURN_DATA"]; } } if ($bVarsFromForm) { if (!empty($uploader['fatal_errors'])) { $arResult["ERROR_MESSAGE"] = WDShowError($uploader['fatal_errors']); } else { foreach ($uploader['files'] as $res) { $arResult["ERROR_MESSAGE"] .= WDShowError($res["error"]) . "<br />"; } } }