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/im/lib/V2/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/im/lib/V2/Application.php
<?php

namespace Bitrix\Im\V2;

use Bitrix\Im\V2\Application\Config;
use Bitrix\Main\Web\Json;

class Application
{
	public const MESSENGER_APP_NAME = 'messenger';
	public const QUICK_ACCESS_APP_NAME = 'quickAccess';

	private Config $config;

	public function __construct(?Config $config = null)
	{
		$this->config = $config ?? new Config();
	}

	public function getTemplate(string $appName): string
	{
		$preparedConfig = Json::encode($this->config);
		$then = $this->getThen($appName);

		return "
			BX.ready(function() {
				BX.Messenger.v2.Application.Launch('{$appName}', {$preparedConfig})
					.then((application) => {
						{$then}
					});
			});
		";
	}

	public function getConfig(): Config
	{
		return $this->config;
	}

	public function isAirDesignEnabled(): bool
	{
		return (
			\Bitrix\Main\Loader::includeModule('intranet')
			&& class_exists(\Bitrix\Intranet\Integration\Templates\Air\AirTemplate::class)
			&& method_exists(\Bitrix\Intranet\Integration\Templates\Air\AirTemplate::class, 'isEnabled')
			&& \Bitrix\Intranet\Integration\Templates\Air\AirTemplate::isEnabled()
		);
	}

	public function shouldHideQuickAccess(): bool
	{
		return defined('BX_IM_FULLSCREEN') && BX_IM_FULLSCREEN;
	}

	protected function getThen(string $appName): string
	{
		return $appName === self::MESSENGER_APP_NAME ? "application.initComponent('body')" : '';
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit