2020-11-24 12:14:26 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2024-04-29 11:44:31 +03:00
|
|
|
* @category RetailCRM
|
|
|
|
* @package RetailCRM\Consultant
|
|
|
|
* @author RetailCRM <integration@retailcrm.ru>
|
|
|
|
* @license MIT
|
|
|
|
* @link http://retailcrm.ru
|
|
|
|
* @see http://retailcrm.ru/docs
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class RetailCrmOnlineConsultant
|
|
|
|
*
|
|
|
|
* @category RetailCRM
|
|
|
|
* @package RetailCRM\Consultant
|
2020-11-24 12:14:26 +03:00
|
|
|
*/
|
|
|
|
class RetailCrmOnlineConsultant
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Add a script of online consultant
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public static function add()
|
|
|
|
{
|
2023-03-15 11:55:04 +03:00
|
|
|
$request = \Bitrix\Main\Context::getCurrent()->getRequest();
|
|
|
|
|
|
|
|
if (RetailcrmConfigProvider::isOnlineConsultantEnabled() && $request->isAdminSection() !== true) {
|
2020-11-24 12:14:26 +03:00
|
|
|
\Bitrix\Main\Page\Asset::getInstance()->addString(
|
|
|
|
RetailcrmConfigProvider::getOnlineConsultantScript(),
|
|
|
|
true
|
|
|
|
);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|