本文整理汇总了PHP中GetCountryByID函数的典型用法代码示例。如果您正苦于以下问题:PHP GetCountryByID函数的具体用法?PHP GetCountryByID怎么用?PHP GetCountryByID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetCountryByID函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowError
//Can view transcript?
if ($arStudent["PUBLIC_PROFILE"] == "N" && !($USER->GetID() == $arStudent["USER_ID"] || $USER->IsAdmin())) {
ShowError(GetMessage("LEARNING_TRANSCRIPT_PERMISSION_DENIED"));
return;
}
//User exists?
$res = CUser::GetByID($arStudent["USER_ID"]);
if (!($arUser = $res->GetNext())) {
ShowError(GetMessage("LEARNING_TRANSCRIPT_ERROR"));
return;
}
//Images
$arUser["PERSONAL_PHOTO_ARRAY"] = CFile::GetFileArray($arUser["PERSONAL_PHOTO"]);
$arUser["WORK_LOGO_ARRAY"] = CFile::GetFileArray($arUser["WORK_LOGO"]);
//Country
$arUser["PERSONAL_COUNTRY_NAME"] = GetCountryByID($arUser["PERSONAL_COUNTRY"]);
$arResult = array("STUDENT" => $arStudent, "USER" => $arUser, "CERTIFICATES" => array());
$res = CCertification::GetList(array("SORT" => "ASC", "DATE_CREATE" => "ASC"), array("STUDENT_ID" => $arStudent["USER_ID"], "ACTIVE" => "Y", "PUBLIC" => "Y", "CHECK_PERMISSIONS" => "N"));
while ($arCertification = $res->GetNext()) {
$arCertification["PREVIEW_PICTURE_ARRAY"] = CFile::GetFileArray($arCertification["PREVIEW_PICTURE"]);
$arResult["CERTIFICATES"][] = $arCertification;
}
unset($res);
unset($arStudent);
unset($arUser);
//Set Title
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
if ($arParams["SET_TITLE"] == "Y") {
if (strlen($arResult["USER"]["LAST_NAME"]) > 0 || strlen($arResult["USER"]["NAME"]) > 0) {
$APPLICATION->SetTitle(CUser::FormatName($arParams["NAME_TEMPLATE"], $arResult["USER"]));
} else {
示例2: StrToLower
case 'WORK_WWW':
if (StrLen($val) > 0) {
$valLink = $val;
if (StrToLower(SubStr($val, 0, StrLen("http://"))) != "http://") {
$valLink = "http://" . $val;
}
$val = '<noindex><a href="' . $valLink . '" target="_blank" rel="nofollow">' . $val . '</a></noindex>';
}
break;
case 'PERSONAL_COUNTRY':
case 'WORK_COUNTRY':
if (StrLen($val) > 0) {
if (in_array($userFieldName, $arParams["SONET_USER_FIELDS_SEARCHABLE"])) {
$strSearch = $arParams["PATH_TO_SEARCH_INNER"] . (StrPos($arParams["PATH_TO_SEARCH_INNER"], "?") !== false ? "&" : "?") . "flt_" . StrToLower($userFieldName) . "=" . UrlEncode($val);
}
$val = GetCountryByID($val);
}
break;
case 'PERSONAL_ICQ':
if (StrLen($val) > 0) {
$val = $val . '<!-- <img src="http://web.icq.com/whitepages/online?icq=' . $val . '&img=5" alt="" />-->';
}
break;
case 'PERSONAL_PHONE':
case 'PERSONAL_FAX':
case 'PERSONAL_MOBILE':
case 'WORK_PHONE':
case 'WORK_FAX':
if (StrLen($val) > 0) {
$valEncoded = preg_replace('/[^\\d\\+]+/', '', $val);
$val = '<a href="callto:' . $valEncoded . '">' . $val . '</a>';
示例3: FormatDate
<?php
if ($CurentUser["PERSONAL_BIRTHDAY"]) {
?>
<?php
echo FormatDate(array("d" => 'j F'), MakeTimeStamp($CurentUser["PERSONAL_BIRTHDAY"]), time());
?>
<?php
}
?>
</div>
<div class="profile-city">
<?php
if ($CurentUser["PERSONAL_CITY"]) {
?>
Живет в <?php
echo $CurentUser["PERSONAL_CITY"] . ", " . GetCountryByID($CurentUser["PERSONAL_COUNTRY"], "ru");
?>
<?php
}
?>
</div>
</div>
<?php
if ($CurentUser["ID"] == $USER->GetID()) {
?>
<div class="new-friends-number" id="new-friends-number" <?php
if (!$CurentUser["UF_FRIENDS_SUB_IN"] && !$CurentUser["UF_FRIENDS_SUB"]) {
echo ' style="display: none;"';
}
?>
>
示例4: GetMessage
if ($strBValueTmp != "http:/" && $strBValueTmp != "https:" && $strBValueTmp != "ftp://") {
$arResult["USER"]["WORK_WWW_FORMATED"] = "http://" . $arResult["USER"]["WORK_WWW_FORMATED"];
}
$arResult["USER"]["WORK_WWW"] = "<noindex><a rel=\"nofollow\" href=\"" . $arResult["USER"]["WORK_WWW_FORMATED"] . "\" target=\"_blank\">" . $arResult["USER"]["WORK_WWW_FORMATED"] . "</a></noindex>";
}
if ($arResult["USER"]["PERSONAL_GENDER"] == "M") {
$arResult["USER"]["PERSONAL_GENDER"] = GetMessage("F_SEX_MALE");
} elseif ($arResult["USER"]["PERSONAL_GENDER"] == "F") {
$arResult["USER"]["PERSONAL_GENDER"] = GetMessage("F_SEX_FEMALE");
}
$arResult["USER"]["PERSONAL_LOCATION"] = GetCountryByID($arResult["USER"]["PERSONAL_COUNTRY"]);
if (!empty($arResult["USER"]["PERSONAL_LOCATION"]) && !empty($arResult["USER"]["PERSONAL_CITY"])) {
$arResult["USER"]["PERSONAL_LOCATION"] .= ", ";
}
$arResult["USER"]["PERSONAL_LOCATION"] .= $arResult["USER"]["PERSONAL_CITY"];
$arResult["USER"]["WORK_LOCATION"] = GetCountryByID($arResult["USER"]["WORK_COUNTRY"]);
if (strlen($arResult["USER"]["WORK_LOCATION"]) > 0 && strlen($arResult["USER"]["WORK_CITY"]) > 0) {
$arResult["USER"]["WORK_LOCATION"] .= ", ";
}
$arResult["USER"]["WORK_LOCATION"] .= $arResult["USER"]["WORK_CITY"];
$arResult["FORUM_USER"]["INTERESTS"] = $parser->convert($arResult["FORUM_USER"]["INTERESTS"], array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "VIDEO" => "Y", "LIST" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "SMILES" => "N", "NL2BR" => "Y", "TABLE" => "N", "ALIGN" => "N"));
$arResult["FORUM_USER"]["AVATAR"] = "";
if (!empty($arResult["FORUM_USER"]["~AVATAR"])) {
$arResult["FORUM_USER"]["AVATAR_FILE"] = CFile::GetFileArray($arResult["FORUM_USER"]["~AVATAR"]);
if ($arResult["FORUM_USER"]["AVATAR_FILE"] !== false) {
$arResult["FORUM_USER"]["AVATAR"] = CFile::ShowImage($arResult["FORUM_USER"]["AVATAR_FILE"], COption::GetOptionString("forum", "avatar_max_width", 90), COption::GetOptionString("forum", "avatar_max_height", 90), "border=0", "", true);
}
}
$arResult["USER"]["PERSONAL_PHOTO"] = "";
if (!empty($arResult["USER"]["~PERSONAL_PHOTO"])) {
$arResult["USER"]["PERSONAL_PHOTO_FILE"] = CFile::GetFileArray($arResult["USER"]["~PERSONAL_PHOTO"]);
示例5: ReceiveMessage
public function ReceiveMessage($senderJId, array $arMessage, CXMPPClient $senderClient)
{
if (!$senderClient->IsAuthenticated()) {
return false;
}
if (strlen($senderJId) <= 0) {
return false;
}
if (!array_key_exists("iq", $arMessage) || !array_key_exists("vcard", $arMessage["iq"]) || $arMessage["iq"]["vcard"]["."]["xmlns"] != "vcard-temp") {
return false;
}
$type = "";
if (array_key_exists("type", $arMessage["iq"]["."])) {
$type = $arMessage["iq"]["."]["type"];
}
if ($type == "get") {
$to = $arMessage["iq"]["."]["to"];
$arUser = CXMPPUtility::GetUserByJId($to);
if ($arUser) {
$photoType = "";
$photo = "";
if (intval($arUser["PERSONAL_PHOTO"]) > 0) {
$imageFile = CFile::GetFileArray($arUser["PERSONAL_PHOTO"]);
if ($imageFile !== false) {
$arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 300, "height" => 300), BX_RESIZE_IMAGE_PROPORTIONAL, false);
if (is_array($arFileTmp)) {
$arFileTmp = CFile::MakeFileArray($arFileTmp["src"]);
}
$photoType = $imageFile["CONTENT_TYPE"];
if (File_Exists($arFileTmp["tmp_name"])) {
$photo = File_Get_Contents($arFileTmp["tmp_name"]);
$photo = Base64_Encode($photo);
}
}
}
if (empty($photo)) {
$photoType = "image/gif";
if (File_Exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/images/socialnetwork/nopic_user_150.gif")) {
$photo = File_Get_Contents($_SERVER["DOCUMENT_ROOT"] . "/bitrix/images/socialnetwork/nopic_user_150.gif");
$photo = Base64_Encode($photo);
}
}
$arResult = array("iq" => array("." => array("type" => "result", "from" => $to, "to" => $senderJId, "id" => $arMessage['iq']['.']['id']), "vCard" => array("." => array("xmlns" => "vcard-temp", "prodid" => '-//HandGen//NONSGML vGen v1.0//EN', "version" => '2.0'), "FN" => array("#" => CUser::FormatName($this->nameTemplate, $arUser)), "N" => array("FAMILY" => array("#" => $arUser["LAST_NAME"]), "GIVEN" => array("#" => $arUser["NAME"]), "MIDDLE" => array("#" => $arUser["SECOND_NAME"])), "NICKNAME" => array("#" => CUser::FormatName($this->nameTemplate, $arUser)), "BDAY" => array("#" => ConvertDateTime($arUser["PERSONAL_BIRTHDAY"], "YYYY-MM-DD", SITE_ID)), "ORG" => array("ORGNAME" => array("#" => $arUser["WORK_COMPANY"]), "ORGUNIT" => array("#" => $arUser["WORK_DEPARTMENT"])), "TITLE" => array("#" => $arUser["WORK_POSITION"]), "EMAIL" => array("INTERNET" => array("#" => ""), "PREF" => array("#" => ""), "USERID" => array("#" => $arUser["EMAIL"])), "JABBERID" => array("#" => $to), "PHOTO" => array("TYPE" => array("#" => $photoType), "BINVAL" => array("#" => $photo)))));
if (strlen($arUser["WORK_FAX"]) > 0) {
$arResult["iq"]["vCard"]["TEL"][] = array("WORK" => array("#" => ""), "FAX" => array("#" => ""), "NUMBER" => array("#" => $arUser["WORK_FAX"]));
}
if (strlen($arUser["PERSONAL_MOBILE"]) > 0) {
$arResult["iq"]["vCard"]["TEL"][] = array("HOME" => array("#" => ""), "CELL" => array("#" => ""), "NUMBER" => array("#" => $arUser["PERSONAL_MOBILE"]));
}
if (strlen($arUser["WORK_PHONE"]) > 0) {
$arResult["iq"]["vCard"]["TEL"][] = array("WORK" => array("#" => ""), "VOICE" => array("#" => ""), "NUMBER" => array("#" => $arUser["WORK_PHONE"]));
}
if (strlen($arUser["PERSONAL_PHONE"]) > 0) {
$arResult["iq"]["vCard"]["TEL"][] = array("HOME" => array("#" => ""), "VOICE" => array("#" => ""), "NUMBER" => array("#" => $arUser["PERSONAL_PHONE"]));
}
if (strlen($arUser["PERSONAL_FAX"]) > 0) {
$arResult["iq"]["vCard"]["TEL"][] = array("HOME" => array("#" => ""), "FAX" => array("#" => ""), "NUMBER" => array("#" => $arUser["PERSONAL_FAX"]));
}
if (strlen($arUser["WORK_STREET"]) > 0 || strlen($arUser["WORK_CITY"]) > 0 || strlen($arUser["WORK_COUNTRY"]) > 0) {
$arResult["iq"]["vCard"]["ADR"][] = array("WORK" => array("#" => ""), "EXTADD" => array("#" => ""), "STREET" => array("#" => $arUser["WORK_STREET"]), "LOCALITY" => array("#" => $arUser["WORK_CITY"]), "REGION" => array("#" => $arUser["WORK_STATE"]), "PCODE" => array("#" => $arUser["WORK_ZIP"]), "CTRY" => array("#" => GetCountryByID($arUser["WORK_COUNTRY"])));
}
if (strlen($arUser["PERSONAL_STREET"]) > 0 || strlen($arUser["PERSONAL_CITY"]) > 0 || strlen($arUser["PERSONAL_COUNTRY"]) > 0) {
$arResult["iq"]["vCard"]["ADR"][] = array("HOME" => array("#" => ""), "EXTADD" => array("#" => ""), "STREET" => array("#" => $arUser["PERSONAL_STREET"]), "LOCALITY" => array("#" => $arUser["PERSONAL_CITY"]), "REGION" => array("#" => $arUser["PERSONAL_STATE"]), "PCODE" => array("#" => $arUser["PERSONAL_ZIP"]), "CTRY" => array("#" => GetCountryByID($arUser["PERSONAL_COUNTRY"])));
}
if ($senderJId != $to) {
$arResult["iq"]["."]["from"] = $to;
}
//print_r($arResult);echo "\n*****************************************\n";
} else {
$arResult = array("iq" => array("." => array("type" => "error", "to" => $senderJId, "id" => $arMessage['iq']['.']['id']), "vCard" => array("." => array("xmlns" => "vcard-temp")), "error" => array("." => array("type" => "cancel"), "item-not-found" => array("." => array("xmlns" => "urn:ietf:params:xml:ns:xmpp-stanzas")))));
if ($senderJId != $to) {
$arResult["iq"]["."]["from"] = $to;
}
}
} elseif ($type == "set") {
$arResult = array("iq" => array("." => array("type" => "result", "from" => $senderClient->GetClientDomain(), "id" => $arMessage['iq']['.']['id'])));
}
return $arResult;
}
示例6: GetVCardContent
private function GetVCardContent(array $contact)
{
$arVCardContact = array("TYPE" => "VCARD", "VERSION" => "3.0", "N" => $contact["LAST_NAME"] . ";" . $contact["NAME"] . ";" . $contact["SECOND_NAME"] . ";;", "FN" => $contact["NAME"] . ($contact["SECOND_NAME"] ? " " . $contact["SECOND_NAME"] : "") . " " . $contact["LAST_NAME"], "EMAIL" => array("VALUE" => $contact["EMAIL"], "PARAMETERS" => array("TYPE" => "INTERNET")), "REV" => date("Ymd\\THis\\Z", MakeTimeStamp($contact["TIMESTAMP_X"])), "UID" => $contact["ID"]);
if (intval($contact["PERSONAL_BIRTHDAY"]) > 0) {
$arVCardContact["BDAY"] = date("Y-m-d", MakeTimeStamp($contact["PERSONAL_BIRTHDAY"]));
}
if (strlen($contact["WORK_PHONE"]) > 0) {
$arVCardContact["TEL"][] = array("VALUE" => $contact["WORK_PHONE"], "PARAMETERS" => array("TYPE" => "WORK"));
}
if (strlen($contact["PERSONAL_MOBILE"]) > 0) {
$arVCardContact["TEL"][] = array("VALUE" => $contact["PERSONAL_MOBILE"], "PARAMETERS" => array("TYPE" => "CELL"));
}
if (strlen($contact["PERSONAL_PHONE"]) > 0) {
$arVCardContact["TEL"][] = array("VALUE" => $contact["PERSONAL_PHONE"], "PARAMETERS" => array("TYPE" => "HOME"));
}
if (strlen($contact["WORK_COMPANY"]) > 0) {
$arVCardContact["ORG"] = $contact["WORK_COMPANY"];
}
if (strlen($contact["WORK_POSITION"]) > 0) {
$arVCardContact["TITLE"] = $contact["WORK_POSITION"];
}
if (strlen($contact["WORK_WWW"]) > 0) {
$arVCardContact["URL"][] = array("VALUE" => $contact["WORK_WWW"], "PARAMETERS" => array("TYPE" => "WORK"));
}
if (strlen($contact["PERSONAL_WWW"]) > 0) {
$arVCardContact["URL"][] = array("VALUE" => $contact["PERSONAL_WWW"], "PARAMETERS" => array("TYPE" => "HOME"));
}
if (strlen($contact["PERSONAL_STREET"]) > 0) {
$arVCardContact["ADR"][] = array("VALUE" => ";;" . $contact["PERSONAL_STREET"] . ";" . $contact["PERSONAL_CITY"] . ";" . $contact["PERSONAL_STATE"] . ";" . $contact["PERSONAL_ZIP"] . ";" . GetCountryByID($contact["PERSONAL_COUNTRY"]) . "", "PARAMETERS" => array("TYPE" => "HOME"));
}
if (strlen($contact["WORK_STREET"]) > 0) {
$arVCardContact["ADR"][] = array("VALUE" => ";;" . $contact["WORK_STREET"] . ";" . $contact["WORK_CITY"] . ";" . $contact["WORK_STATE"] . ";" . $contact["WORK_ZIP"] . ";" . GetCountryByID($contact["WORK_COUNTRY"]) . "", "PARAMETERS" => array("TYPE" => "WORK"));
}
if (intval($contact["PERSONAL_PHOTO"]) > 0) {
$arTempFile = CFile::ResizeImageGet($contact["PERSONAL_PHOTO"], array("width" => \Bitrix\Main\Config\Option::get("dav", "vcard_image_width", 400), "height" => \Bitrix\Main\Config\Option::get("dav", "vcard_image_width", 400)), BX_RESIZE_IMAGE_PROPORTIONAL, false, false, false, \Bitrix\Main\Config\Option::get("dav", "vcard_image_quality", 60));
if ($arTempFile) {
$cnt = file_get_contents($_SERVER["DOCUMENT_ROOT"] . $arTempFile['src']);
if (!empty($cnt)) {
$arImageTypes = array(IMAGETYPE_JPEG => 'JPEG', IMAGETYPE_GIF => 'GIF', IMAGETYPE_PNG => 'PNG');
$imageType = "JPEG";
if ($imageInfo = CFile::GetImageSize($_SERVER["DOCUMENT_ROOT"] . $arTempFile['src']) && isset($arImageTypes[$imageInfo[2]])) {
$imageType = $arImageTypes[$imageInfo[2]];
}
$arVCardContact["PHOTO"] = array("VALUE" => base64_encode($cnt), "PARAMETERS" => array("ENCODING" => "BASE64", "TYPE" => $imageType));
}
}
}
$cal = new CDavICalendarComponent($arVCardContact);
return $cal->Render();
}
示例7: FormatFieldsArray
private function FormatFieldsArray($arFields)
{
$arFieldsNew = array();
$arMap = array("NAME" => "GivenName", "LAST_NAME" => "Surname", "SECOND_NAME" => "MiddleName", "EMAIL" => "EmailAddresses", "WORK_POSITION" => "JobTitle", "PERSONAL_ZIP" => "PhysicalAddresses_Home_PostalCode", "PERSONAL_STATE" => "PhysicalAddresses_Home_State", "PERSONAL_CITY" => "PhysicalAddresses_Home_City", "PERSONAL_STREET" => "PhysicalAddresses_Home_Street", "WORK_ZIP" => "PhysicalAddresses_Business_PostalCode", "WORK_STATE" => "PhysicalAddresses_Business_State", "WORK_CITY" => "PhysicalAddresses_Business_City", "WORK_STREET" => "PhysicalAddresses_Business_Street", "PERSONAL_PHONE" => "PhoneNumbers_HomePhone", "PERSONAL_FAX" => "PhoneNumbers_HomePhone2", "PERSONAL_MOBILE" => "PhoneNumbers_MobilePhone", "PERSONAL_PAGER" => "PhoneNumbers_Pager", "WORK_PHONE" => "PhoneNumbers_BusinessPhone", "WORK_FAX" => "PhoneNumbers_BusinessPhone2", "WORK_PAGER" => "PhoneNumbers_OtherTelephone", "WORK_COMPANY" => "CompanyName", "WORK_WWW" => "BusinessHomePage", "PERSONAL_ICQ" => "ImAddresses", "WORK_DEPARTMENT" => "Department");
foreach ($arFields as $key => $value) {
if (array_key_exists($key, $arMap)) {
$arFieldsNew[$arMap[$key]] = $this->Decode($value);
} else {
switch ($key) {
case "PERSONAL_COUNTRY":
$arFieldsNew["PhysicalAddresses_Home_CountryOrRegion"] = $this->Decode(GetCountryByID($value));
break;
case "WORK_COUNTRY":
$arFieldsNew["PhysicalAddresses_Business_CountryOrRegion"] = $this->Decode(GetCountryByID($value));
break;
}
}
}
return $arFieldsNew;
}
示例8: __IncludeLang
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
__IncludeLang(dirname(__FILE__) . "/lang/" . LANGUAGE_ID . "/result_modifier.php");
$arResult["USER_IDEA_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_IDEAS"], array("user_id" => $arResult["arUser"]["ID"]));
//Prepare data
if ($arResult["User"]["PERSONAL_COUNTRY"] > 0) {
$arResult["User"]["PERSONAL_COUNTRY"] = GetCountryByID($arResult["User"]["PERSONAL_COUNTRY"]);
} else {
$arResult["User"]["PERSONAL_COUNTRY"] = "";
}
if ($arResult["User"]["WORK_COUNTRY"] > 0) {
$arResult["User"]["WORK_COUNTRY"] = GetCountryByID($arResult["User"]["WORK_COUNTRY"]);
} else {
$arResult["User"]["WORK_COUNTRY"] = "";
}
if (strlen($arResult["User"]["PERSONAL_GENDER"]) > 0) {
$arResult["User"]["PERSONAL_GENDER"] = $arResult["arSex"][$arResult["User"]["PERSONAL_GENDER"]];
}
if (strlen($arResult["User"]["LAST_ACTIVITY_DATE"]) > 0 && strlen($arParams["DATE_TIME_FORMAT"]) > 0) {
$arResult["User"]["LAST_ACTIVITY_DATE"] = date($arParams["DATE_TIME_FORMAT"], strtotime($arResult["User"]["LAST_ACTIVITY_DATE"]));
}
//prepate titles
$arResult["DISPLAY_FIELDS"] = array();
$arResult["DISPLAY_FIELDS"]['FIELDS_MAIN_DATA'] = array("LAST_ACTIVITY_DATE" => GetMessage("IDEA_USER_INFO_LAST_ACTIVITY_DATE_TITLE"), "PERSONAL_CITY" => GetMessage("IDEA_USER_INFO_PERSONAL_CITY_TITLE"), "WORK_COMPANY" => GetMessage("IDEA_USER_INFO_WORK_COMPANY_TITLE"));
$arResult["DISPLAY_FIELDS"]['FIELDS_CONTACT_DATA'] = array("PERSONAL_PHONE" => GetMessage("IDEA_USER_INFO_PERSONAL_PHONE_TITLE"), "PERSONAL_CITY" => GetMessage("IDEA_USER_INFO_PERSONAL_CITY_TITLE"), "PERSONAL_STATE" => GetMessage("IDEA_USER_INFO_PERSONAL_STATE_TITLE"), "PERSONAL_COUNTRY" => GetMessage("IDEA_USER_INFO_PERSONAL_COUNTRY_TITLE"), "WORK_COMPANY" => GetMessage("IDEA_USER_INFO_WORK_COMPANY_TITLE"), "WORK_POSITION" => GetMessage("IDEA_USER_INFO_WORK_POSITION_TITLE"), "WORK_WWW" => GetMessage("IDEA_USER_INFO_WORK_WWW_TITLE"), "WORK_PHONE" => GetMessage("IDEA_USER_INFO_WORK_PHONE_TITLE"), "WORK_CITY" => GetMessage("IDEA_USER_INFO_WORK_CITY_TITLE"), "WORK_STATE" => GetMessage("IDEA_USER_INFO_WORK_STATE_TITLE"), "WORK_COUNTRY" => GetMessage("IDEA_USER_INFO_WORK_COUNTRY_TITLE"), "WORK_PROFILE" => GetMessage("IDEA_USER_INFO_WORK_PROFILE_TITLE"));
$arResult["DISPLAY_FIELDS"]['FIELDS_PERSONAL_DATA'] = array("DATE_REGISTER" => GetMessage("IDEA_USER_INFO_DATE_REGISTER_TITLE"), "PERSONAL_GENDER" => GetMessage("IDEA_USER_INFO_PERSONAL_GENDER_TITLE"), "PERSONAL_BIRTHDATE" => GetMessage("IDEA_USER_INFO_PERSONAL_BIRTHDATE_TITLE"), "SECOND_NAME" => GetMessage("IDEA_USER_INFO_SECOND_NAME_TITLE"));
示例9: unset
unset($arListParams["NAV_PARAMS"]);
}
if (strlen($arResult["search_name"]) > 0) {
$arFilter["NAME"] = $arResult["search_name"];
}
CpageOption::SetOptionString("main", "nav_page_in_session", "N");
$arSelect = array('ID', 'TIMESTAMP_X', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL', 'LID', 'DATE_REGISTER', 'PERSONAL_PROFESSION', 'PERSONAL_WWW', 'PERSONAL_ICQ', 'PERSONAL_GENDER', 'PERSONAL_BIRTHDATE', 'PERSONAL_PHOTO', 'PERSONAL_PHONE', 'PERSONAL_FAX', 'PERSONAL_MOBILE', 'PERSONAL_PAGER', 'PERSONAL_STREET', 'PERSONAL_MAILBOX', 'PERSONAL_CITY', 'PERSONAL_STATE', 'PERSONAL_ZIP', 'PERSONAL_COUNTRY', 'PERSONAL_NOTES', 'WORK_COMPANY', 'WORK_DEPARTMENT', 'WORK_POSITION', 'WORK_WWW', 'WORK_PHONE', 'WORK_FAX', 'WORK_PAGER', 'WORK_STREET', 'WORK_MAILBOX', 'WORK_CITY', 'WORK_STATE', 'WORK_ZIP', 'WORK_COUNTRY', 'WORK_PROFILE', 'WORK_LOGO', 'WORK_NOTES', 'PERSONAL_BIRTHDAY', 'LAST_ACTIVITY_DATE', 'IS_ONLINE');
$dbUsers = CUser::GetList($sort_by = 'last_name', $sort_order = 'asc', $arFilter, $arListParams);
$arResult["NAV_STRING"] = $dbUsers->GetPageNavString("", $arParams["NAV_TEMPLATE"]);
$arUsers = array();
while ($arUser = $dbUsers->Fetch()) {
foreach ($arUser as $k => $value) {
if (!in_array($k, $arSelect) && substr($k, 0, 3) != 'UF_') {
unset($arUser[$k]);
} elseif ($k == "PERSONAL_COUNTRY" || $k == "WORK_COUNTRY") {
$arUser[$k] = GetCountryByID($value);
}
}
$arUser['URL'] = str_replace('#ID#', $arUser['ID'], $arParams['PATH_TO_USER']);
$arUser['CHAT_URL'] = str_replace('#ID#', $arUser['ID'], $arParams['PATH_TO_CHAT']);
if ($arUser['PERSONAL_PHOTO'] > 0) {
$arUser['PERSONAL_PHOTO_B'] = CFile::ResizeImageGet($arUser['PERSONAL_PHOTO'], array("width" => 80, "height" => 80));
$arUser['PERSONAL_PHOTO_S'] = CFile::ResizeImageGet($arUser['PERSONAL_PHOTO'], array("width" => 40, "height" => 40));
}
$arUser["IS_ONLINE"] = $arUser["IS_ONLINE"] == "Y";
if ($componentPage == "user") {
if (CModule::IncludeModule('intranet')) {
$arResult['IS_HONOURED'] = CIntranetUtils::IsUserHonoured($arUser["ID"]);
//$arResult['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser["ID"], $arParams['CALENDAR_USER_IBLOCK_ID']);
//departments and managers
$obCache = new CPHPCache();
示例10: executeComponent
//.........这里部分代码省略.........
if ($bDisable) {
$dbUsers = new CDBResult();
$dbUsers->initFromArray(array());
} else {
$arListParams = array('SELECT' => array('UF_*'), 'ONLINE_INTERVAL' => static::LAST_ACTIVITY);
if (!$this->bExcel && $this->arParams['USERS_PER_PAGE'] > 0) {
$arListParams['NAV_PARAMS'] = array('nPageSize' => $this->arParams['USERS_PER_PAGE'], 'bShowAll' => false);
}
$dbUsers = $obUser->GetList($sortBy = 'last_name', $sortDir = 'asc', $this->arFilter, $arListParams);
}
$strUserIDs = '';
while ($arUser = $dbUsers->Fetch()) {
$this->arResult['USERS'][$arUser['ID']] = $arUser;
$strUserIDs .= ($strUserIDs === '' ? '' : '|') . $arUser['ID'];
}
$structure = CIntranetUtils::getStructure();
$this->arResult['DEPARTMENTS'] = $structure['DATA'];
$this->setDepWhereUserIsHead();
$arAdmins = array();
/** @noinspection PhpUndefinedVariableInspection */
$rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array(static::ADMIN_GROUP_ID)), array("SELECT" => array("ID")));
while ($ar = $rsUsers->Fetch()) {
$arAdmins[$ar["ID"]] = $ar["ID"];
}
$extranetUsers = array();
if (CModule::IncludeModule('extranet') && ($extranetGroupID = CExtranet::GetExtranetUserGroupID())) {
$rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array($extranetGroupID)), array("SELECT" => array("ID")));
while ($ar = $rsUsers->Fetch()) {
$extranetUsers[$ar["ID"]] = $ar["ID"];
}
}
$displayPhoto = $this->displayPersonalPhoto();
foreach ($this->arResult['USERS'] as $key => &$arUser) {
// cache optimization
foreach ($arUser as $k => $value) {
if (is_array($value) && count($value) <= 0 || !is_array($value) && strlen($value) <= 0 || !in_array($k, $arSelect) && substr($k, 0, 3) != 'UF_') {
unset($arUser[$k]);
} elseif ($k == "PERSONAL_COUNTRY" || $k == "WORK_COUNTRY") {
$arUser[$k] = GetCountryByID($value);
}
}
$arUser['IS_ONLINE'] = $arUser['IS_ONLINE'] == 'Y' ? true : false;
if ($this->arParams['bCache']) {
$this->getCacheManager()->registerTag('intranet_user_' . $arUser['ID']);
}
$arUser['DETAIL_URL'] = str_replace(array('#ID#', '#USER_ID#'), $arUser['ID'], $this->arParams['DETAIL_URL']);
$arUser['ADMIN'] = isset($arAdmins[$arUser['ID']]);
//is user admin/extranet
$arUser['ACTIVITY_STATUS'] = 'active';
$arUser['EXTRANET'] = false;
if (isset($extranetUsers[$arUser['ID']]) && empty($arUser['UF_DEPARTMENT'][0])) {
$arUser["ACTIVITY_STATUS"] = 'extranet';
$arUser['EXTRANET'] = true;
}
if ($arUser["ACTIVE"] == "N") {
$arUser["ACTIVITY_STATUS"] = 'fired';
}
if (!empty($arUser["CONFIRM_CODE"])) {
$arUser["ACTIVITY_STATUS"] = 'inactive';
}
$arUser['SHOW_USER'] = $this->arParams["SHOW_USER"];
$arUser['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arUser['ID']);
$arDep = array();
foreach ((array) $arUser['UF_DEPARTMENT'] as $sect) {
$arDep[$sect] = $this->arResult['DEPARTMENTS'][$sect]['NAME'];
}
$arUser['UF_DEPARTMENT'] = $arDep;
if (!$this->bExcel && $displayPhoto) {
$this->resizePersonalPhoto($arUser);
}
if (count($arUser['UF_DEPARTMENT']) <= 0 && !$arUser['EXTRANET']) {
unset($this->arResult['USERS'][$key]);
}
}
unset($arUser, $key);
$this->arResult["USERS_NAV"] = $bNav ? $dbUsers->GetPageNavStringEx($navComponentObject = null, $this->arParams["NAV_TITLE"]) : '';
if ($this->arParams['bCache']) {
$this->getCacheManager()->endTagCache();
$this->obCache->endDataCache(array('USERS' => $this->arResult['USERS'], 'STR_USER_ID' => $strUserIDs, 'DEPARTMENTS' => $this->arResult['DEPARTMENTS'], 'DEPARTMENT_HEAD' => $this->arResult['DEPARTMENT_HEAD'], 'USERS_NAV' => $this->arResult['USERS_NAV']));
}
}
$this->initSonetUserPerms(array_keys($this->arResult['USERS']));
$this->workWithNonCacheAttr($bFromCache, $strUserIDs);
if (!$this->bExcel) {
$this->arResult['bAdmin'] = $this->getUser()->canDoOperation('edit_all_users') || $this->getUser()->canDoOperation('edit_subordinate_users');
$this->IncludeComponentTemplate();
} else {
$this->getApplication()->restartBuffer();
// hack. any '.default' customized template should contain 'excel' page
$this->setTemplateName('.default');
Header("Content-Type: application/force-download");
Header("Content-Type: application/octet-stream");
Header("Content-Type: application/download");
Header("Content-Disposition: attachment;filename=users.xls");
Header("Content-Transfer-Encoding: binary");
$this->IncludeComponentTemplate('excel');
die;
}
return;
}