403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/filter/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/filter/entitydataprovider.php
<?php
namespace Bitrix\Main\Filter;

use Bitrix\Main;

abstract class EntityDataProvider extends DataProvider
{
	/**
	 * Get specified entity field caption.
	 * @param string $fieldID Field ID.
	 * @return string
	 * @throws Main\NotImplementedException
	 */
	protected function getFieldName($fieldID)
	{
		throw new Main\NotImplementedException('Method getFieldName must be overridden');
	}
	/**
	 * Create filter field.
	 * @param string $fieldID Field ID.
	 * @param array|null $params Field parameters (optional).
	 * @return Field
	 * @throws Main\NotImplementedException
	 */
	protected function createField($fieldID, array $params = null)
	{
		if(!is_array($params))
		{
			$params = [];
		}

		if(!isset($params['name']))
		{
			$params['name'] = $this->getFieldName($fieldID);
		}

		return new Field($this, $fieldID, $params);
	}

	protected function getUserEntitySelectorParams(string $context, array $params): array
	{
		$entities = [
			[
				'id' => 'user',
				'options' => [
					'inviteEmployeeLink' => false,
					'intranetUsersOnly' => true,
				]
			],
		];

		if (class_exists(\Bitrix\Socialnetwork\Integration\UI\EntitySelector\FiredUserProvider::class))
		{
			$entities[] = [
				'id' => 'fired-user',
				'options' => [
					'inviteEmployeeLink' => false,
					'intranetUsersOnly' => true,
					'fieldName' => $params['fieldName'],
					'referenceClass'  => ($params['referenceClass'] ?? null),
					'entityTypeId' => ($params['entityTypeId'] ?? null),
					'module' => ($params['module'] ?? null),
				]
			];
		}

		$isEnableAllUsers = isset($params['isEnableAllUsers']) && $params['isEnableAllUsers'] === true;
		$isEnableOtherUsers = isset($params['isEnableOtherUsers']) && $params['isEnableOtherUsers'] === true;

		if ($isEnableAllUsers || $isEnableOtherUsers)
		{
			$metaUser = [
				'id' => 'meta-user',
				'options' => [],
			];

			if ($isEnableAllUsers)
			{
				$metaUser['options']['all-users'] = true;
			}
			if ($isEnableOtherUsers)
			{
				$metaUser['options']['other-users'] = true;
			}

			$entities[] = $metaUser;
		}

		return [
			'params' => [
				'multiple' => 'Y',
				'dialogOptions' => [
					'height' => 200,
					'context' => $context,
					'entities' => $entities,
					'showAvatars' => true,
					'dropdownMode' => false,
				],
			],
		];
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit