- Модуль: pull
- Путь к файлу: ~/bitrix/modules/pull/lib/rest.php
- Класс: BitrixPullRest
- Вызов: Rest::pushTypesGet
static function pushTypesGet($params, $n, CRestServer $server)
{
$params = array_change_key_case($params, CASE_UPPER);
$userConfig = Array();
$config = BitrixPullPush::getTypes();
$withUserValues = false;
if (isset($params['USER_VALUES']) && $params['USER_VALUES'] === 'Y')
{
$withUserValues = true;
$userConfig = BitrixPullPush::getConfig();
}
$result = Array();
foreach ($config as $moduleId => $module)
{
$types = Array();
foreach ($module['TYPES'] as $typeId => $typeConfig)
{
if ($withUserValues)
{
$typeConfig['VALUE'] = $userConfig[$moduleId][$typeId];
}
$types[] = array_change_key_case($typeConfig, CASE_LOWER);
}
$module['TYPES'] = $types;
$result[] = array_change_key_case($module, CASE_LOWER);
}
BitrixMainTypeCollection::sortByColumn($result, array('module_id' => array(SORT_STRING, SORT_ASC)));
return $result;
}