本文整理汇总了PHP中CIntranetUtils::FormatName方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::FormatName方法的具体用法?PHP CIntranetUtils::FormatName怎么用?PHP CIntranetUtils::FormatName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIntranetUtils
的用法示例。
在下文中一共展示了CIntranetUtils::FormatName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
$matches = array();
if (preg_match('/^(.*?)<[a-z0-9.\\-_]+@[a-z0-9.\\-]+> \\[([\\d]+?)\\]/i', $search, $matches)) {
$matches[2] = intval($matches[2]);
if ($matches[2] > 0 && (!is_array($arUsersToFilter) || in_array($matches[2], $arUsersToFilter))) {
$dbRes = CUser::GetByID($matches[2]);
if ($arRes = $dbRes->Fetch()) {
$arUsers = array(array('ID' => $arRes['ID'], 'NAME' => str_replace(array(';', ','), ' ', CIntranetUtils::FormatName($nameTemplate, $arRes, false)) . ' <' . $arRes['EMAIL'] . '>', 'UF_DEPARTMENT' => $arRes['UF_DEPARTMENT'], 'READY' => 'Y'));
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arUsers);
die;
}
} elseif (strlen($matches[1]) > 0) {
$search = $matches[1];
}
}
$arUsers = array();
if (GetFilterQuery("TEST", $search)) {
$arFilter = array("ACTIVE" => "Y", "CONFIRM_CODE" => false, "NAME_SEARCH" => $search);
if ("I" == $EXTERNAL) {
$arFilter["!UF_DEPARTMENT"] = false;
}
$dbRes = CUser::GetList($by = "last_name", $order = "asc", $arFilter, array("SELECT" => array("UF_DEPARTMENT"), "FIELDS" => array("ID", "NAME", "LAST_NAME", "SECOND_NAME", "EMAIL", "LOGIN"), "NAV_PARAMS" => array("nTopCount" => 10)));
while ($arRes = $dbRes->Fetch()) {
$arUsers[] = array("ID" => $arRes["ID"], "NAME" => str_replace(array(';', ','), ' ', CIntranetUtils::FormatName($nameTemplate, $arRes, false)) . ' <' . $arRes['EMAIL'] . '>', "UF_DEPARTMENT" => $arRes["UF_DEPARTMENT"]);
}
}
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arUsers);
die;
}
示例2: elseif
} elseif (IsModuleInstalled('extranet')) {
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
die;
}
$matches = array();
if (preg_match('/^(.*?)<[a-z0-9.\\-_]+@[a-z0-9.\\-]+> \\[([\\d]+?)\\]/i', $search, $matches)) {
$matches[2] = intval($matches[2]);
if ($matches[2] > 0 && (!is_array($arUsersToFilter) || in_array($matches[2], $arUsersToFilter))) {
$dbRes = CUser::GetList($by = 'id', $order = 'asc', array('ID' => $matches[2]), array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'SECOND_NAME', 'LAST_NAME', 'EMAIL'), 'SELECT' => array('UF_DEPARTMENT')));
if ($arRes = $dbRes->Fetch()) {
$arUsers = array(array('ID' => $arRes['ID'], 'NAME' => str_replace(array(';', ','), ' ', CIntranetUtils::FormatName(CSite::GetNameFormat(false), $arRes, false)) . ' <' . $arRes['EMAIL'] . '>', 'UF_DEPARTMENT' => $arRes['UF_DEPARTMENT'], 'READY' => 'Y'));
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arUsers);
die;
}
} elseif (strlen($matches[1]) > 0) {
$search = $matches[1];
}
}
$arFilter = array('ACTIVE' => 'Y', 'NAME_SEARCH' => $search);
if ('I' == $EXTERNAL) {
$arFilter['!UF_DEPARTMENT'] = false;
}
$dbRes = CUser::GetList($by = 'last_name', $order = 'asc', $arFilter, array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'SECOND_NAME', 'LAST_NAME', 'EMAIL'), 'SELECT' => array('UF_DEPARTMENT'), 'NAV_PARAMS' => array('nTopCount' => 10)));
while ($arRes = $dbRes->GetNext()) {
$arUsers[] = array('ID' => $arRes['ID'], 'NAME' => str_replace(array(';', ','), ' ', CIntranetUtils::FormatName(CSite::GetNameFormat(false), $arRes, false)) . ' <' . $arRes['EMAIL'] . '>', 'UF_DEPARTMENT' => $arRes['UF_DEPARTMENT']);
}
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arUsers);
die;
}