本文整理汇总了PHP中CBPHelper::ConvertUserToPrintableForm方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPHelper::ConvertUserToPrintableForm方法的具体用法?PHP CBPHelper::ConvertUserToPrintableForm怎么用?PHP CBPHelper::ConvertUserToPrintableForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPHelper
的用法示例。
在下文中一共展示了CBPHelper::ConvertUserToPrintableForm方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __bwl1_ParseStringParameterTmp
function __bwl1_ParseStringParameterTmp($matches)
{
$result = "";
if ($matches[1] == "user") {
$user = $matches[2];
$l = strlen("user_");
if (substr($user, 0, $l) == "user_") {
$result = htmlspecialcharsbx(CBPHelper::ConvertUserToPrintableForm(intval(substr($user, $l))));
} else {
$result = $GLOBALS["__bwl1_ParseStringParameterTmp_arAllowableUserGroups"][$user];
}
} elseif ($matches[1] == "group") {
$result = $GLOBALS["__bwl1_ParseStringParameterTmp_arAllowableUserGroups"][$matches[2]];
} else {
$result = $matches[0];
}
return $result;
}
示例2: parseStringParameterMatches
public static function parseStringParameterMatches($matches, $documentType = null)
{
$result = "";
$documentType = is_array($documentType) ? array_filter($documentType) : null;
if ($matches[1] == "user") {
$user = $matches[2];
$l = strlen("user_");
if (substr($user, 0, $l) == "user_") {
$result = CBPHelper::ConvertUserToPrintableForm(intval(substr($user, $l)));
} elseif (strpos($user, 'group_') === 0) {
$result = htmlspecialcharsbx(CBPHelper::getExtendedGroupName($user));
} elseif ($documentType) {
$v = implode(",", $documentType);
if (!array_key_exists($v, self::$userGroupsCache)) {
self::$userGroupsCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = self::$userGroupsCache[$v][$user];
} else {
$result = $user;
}
} elseif ($matches[1] == "group") {
if (strpos($matches[2], 'group_') === 0) {
$result = htmlspecialcharsbx(CBPHelper::getExtendedGroupName($matches[2]));
} elseif ($documentType) {
$v = implode(",", $documentType);
if (!array_key_exists($v, self::$userGroupsCache)) {
self::$userGroupsCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = self::$userGroupsCache[$v][$matches[2]];
} else {
$result = $matches[2];
}
} else {
$result = $matches[0];
}
return $result;
}
示例3: GetFieldValuePrintable
public static function GetFieldValuePrintable($fieldName, $fieldType, $result)
{
$newResult = null;
switch ($fieldType) {
case "user":
if (is_array($result)) {
$newResult = array();
foreach ($result as $r) {
$newResult[] = CBPHelper::ConvertUserToPrintableForm($r);
}
} else {
$newResult = CBPHelper::ConvertUserToPrintableForm($result);
}
break;
case "file":
if (is_array($result)) {
$newResult = array();
foreach ($result as $r) {
$r = intval($r);
$dbImg = CFile::GetByID($r);
if ($arImg = $dbImg->Fetch()) {
$newResult[] = "[url=/bitrix/tools/bizproc_show_file.php?f=" . htmlspecialcharsbx($arImg["FILE_NAME"]) . "&i=" . $r . "]" . htmlspecialcharsbx($arImg["ORIGINAL_NAME"]) . "[/url]";
}
}
} else {
$result = intval($result);
$dbImg = CFile::GetByID($result);
if ($arImg = $dbImg->Fetch()) {
$newResult = "[url=/bitrix/tools/bizproc_show_file.php?f=" . htmlspecialcharsbx($arImg["FILE_NAME"]) . "&i=" . $result . "]" . htmlspecialcharsbx($arImg["ORIGINAL_NAME"]) . "[/url]";
}
}
break;
default:
$newResult = $result;
}
return $newResult;
}
示例4: __bwl_ParseStringParameterTmp1
function __bwl_ParseStringParameterTmp1($matches, $documentType)
{
static $varCache = array();
$result = "";
if ($matches[1] == "user") {
$user = $matches[2];
$l = strlen("user_");
if (substr($user, 0, $l) == "user_") {
$result = htmlspecialcharsbx(CBPHelper::ConvertUserToPrintableForm(intval(substr($user, $l))));
} else {
$v = implode(",", $documentType);
if (!array_key_exists($v, $varCache)) {
$varCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = $varCache[$v][$user];
}
} elseif ($matches[1] == "group") {
$v = implode(",", $documentType);
if (!array_key_exists($v, $varCache)) {
$varCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = $varCache[$v][$matches[2]];
} else {
$result = $matches[0];
}
return $result;
}
示例5: getPrintable
/**
* @param int $userID - ID пользователя
* @return string в формате БП - по умолчанию только Фамилия Имя - почта
*/
public static function getPrintable($userID)
{
return CBPHelper::ConvertUserToPrintableForm($userID);
}