• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/textparser.php
  • Класс: CTextParser
  • Вызов: CTextParser::convert_department
public function convert_department(array $matches): string
{
	static $pathToDepartment = null;

	$departmentName = $matches[2];
	$departmentId = (int)$matches[1];

	$renderParams = [
		'DEPARTMENT_ID' => $departmentId,
		'DEPARTMENT_NAME' => $departmentName,
	];

	if ($departmentId > 0)
	{
		if ($pathToDepartment === null)
		{
			// then replace to BitrixSocialnetworkHelperPath::get('department_path_template')
			$pathToDepartment = Option::get('main', 'TOOLTIP_PATH_TO_CONPANY_DEPARTMENT', SITE_DIR . 'company/structure.php?set_filter_structure=Y&structure_UF_DEPARTMENT=#ID#', SITE_ID);
		}

		$renderParams['PATH_TO_DEPARTMENT'] = $pathToDepartment;
	}

	$res = $this->render_department($renderParams);

	return $this->defended_tags($res);
}