本文整理汇总了PHP中htmlspecialcharsex函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlspecialcharsex函数的具体用法?PHP htmlspecialcharsex怎么用?PHP htmlspecialcharsex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了htmlspecialcharsex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SelectBox
function SelectBox($sFieldName, $sValue, $sDefaultValue = "", $JavaChangeFunc = "", $sAdditionalParams = "")
{
if (empty(self::$arExtraCache)) {
$rsExtras = CExtra::GetList(array("NAME" => "ASC"));
while ($arExtra = $rsExtras->Fetch()) {
$arExtra['ID'] = intval($arExtra['ID']);
self::$arExtraCache[$arExtra['ID']] = $arExtra;
if (defined('CATALOG_GLOBAL_VARS') && 'Y' == CATALOG_GLOBAL_VARS) {
global $MAIN_EXTRA_LIST_CACHE;
$MAIN_EXTRA_LIST_CACHE = self::$arExtraCache;
}
}
}
$s = '<select name="' . $sFieldName . '"';
if (!empty($JavaChangeFunc)) {
$s .= ' onchange="' . $JavaChangeFunc . '"';
}
if (!empty($sAdditionalParams)) {
$s .= ' ' . $sAdditionalParams . ' ';
}
$s .= '>';
$sValue = intval($sValue);
$boolFound = isset(self::$arExtraCache[$sValue]);
if (!empty($sDefaultValue)) {
$s .= '<option value="0"' . ($boolFound ? '' : ' selected') . '>' . htmlspecialcharsex($sDefaultValue) . '</option>';
}
foreach (self::$arExtraCache as &$arExtra) {
$s .= '<option value="' . $arExtra['ID'] . '"' . ($arExtra['ID'] == $sValue ? ' selected' : '') . '>' . htmlspecialcharsex($arExtra['NAME']) . ' (' . htmlspecialcharsex($arExtra['PERCENTAGE']) . '%)</option>';
}
if (isset($arExtra)) {
unset($arExtra);
}
return $s . '</select>';
}
示例2: getProductInfo
/** Returns an array, containing information about the product block on its ID.
* @param $elementId
* @return array|string
*/
public static function getProductInfo($elementId)
{
$elementId = intval($elementId);
$result = "";
if ($elementId <= 0) {
return $result;
}
$dbProduct = CIBlockElement::GetList(array(), array("ID" => $elementId), false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'DETAIL_PICTURE', 'PREVIEW_PICTURE', 'NAME', 'XML_ID'));
while ($arProduct = $dbProduct->GetNext()) {
$imgCode = "";
if ($arProduct["IBLOCK_ID"] > 0) {
$arProduct["EDIT_PAGE_URL"] = CIBlock::GetAdminElementEditLink($arProduct["IBLOCK_ID"], $elementId, array("find_section_section" => $arProduct["IBLOCK_SECTION_ID"]));
}
if ($arProduct["DETAIL_PICTURE"] > 0) {
$imgCode = $arProduct["DETAIL_PICTURE"];
} elseif ($arProduct["PREVIEW_PICTURE"] > 0) {
$imgCode = $arProduct["PREVIEW_PICTURE"];
}
$arProduct["NAME"] = $arProduct["NAME"];
$arProduct["DETAIL_PAGE_URL"] = htmlspecialcharsex($arProduct["DETAIL_PAGE_URL"]);
if ($imgCode > 0) {
$arFile = CFile::GetFileArray($imgCode);
$arImgProduct = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
$arProduct["IMG_URL"] = $arImgProduct['src'];
}
return $arProduct;
}
return $result;
}
示例3: ListAddFilterFields
public function ListAddFilterFields(&$arFilterFields, &$arFilterLogic, $sFormName = 'form1', $bVarsFromForm = true)
{
global $APPLICATION;
$arUserFields = $this->GetUserFields($this->sEntityID, 0, LANGUAGE_ID);
foreach ($arUserFields as $FIELD_NAME => $arUserField) {
if ($arUserField['SHOW_FILTER'] != 'N' && $arUserField['USER_TYPE']['BASE_TYPE'] != 'file') {
if ($arUserField['USER_TYPE']['USER_TYPE_ID'] === 'employee') {
$arFilterFields[] = array('id' => $FIELD_NAME, 'name' => htmlspecialcharsex($arUserField['LIST_FILTER_LABEL']), 'type' => 'user', 'enable_settings' => false);
continue;
}
if ($arUserField['USER_TYPE']['BASE_TYPE'] == 'enum' || $arUserField['USER_TYPE']['USER_TYPE_ID'] == 'iblock_element' || $arUserField['USER_TYPE']['USER_TYPE_ID'] == 'iblock_section') {
// Fix #29649. Allow user to add not multiple fields with height 1 item.
if ($arUserField['MULTIPLE'] !== 'Y' && isset($arUserField['SETTINGS']['LIST_HEIGHT']) && intval($arUserField['SETTINGS']['LIST_HEIGHT']) > 1) {
$arUserField['MULTIPLE'] = 'Y';
}
//as the system presets the filter can not work with the field names containing []
if ($arUserField['SETTINGS']['DISPLAY'] == 'CHECKBOX') {
$arUserField['SETTINGS']['DISPLAY'] = '';
}
}
ob_start();
$APPLICATION->IncludeComponent('bitrix:crm.field.filter', $arUserField['USER_TYPE']['USER_TYPE_ID'], array('arUserField' => $arUserField, 'bVarsFromForm' => $bVarsFromForm, 'form_name' => 'filter_' . $sFormName, 'bShowNotSelected' => true), false, array('HIDE_ICONS' => true));
$sVal = ob_get_contents();
ob_end_clean();
$arFilterFields[] = array('id' => $FIELD_NAME, 'name' => htmlspecialcharsex($arUserField['LIST_FILTER_LABEL']), 'type' => 'custom', 'value' => $sVal);
// Fix issue #49771 - do not treat 'crm' type values as strings. To suppress filtration by LIKE.
// Fix issue #56844 - do not treat 'crm_status' type values as strings. To suppress filtration by LIKE.
if ($arUserField['USER_TYPE']['BASE_TYPE'] == 'string' && $arUserField['USER_TYPE']['USER_TYPE_ID'] !== 'crm' && $arUserField['USER_TYPE']['USER_TYPE_ID'] !== 'crm_status') {
$arFilterLogic[] = $FIELD_NAME;
}
}
}
}
示例4: getData
public function getData($bEscape = true)
{
if ($this->cachedData === null) {
// Ensure that we have read access for task
$this->oTaskItem->getData();
try {
$this->cachedData = static::fetchDataFromDb($this->taskId, $this->itemId);
} catch (Exception $e) {
throw new TasksException('', TasksException::TE_ITEM_NOT_FOUND_OR_NOT_ACCESSIBLE);
}
}
if ($bEscape) {
// Prepare escaped data on-demand
if ($this->cachedEscapedData === null) {
foreach ($this->cachedData as $field => $value) {
$this->cachedEscapedData['~' . $field] = $value;
if (is_numeric($value) || !is_string($value)) {
$this->cachedEscapedData[$field] = $value;
} else {
$this->cachedEscapedData[$field] = htmlspecialcharsex($value);
}
}
}
return $this->cachedEscapedData;
} else {
return $this->cachedData;
}
}
示例5: getProductInfo
function getProductInfo($arData)
{
$result = "";
if (!is_array($arData) || count($arData) <= 0) {
return $result;
}
$dbProduct = CIBlockElement::GetList(array(), array("ID" => $arData["ELEMENT_ID"]), false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'DETAIL_PICTURE', 'PREVIEW_PICTURE', 'IBLOCK_TYPE_ID', 'NAME'));
while ($arProduct = $dbProduct->GetNext()) {
$imgCode = "";
if ($arProduct["IBLOCK_ID"] > 0) {
$arProduct["EDIT_PAGE_URL"] = "/bitrix/admin/iblock_element_edit.php?ID=" . $arProduct["ID"] . "&type=" . $arProduct["IBLOCK_TYPE_ID"] . "&lang=" . LANG . "&IBLOCK_ID=" . $arProduct["IBLOCK_ID"] . "&find_section_section=" . intval($arProduct["IBLOCK_SECTION_ID"]);
}
if ($arProduct["DETAIL_PICTURE"] > 0) {
$imgCode = $arProduct["DETAIL_PICTURE"];
} elseif ($arProduct["PREVIEW_PICTURE"] > 0) {
$imgCode = $arProduct["PREVIEW_PICTURE"];
}
$arProduct["NAME"] = htmlspecialcharsex($arProduct["NAME"]);
$arProduct["DETAIL_PAGE_URL"] = htmlspecialcharsex($arProduct["DETAIL_PAGE_URL"]);
$arProduct["CURRENCY"] = htmlspecialcharsex($arProduct["CURRENCY"]);
if ($imgCode > 0) {
$arFile = CFile::GetFileArray($imgCode);
$arImgProduct = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
$arProduct["IMG_URL"] = $arImgProduct['src'];
}
return $arProduct;
}
}
示例6: InputTags
function InputTags($sName="", $sValue="", $arSites=array(), $sHTML="", $sId="")
{
if(!$sId)
$sId = GenerateUniqId($sName);
TagsShowScript();
$order = class_exists("cuseroptions")? CUserOptions::GetOption("search_tags", "order", "CNT"): "CNT";
return '<input name="'.htmlspecialcharsbx($sName).'" id="'.htmlspecialcharsbx($sId).'" type="text" autocomplete="off" value="'.htmlspecialcharsex($sValue).'" onfocus="'.htmlspecialcharsbx('window.oObject[this.id] = new JsTc(this, '.CUtil::PhpToJSObject($arSites).');').'" '.$sHTML.'/><input type="checkbox" id="ck_'.$sId.'" name="ck_'.htmlspecialcharsbx($sName).'" '.($order=="NAME"? "checked": "").' title="'.GetMessage("SEARCH_TAGS_SORTING_TIP").'">';
}
示例7: GetAdminListViewHTML
function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName)
{
if (strlen($value["VALUE"]) > 0) {
if (!CheckDateTime($value["VALUE"])) {
$value = CIBlockPropertyDateTime::ConvertFromDB($arProperty, $value);
}
return str_replace(" ", " ", htmlspecialcharsex($value["VALUE"]));
} else {
return ' ';
}
}
示例8: Fetch
public function Fetch()
{
$r = parent::Fetch();
if($r)
{
if(strlen($r["SITE_URL"])>0)
$r["URL"] = $r["SITE_URL"];
if(substr($r["URL"], 0, 1)=="=")
{
$events = GetModuleEvents("search", "OnSearchGetURL");
while ($arEvent = $events->Fetch())
$r["URL"] = ExecuteModuleEventEx($arEvent, array($r));
}
$r["URL"] = str_replace(
array("#LANG#", "#SITE_DIR#", "#SERVER_NAME#"),
array($r["DIR"], $r["DIR"], $r["SERVER_NAME"]),
$r["URL"]
);
$r["URL"] = preg_replace("'(?<!:)/+'s", "/", $r["URL"]);
$r["NAME"] = htmlspecialcharsex($r["TITLE"]);
$preg_template = "/(^|[^".$this->_arStemFunc["pcre_letters"]."])(".str_replace("/", "\\/", implode("|", array_map('preg_quote', array_keys($this->_arPhrase)))).")/i".BX_UTF_PCRE_MODIFIER;
if(preg_match_all($preg_template, ToUpper($r["NAME"]), $arMatches, PREG_OFFSET_CAPTURE))
{
$c = count($arMatches[2]);
if(defined("BX_UTF"))
{
for($j = $c-1; $j >= 0; $j--)
{
$prefix = mb_substr($r["NAME"], 0, $arMatches[2][$j][1], 'latin1');
$instr = mb_substr($r["NAME"], $arMatches[2][$j][1], mb_strlen($arMatches[2][$j][0], 'latin1'), 'latin1');
$suffix = mb_substr($r["NAME"], $arMatches[2][$j][1] + mb_strlen($arMatches[2][$j][0], 'latin1'), mb_strlen($r["NAME"], 'latin1'), 'latin1');
$r["NAME"] = $prefix."<b>".$instr."</b>".$suffix;
}
}
else
{
for($j = $c-1; $j >= 0; $j--)
{
$prefix = substr($r["NAME"], 0, $arMatches[2][$j][1]);
$instr = substr($r["NAME"], $arMatches[2][$j][1], strlen($arMatches[2][$j][0]));
$suffix = substr($r["NAME"], $arMatches[2][$j][1]+strlen($arMatches[2][$j][0]));
$r["NAME"] = $prefix."<b>".$instr."</b>".$suffix;
}
}
}
}
return $r;
}
示例9: GetInfoHTML
function GetInfoHTML($params = array())
{
$html = '';
if (is_array($this->_file)) {
$intWidth = $this->_width;
$intHeight = $this->_height;
$img_src = '';
$divId = '';
if (isset($params['url_template']) && $intWidth > 0 && $intHeight > 0) {
$img_src = $this->GetImgSrc(array('url_template' => $params['url_template']));
if ($img_src) {
CUtil::InitJSCore(array("viewer"));
self::$_counter++;
$divId = 'lists-image-info-' . self::$_counter;
}
}
if ($divId) {
$html .= '<div id="' . $divId . '">';
} else {
$html .= '<div>';
}
if (isset($params['view']) && $params['view'] == 'short') {
$info = $this->_file["FILE_NAME"] . ' (';
if ($intWidth > 0 && $intHeight > 0) {
$info .= $intWidth . 'x' . $intHeight . ', ';
}
$info .= CFile::FormatSize($this->_file['FILE_SIZE']) . ')';
if ($divId) {
$html .= GetMessage('FILE_TEXT') . ': <span style="cursor:pointer" data-bx-viewer="image" data-bx-src="' . htmlspecialcharsbx($img_src) . '">' . htmlspecialcharsex($info) . '</span>';
} else {
$html .= GetMessage('FILE_TEXT') . ': ' . htmlspecialcharsex($info);
}
} else {
if ($divId) {
$html .= GetMessage('FILE_TEXT') . ': <span style="cursor:pointer" data-bx-viewer="image" data-bx-src="' . htmlspecialcharsbx($img_src) . '">' . htmlspecialcharsex($this->_file["FILE_NAME"]) . '</span>';
} else {
$html .= GetMessage('FILE_TEXT') . ': ' . htmlspecialcharsex($this->_file["FILE_NAME"]);
}
/*if($intWidth > 0 && $intHeight > 0)
{
$html .= '<br>'.GetMessage('FILE_WIDTH').': '.$intWidth;
$html .= '<br>'.GetMessage('FILE_HEIGHT').': '.$intHeight;
}*/
$html .= '<br>' . GetMessage('FILE_SIZE') . ': ' . CFile::FormatSize($this->_file['FILE_SIZE']);
}
if ($divId) {
$html .= '</div><script>BX.ready(function(){BX.viewElementBind("' . $divId . '");});</script>';
} else {
$html .= '</div>';
}
}
return $html;
}
示例10: GetAdminListViewHTML
public static function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName)
{
if (!is_array($value["VALUE"])) {
$value = CIBlockPropertyHTML::ConvertFromDB($arProperty, $value);
}
$ar = $value["VALUE"];
if ($ar) {
return htmlspecialcharsex($ar["TYPE"] . ":" . $ar["TEXT"]);
} else {
return " ";
}
}
示例11: GetPropertyFieldHtml
function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName)
{
$ar_res = false;
if (strlen($value["VALUE"])) {
$db_res = CIBlockElement::GetList(array(), array("=XML_ID" => $value["VALUE"], "SHOW_HISTORY" => "Y"), false, false, array("ID", "IBLOCK_ID", "NAME"));
$ar_res = $db_res->GetNext();
}
if (!$ar_res) {
$ar_res = array("NAME" => "");
}
return '<input name="' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" id="' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" value="' . htmlspecialcharsex($value["VALUE"]) . '" size="20" type="text">' . '<input type="button" value="..." onClick="jsUtils.OpenWindow(\'' . CUtil::JSEscape('/bitrix/admin/iblock_element_search.php?lang=' . LANG . '&n=' . urlencode($strHTMLControlName["VALUE"]) . '&get_xml_id=Y&a=b') . '\', 600, 500);">' . ' <span id="sp_' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" >' . $ar_res['NAME'] . '</span>';
}
示例12: _get_sections_menu
function _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL, $SECTION_ID, $arSectionsChain = false)
{
//Determine opened sections
if ($arSectionsChain === false) {
$arSectionsChain = array();
if (isset($_REQUEST['admin_mnu_menu_id'])) {
$menu_id = "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/";
if (strncmp($_REQUEST['admin_mnu_menu_id'], $menu_id, strlen($menu_id)) == 0) {
$rsSections = CIBlockSection::GetNavChain($arIBlock["ID"], substr($_REQUEST['admin_mnu_menu_id'], strlen($menu_id)), array('ID', 'IBLOCK_ID'));
while ($arSection = $rsSections->Fetch()) {
$arSectionsChain[$arSection["ID"]] = $arSection["ID"];
}
}
}
if (isset($_REQUEST["find_section_section"]) && (int) $_REQUEST["find_section_section"] > 0 && isset($_REQUEST["IBLOCK_ID"]) && $_REQUEST["IBLOCK_ID"] == $arIBlock["ID"]) {
$rsSections = CIBlockSection::GetNavChain($arIBlock["ID"], $_REQUEST["find_section_section"], array('ID', 'IBLOCK_ID'));
while ($arSection = $rsSections->Fetch()) {
$arSectionsChain[$arSection["ID"]] = $arSection["ID"];
}
}
}
$urlSectionAdminPage = CIBlock::GetAdminSectionListLink($arIBlock["ID"], array("menu" => null));
$arSections = array();
if (CIBlock::GetAdminListMode($arIBlock["ID"]) == 'S') {
$arSections[] = _get_elements_menu($arType, $arIBlock, $SECTION_ID);
}
$rsSections = CIBlockSection::GetList(array("left_margin" => "ASC"), array("IBLOCK_ID" => $arIBlock["ID"], "SECTION_ID" => $SECTION_ID), false, array("ID", "IBLOCK_SECTION_ID", "NAME", "LEFT_MARGIN", "RIGHT_MARGIN"));
$sectionCount = 0;
$limit = COption::GetOptionInt("iblock", "iblock_menu_max_sections");
while ($arSection = $rsSections->Fetch()) {
if ($limit > 0 && $sectionCount >= $limit) {
$arSections[] = array("text" => GetMessage("IBLOCK_MENU_ALL_OTH"), "url" => htmlspecialcharsbx($urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"]), "more_url" => array($urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"], $urlSectionAdminPage, "iblock_section_edit.php?" . $arIBlock["URL_PART"], "iblock_element_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"], "iblock_history_list.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"]), "title" => GetMessage("IBLOCK_MENU_ALL_OTH_TITLE"), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "items_id" => "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"], "module_id" => "iblock", "items" => array());
_get_other_elements_menu($arType, $arIBlock, $arSection, $arSections[0]["more_url"]);
break;
}
$arSectionTmp = array("text" => htmlspecialcharsex($arSection["NAME"]), "url" => htmlspecialcharsbx($urlSectionAdminPage . "&find_section_section=" . $arSection["ID"]), "more_url" => array($urlSectionAdminPage . "&find_section_section=" . $arSection["ID"], "iblock_section_edit.php?" . $arIBlock["URL_PART"] . "&ID=" . $arSection["ID"], "iblock_section_edit.php?" . $arIBlock["URL_PART"] . "&ID=0&find_section_section=" . $arSection["ID"], "iblock_element_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"] . "&find_section_section=" . $arSection["ID"], "iblock_history_list.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"] . "&find_section_section=" . $arSection["ID"]), "title" => htmlspecialcharsex($arSection["NAME"]), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "dynamic" => CIBlock::GetAdminListMode($arIBlock["ID"]) == 'S' || $arSection["RIGHT_MARGIN"] - $arSection["LEFT_MARGIN"] > 1, "items_id" => "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"], "module_id" => "iblock", "items" => array());
if (array_key_exists($arSection["ID"], $arSectionsChain)) {
$arSectionTmp["items"] = _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
} elseif (method_exists($GLOBALS["adminMenu"], "IsSectionActive")) {
if ($GLOBALS["adminMenu"]->IsSectionActive("menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"])) {
$arSectionTmp["items"] = _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
}
}
$arSections[] = $arSectionTmp;
$sectionCount++;
}
while ($arSection = $rsSections->Fetch()) {
$urlElementAdminPage = CIBlock::GetAdminElementListLink($arIBlock["ID"], array("menu" => null));
$arSections[0]["more_url"][] = $urlElementAdminPage . "&find_section_section=" . (int) $arSection["ID"];
}
return $arSections;
}
示例13: GetInfoHTML
function GetInfoHTML()
{
$html = '';
if (is_array($this->_file)) {
$html .= GetMessage('FILE_TEXT') . ': ' . htmlspecialcharsex($this->_file["FILE_NAME"]);
$intWidth = $this->_width;
$intHeight = $this->_height;
if ($intWidth > 0 && $intHeight > 0) {
$html .= '<br>' . GetMessage('FILE_WIDTH') . ': ' . $intWidth;
$html .= '<br>' . GetMessage('FILE_HEIGHT') . ': ' . $intHeight;
}
$html .= '<br>' . GetMessage('FILE_SIZE') . ': ' . CFile::FormatSize($this->_file['FILE_SIZE']);
}
return $html;
}
示例14: UsersArrayToStringInternal
private static function UsersArrayToStringInternal($arUsers, $arWorkflowTemplate, $arAllowableUserGroups, $appendId = true)
{
if (is_array($arUsers)) {
$r = array();
$keys = array_keys($arUsers);
foreach ($keys as $key) {
$r[$key] = self::UsersArrayToStringInternal($arUsers[$key], $arWorkflowTemplate, $arAllowableUserGroups, $appendId);
}
if (count($r) == 2) {
$keys = array_keys($r);
if ($keys[0] == 0 && $keys[1] == 1 && is_string($r[0]) && is_string($r[1])) {
if (in_array($r[0], array("Document", "Template", "Variable", "User")) || preg_match('#^A\\d+_\\d+_\\d+_\\d+$#i', $r[0]) || is_array($arWorkflowTemplate) && CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $r[0]) != null) {
return "{=" . $r[0] . ":" . $r[1] . "}";
}
}
}
return implode(", ", $r);
} else {
if (array_key_exists(strtolower($arUsers), $arAllowableUserGroups)) {
return $arAllowableUserGroups[strtolower($arUsers)];
}
$userId = 0;
if (substr($arUsers, 0, strlen("user_")) == "user_") {
$userId = intval(substr($arUsers, strlen("user_")));
}
if ($userId > 0) {
$db = CUser::GetList($by = "LAST_NAME", $order = "asc", array("ID_EQUAL_EXACT" => $userId), array("NAV_PARAMS" => false));
if ($ar = $db->Fetch()) {
$str = CUser::FormatName(COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), $ar, true, false);
if ($appendId) {
$str = $str . " [" . $ar["ID"] . "]";
}
return str_replace(",", " ", $str);
}
} else {
if (strpos($arUsers, 'group_') === 0) {
$str = htmlspecialcharsex(self::getExtendedGroupName($arUsers, $appendId));
return str_replace(",", " ", $str);
}
}
return str_replace(",", " ", $arUsers);
}
}
示例15: GetUserName
function GetUserName($USER_ID, $nameTemplate = "")
{
$ar_res = false;
if (IntVal($USER_ID) > 0) {
$db_res = CUser::GetByID(IntVal($USER_ID));
$ar_res = $db_res->Fetch();
}
if (!$ar_res) {
$db_res = CUser::GetByLogin($USER_ID);
$ar_res = $db_res->Fetch();
}
$USER_ID = IntVal($ar_res["ID"]);
$f_LOGIN = htmlspecialcharsex($ar_res["LOGIN"]);
$forum_user = CForumUser::GetByUSER_ID($USER_ID);
if ($forum_user["SHOW_NAME"] == "Y" && (strlen(trim($ar_res["NAME"])) > 0 || strlen(trim($ar_res["LAST_NAME"])) > 0)) {
$nameTemplate = trim(empty($nameTemplate)) ? CSite::GetNameFormat() : $nameTemplate;
return trim(CUser::FormatName($nameTemplate, array("NAME" => htmlspecialcharsEx($ar_res["NAME"]), "LAST_NAME" => htmlspecialcharsEx($ar_res["LAST_NAME"]), "SECOND_NAME" => htmlspecialcharsEx($ar_res["SECOND_NAME"]))));
} else {
return $f_LOGIN;
}
}