public static function GetUserUrl($userId = 0, $pathToUser = "") { if ($pathToUser == '') { if (self::$pathToUser == '') { if (empty(self::$pathesForSite)) { self::$pathesForSite = self::GetPathes(SITE_ID); } self::$pathToUser = self::$pathesForSite['path_to_user']; } $pathToUser = self::$pathToUser; } return CUtil::JSEscape(CComponentEngine::MakePathFromTemplate($pathToUser, array("user_id" => $userId, "USER_ID" => $userId))); }
public static function GetMeetingRoomList($Params = array()) { if (isset(self::$meetingRoomList)) return self::$meetingRoomList; if (!isset($Params['RMiblockId']) && !isset($Params['VMiblockId'])) { if (!isset(self::$settings)) self::$settings = self::GetSettings(); if (!self::$pathesForSite) self::$pathesForSite = self::GetSettings(self::GetSiteId()); $RMiblockId = self::$settings['rm_iblock_id']; $VMiblockId = self::$settings['vr_iblock_id']; $pathToMR = self::$pathesForSite['path_to_rm']; $pathToVR = self::$pathesForSite['path_to_vr']; } else { $RMiblockId = $Params['RMiblockId']; $VMiblockId = $Params['VMiblockId']; $pathToMR = $Params['pathToMR']; $pathToVR = $Params['pathToVR']; } $MRList = Array(); if (IntVal($RMiblockId) > 0 && CIBlock::GetPermission($RMiblockId) >= "R") { $arOrderBy = array("NAME" => "ASC", "ID" => "DESC"); $arFilter = array("IBLOCK_ID" => $RMiblockId, "ACTIVE" => "Y"); $arSelectFields = array("IBLOCK_ID","ID","NAME","DESCRIPTION","UF_FLOOR","UF_PLACE","UF_PHONE"); $res = CIBlockSection::GetList($arOrderBy, $arFilter, false, $arSelectFields ); while ($arMeeting = $res->GetNext()) { $MRList[] = array( 'ID' => $arMeeting['ID'], 'NAME' => $arMeeting['NAME'], 'DESCRIPTION' => $arMeeting['DESCRIPTION'], 'UF_PLACE' => $arMeeting['UF_PLACE'], 'UF_PHONE' => $arMeeting['UF_PHONE'], 'URL' => str_replace(array("#id#", "#ID#"), $arMeeting['ID'], $pathToMR) ); } } if(IntVal($VMiblockId) > 0 && CIBlock::GetPermission($VMiblockId) >= "R") { $arFilter = array("IBLOCK_ID" => $VMiblockId, "ACTIVE" => "Y"); $arSelectFields = array("ID", "NAME", "DESCRIPTION", "IBLOCK_ID"); $res = CIBlockSection::GetList(Array(), $arFilter, false, $arSelectFields); if($arMeeting = $res->GetNext()) { $MRList[] = array( 'ID' => $VMiblockId, 'NAME' => $arMeeting["NAME"], 'DESCRIPTION' => $arMeeting['DESCRIPTION'], 'URL' => str_replace(array("#id#", "#ID#"), $arMeeting['ID'], $pathToVR), ); } } self::$meetingRoomList = $MRList; return $MRList; }