MessageToloka::setConfigurationOptions

  1. Bitrix24 API (v. 23.675.0)
  2. sender
  3. MessageToloka
  4. setConfigurationOptions
  • Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/integration/yandex/toloka/messagetoloka.php
  • Класс: Bitrix\Sender\Integration\Yandex\Toloka\MessageToloka
  • Вызов: MessageToloka::setConfigurationOptions
protected function setConfigurationOptions()
{
	$this->configuration->setArrayOptions(
		[
			[
				'type'         => 'string',
				'code'         => 'PROJECT_ID',
				'name'         => Loc::getMessage('SENDER_INTEGRATION_SEO_MESSAGE_CONFIG_PROJECT'),
				'required'     => false,
				'show_in_list' => false,
				'value'        => '',
			],
			[
				'type'         => 'string',
				'code'         => 'POOL_ID',
				'name'         => Loc::getMessage('SENDER_INTEGRATION_SEO_MESSAGE_CONFIG_POOL'),
				'required'     => false,
				'show_in_list' => false,
				'value'        => '',
			],
			[
				'type'         => 'string',
				'code'         => 'TASK_SUITE_ID',
				'name'         => '',
				'required'     => false,
				'show_in_list' => false,
				'value'        => '',
			],
			[
				'type'         => 'text',
				'code'         => 'INSTRUCTION',
				'name'         => Loc::getMessage('SENDER_TOLOKA_PROJECT_INSTRUCTION'),
				'required'     => true,
				'show_in_list' => true,
				'max_length'   => 2048,
				'value'        => '',
			],
			[
				'type'         => 'text',
				'code'         => 'DESCRIPTION',
				'name'         => Loc::getMessage('SENDER_TOLOKA_PROJECT_DESCRIPTION'),
				'required'     => true,
				'max_length'   => 2048,
				'show_in_list' => true,
				'value'        => '',
			],
			[
				'type'         => 'text',
				'code'         => 'TASKS',
				'name'         => Loc::getMessage('SENDER_TOLOKA_TASKS'),
				'required'     => true,
				'show_in_list' => true,
				'value'        => '',
			],
			[
				'type'         => 'number',
				'code'         => 'PRICE',
				'name'         => Loc::getMessage('SENDER_TOLOKA_PRICE'),
				'required'     => true,
				'show_in_list' => true,
				'value'        => '0.07',
				'hint'         => Loc::getMessage("SENDER_TOLOKA_PRICE_HINT")

			],
			[
				'type'         => 'checkbox',
				'code'         => 'ADULT_CONTENT',
				'name'         => Loc::getMessage('SENDER_TOLOKA_ADULT_CONTENT'),
				'required'     => false,
				'show_in_list' => true,
				'value'        => '',
			],
			[
				'type'         => 'number',
				'code'         => 'OVERLAP',
				'name'         => Loc::getMessage('SENDER_TOLOKA_MAX_POEOPLE_COUNT'),
				'required'     => true,
				'show_in_list' => true,
				'value'        => '100',
			],
			[
				'type'         => 'datetime',
				'code'         => 'EXPIRE_IN',
				'name'         => Loc::getMessage('SENDER_TOLOKA_POOL_EXPIRE_IN'),
				'required'     => true,
				'show_in_list' => true,
				'value'        => '',
			],
			[
				'type'         => 'string',
				'code'         => 'FILTER',
				'name'         => Loc::getMessage('SENDER_CONFIG_FILTER'),
				'required'     => false,
				'show_in_list' => true,
			],
		]
	);

	$list = [
		[
			'type'  => 'template-type',
			'code'  => 'TEMPLATE_TYPE',
			'name'  => 'Template type',
			'value' => '',
		],
		[
			'type'  => 'template-id',
			'code'  => 'TEMPLATE_ID',
			'name'  => 'Template id',
			'value' => '',
		],
	];

	foreach ($list as $optionData)
	{
		$optionData = $optionData + [
				'type'     => 'string',
				'name'     => '',
				'internal' => true,
			];
		$this->configuration->addOption(new Message\ConfigurationOption($optionData));
	}
}

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