CCrmViewHelper::RenderUserCustomSearch

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmViewHelper
  4. RenderUserCustomSearch
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_view_helper.php
  • Класс: \CCrmViewHelper
  • Вызов: CCrmViewHelper::RenderUserCustomSearch
static function RenderUserCustomSearch($arParams)
{
	if(!is_array($arParams))
	{
		return;
	}

	CCrmComponentHelper::RegisterScriptLink('/bitrix/js/crm/common.js');

	$editorID = isset($arParams['ID']) ? strval($arParams['ID']) : '';
	$searchInputID = isset($arParams['SEARCH_INPUT_ID']) ? strval($arParams['SEARCH_INPUT_ID']) : '';
	$searchInputName = isset($arParams['SEARCH_INPUT_NAME']) ? strval($arParams['SEARCH_INPUT_NAME']) : '';
	if($searchInputName === '')
	{
		$searchInputName = $searchInputID;
	}

	$dataInputID = isset($arParams['DATA_INPUT_ID']) ? strval($arParams['DATA_INPUT_ID']) : '';
	$dataInputName = isset($arParams['DATA_INPUT_NAME']) ? strval($arParams['DATA_INPUT_NAME']) : '';
	if($dataInputName === '')
	{
		$dataInputName = $dataInputID;
	}

	$componentName = isset($arParams['COMPONENT_NAME']) ? strval($arParams['COMPONENT_NAME']) : '';

	$siteID = isset($arParams['SITE_ID']) ? strval($arParams['SITE_ID']) : '';
	if($siteID === '')
	{
		$siteID = SITE_ID;
	}

	$nameFormat = isset($arParams['NAME_FORMAT']) ? strval($arParams['NAME_FORMAT']) : '';
	if($nameFormat === '')
	{
		$nameFormat = CSite::GetNameFormat(false);
	}

	$user = isset($arParams['USER']) && is_array($arParams['USER']) ? $arParams['USER'] : array();
	$zIndex = isset($arParams['ZINDEX']) ? intval($arParams['ZINDEX']) : 0;

	/*
	//new style with user clear support
	echo '',
		'',
		'',
		'',
		'',
		'';
	*/
	$searchInputHint = isset($arParams['SEARCH_INPUT_HINT']) ? strval($arParams['SEARCH_INPUT_HINT']) : '';
	if($searchInputHint !== '')
	{
		$searchInputHint = 'BX.hint(this, \''.CUtil::JSEscape($searchInputHint).'\');';
	}
	echo '' : '>','',
	'';

	$delay = isset($arParams['DELAY']) ? intval($arParams['DELAY']) : 0;

	echo '';

	$GLOBALS['APPLICATION']->IncludeComponent(
		'bitrix:intranet.user.selector.new',
		'',
		array(
			'MULTIPLE' => 'N',
			'NAME' => $componentName,
			'INPUT_NAME' => $searchInputID,
			'SHOW_EXTRANET_USERS' => 'NONE',
			'POPUP' => 'Y',
			'SITE_ID' => $siteID,
			'NAME_TEMPLATE' => $nameFormat
		),
		null,
		array('HIDE_ICONS' => 'Y')
	);
}

Добавить комментарий