• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/integration/bitrix24manager.php
  • Класс: BitrixCalendarIntegrationBitrix24Manager
  • Вызов: Bitrix24Manager::prepareStubInfo
static function prepareStubInfo(array $params)
{
	if (
		ModuleManager::isModuleInstalled('bitrix24')
		&& Loader::includeModule('bitrix24')
		&& method_exists('CBitrix24', 'prepareStubInfo')
	)
	{
		$title = $params['TITLE'] ?? '';
		$content = $params['CONTENT'] ?? '';

		$replacements = isset($params['REPLACEMENTS']) && is_array($params['REPLACEMENTS'])
			? $params['REPLACEMENTS'] : array();

		if (!empty($replacements))
		{
			$search = array_keys($replacements);
			$replace = array_values($replacements);

			$title = str_replace($search, $replace, $title);
			$content = str_replace($search, $replace, $content);
		}

		$licenseAllButtonClass = ($params['GLOBAL_SEARCH']? 'ui-btn ui-btn-xs ui-btn-light-border' : 'success');
		$licenseDemoButtonClass = ($params['GLOBAL_SEARCH']? 'ui-btn ui-btn-xs ui-btn-light' : '');

		$options = [];
		if (isset($params['ANALYTICS_LABEL']) && $params['ANALYTICS_LABEL'] != '')
		{
			$options['ANALYTICS_LABEL'] = $params['ANALYTICS_LABEL'];
		}

		return CBitrix24::prepareStubInfo(
			$title,
			$content,
			array(
				array('ID' => CBitrix24::BUTTON_LICENSE_ALL, 'CLASS_NAME' => $licenseAllButtonClass),
				array('ID' => CBitrix24::BUTTON_LICENSE_DEMO, 'CLASS_NAME' => $licenseDemoButtonClass),
			),
			$options
		);
	}

	return null;
}