本文整理汇总了PHP中CIntranetUtils::GetDepartmentManagerOld方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::GetDepartmentManagerOld方法的具体用法?PHP CIntranetUtils::GetDepartmentManagerOld怎么用?PHP CIntranetUtils::GetDepartmentManagerOld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIntranetUtils
的用法示例。
在下文中一共展示了CIntranetUtils::GetDepartmentManagerOld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetDepartmentManagerOld
function GetDepartmentManagerOld($arDepartments, $skipUserId = false, $bRecursive = false)
{
if (!is_array($arDepartments) || empty($arDepartments)) {
return array();
}
$arManagers = array();
$dbSections = CIBlockSection::GetList(array('SORT' => 'ASC'), array('ID' => $arDepartments, 'IBLOCK_ID' => COption::GetOptionInt('intranet', 'iblock_structure', 0)), false, array('ID', 'UF_HEAD', 'IBLOCK_SECTION_ID'));
while ($arSection = $dbSections->Fetch()) {
$bFound = false;
if ($arSection["UF_HEAD"] > 0) {
$dbUser = CUser::GetByID($arSection["UF_HEAD"]);
$arUser = $dbUser->GetNext();
if ($arUser) {
if ($arUser["ID"] != $skipUserId) {
$arManagers[$arUser["ID"]] = $arUser;
$bFound = true;
}
}
}
if (!$bFound && $bRecursive && $arSection['IBLOCK_SECTION_ID'] > 0) {
$ar = CIntranetUtils::GetDepartmentManagerOld(array($arSection['IBLOCK_SECTION_ID']), $skipUserId, $bRecursive);
$arManagers = $arManagers + $ar;
}
}
return $arManagers;
}