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/cvetdv.ru/bitrix/blocks/bitrix/66.100.form_cb/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/blocks/bitrix/66.100.form_cb/class.php
<?php
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true)
{
	die();
}

use Bitrix\Landing\Block;
use Bitrix\Landing\LandingBlock;
use Bitrix\Landing\Manager;
use Bitrix\Landing\Subtype;
use Bitrix\Main\Loader;
use Bitrix\Main\Localization\Loc;
use Bitrix\Socialservices\ApClient;

class CallbackFormBlock extends LandingBlock
{
	protected const CALLBACK_MARKER_PREFIX = '#crmFormCallback';

	/**
	 * Before every view checked:
	 * If form ID already replaced - do nothing.
	 * If first time - replace by first CB form
	 * If not form - show alert
	 *
	 * @param Block $block Block instance.
	 * @return void
	 */
	public function beforeView(Block $block)
	{
		$content = $block->getContent();
		if(strpos($content, self::CALLBACK_MARKER_PREFIX) !== false)
		{
			if(($forms = Subtype\Form::getCallbackForms()))
			{
				$block->saveContent(str_replace(
					self::CALLBACK_MARKER_PREFIX,
					Subtype\Form::POPUP_MARKER_PREFIX . array_shift($forms)['ID'],
					$content
				));
				$block->save();
			}
			else
			{
 				if(Loader::includeModule('crm'))
				{
					$desc = Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_DESC', [
						'#LINK1#' => '/telephony/',
						'#LINK2#' => '/crm/webform/',
					]);
				}
				elseif (Manager::isB24Connector())
				{
					//todo check
					$portalUrl = ApClient::init() ? ApClient::init()->getConnection()['ENDPOINT'] : '';
					$desc = Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_DESC_CONNECTOR', [
						'#LINK1#' => $portalUrl . '/telephony/',
						'#LINK2#' => $portalUrl . '/crm/webform/',
					]);
				}
				else
				{
					$desc = Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_DESC_NO_CONNECTOR', [
						'#LINK1#' => '/bitrix/admin/module_admin.php',
					]);
				}
				$block->setRuntimeRequiredUserAction([
					'header' => Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_TITLE'),
					'description' => $desc,
					'text' => Loc::getMessage('LNDNGBLCK_CALLBACK_SETTINGS'),
				]);

			}
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit