Exemple #1
0
$componentPage = 'edit';
/********************************************************************
				Input params
********************************************************************/
$arParams["EDIT"] = $arParams["EDIT"] == 'Y' ? $arParams["EDIT"] : 'N';
$arParams["PARAMS"] = is_array($arParams["PARAMS"]) ? $arParams["PARAMS"] : array();
$arParams["RESULT"] = is_array($arParams["RESULT"]) ? $arParams["RESULT"] : array();
$arParams["DATE_TIME_FORMAT"] = trim(empty($arParams["DATE_TIME_FORMAT"]) ? $DB->DateFormatToPHP(CSite::GetDateFormat("FULL")) : $arParams["DATE_TIME_FORMAT"]);
$arParams['NAME_TEMPLATE'] = empty($arParams['NAME_TEMPLATE']) ? CSite::GetNameFormat(false) : str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
$arParams["PARAMS"]['NAME_TEMPLATE'] = $arParams['NAME_TEMPLATE'];
/********************************************************************
				/Input params
********************************************************************/
$arResult['UID'] = strtolower($arParams['PARAMS']['arUserField']['ENTITY_ID']) . "_" . $this->randString(6);
$arResult['allowExtDocServices'] = CWebDavTools::allowUseExtServiceGlobal();
$arResult['allowCreateDocByExtServices'] = CWebDavTools::allowCreateDocByExtServiceGlobal();
if (!empty($arParams['PARAMS']['arUserField']['ENTITY_ID'])) {
    if ($arParams['PARAMS']['arUserField']['ENTITY_ID'] == 'BLOG_COMMENT') {
        $arResult['URL_TO_POST'] = $arParams['PARAMS']['arUserField']['URL_TO_POST'];
        $arResult['ID_TO_POST'] = $arParams['PARAMS']['arUserField']['POST_ID'];
        if ($arResult['IS_HISTORY_DOC'] = $arParams['PARAMS']['arUserField']['USER_TYPE_ID'] == 'webdav_element_history') {
            $arResult['HISTORY_DOC'] = CUserTypeWebdavElementHistory::getDataFromValue($arParams['PARAMS']['arUserField']['VALUE']);
            $arResult['HISTORY_DOC'] = array_merge($arResult['HISTORY_DOC'][0], $arResult['HISTORY_DOC'][1]);
        }
    }
    if ($arParams['PARAMS']['arUserField']['ENTITY_ID'] == 'BLOG_POST') {
        $arResult['URL_TO_POST'] = $arParams['PARAMS']['arUserField']['URL_TO_POST'];
        $arResult['ID_TO_POST'] = $arParams['PARAMS']['arUserField']['POST_ID'];
    }
}
if ($arParams['EDIT'] == 'Y') {