2020-11-24 12:14:26 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* class RetailCrmOnlineConsultant
|
|
|
|
*/
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|