• Модуль: dav
  • Путь к файлу: ~/bitrix/modules/dav/classes/general/exchangeclientrequest.php
  • Класс: CDavExchangeClientRequest
  • Вызов: CDavExchangeClientRequest::CreateGetFolderBody
public function CreateGetFolderBody($folderId = null, $folderShape = "AllProperties")
{
	$arMapTmp = array("idonly" => "IdOnly", "id_only" => "IdOnly", "allproperties" => "AllProperties", "all_properties" => "AllProperties");
	$folderShapeLower = mb_strtolower($folderShape);
	if (array_key_exists($folderShapeLower, $arMapTmp))
		$folderShape = $arMapTmp[$folderShapeLower];
	else
		$folderShape = "AllProperties";

	$this->body  = "<"."?xml version="1.0" encoding="utf-8"?".">rn";
	$this->body .= "rn";
	$this->body .= " rn";
	$this->body .= "  rn";
	$this->body .= "   rn";
	$this->body .= "    ".$folderShape."rn";
	$this->body .= "   rn";

	$this->body .= "   rn";

	if (!is_array($folderId))
		$folderId = array("id" => $folderId);

	$arKeys = array_keys($folderId);
	if (!empty($folderId))
	{
		if ($arKeys[0]."!" != "0!")
		{
			$folderId = [$folderId];
		}
	}

	$arMapTmp = array("mailbox" => "Mailbox", "id" => "Id", "xml_id" => "Id", "changekey" => "ChangeKey", "modification_label" => "ChangeKey");
	foreach ($folderId as $value)
	{
		CDavExchangeClient::NormalizeArray($value, $arMapTmp);

		$id = (isset($value["Id"]) ? $value["Id"] : null);
		$changekey = (isset($value["ChangeKey"]) ? $value["ChangeKey"] : null);
		$mailbox = (isset($value["Mailbox"]) ? $value["Mailbox"] : null);

		if (!in_array($id, self::$arDistinguishedFolderIdNameType))
		{
			$this->body .= "    body .= " ChangeKey="".htmlspecialcharsbx($changekey).""";
			$this->body .= " xmlns="http://schemas.microsoft.com/exchange/services/2006/types"/>rn";
		}
		else
		{
			$this->body .= "    body .= " ChangeKey="".htmlspecialcharsbx($changekey).""";
			$this->body .= " xmlns="http://schemas.microsoft.com/exchange/services/2006/types"";
			if (!is_null($mailbox) && !empty($mailbox))
				$this->body .= ">".htmlspecialcharsbx($mailbox)."rn";
			else
				$this->body .= "/>rn";
		}
	}

	$this->body .= "   rn";

	$this->body .= "  rn";
	$this->body .= " rn";
	$this->body .= "";
}