uawdijnntqw1x1x1
IP : 3.144.101.157
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
bitrix
/
modules
/
salescenter
/
lib
/
integration
/
immanager.php
/
/
<?php namespace Bitrix\SalesCenter\Integration; use Bitrix\Main\Config\Option; use Bitrix\Main\Localization\Loc; use Bitrix\SalesCenter\Driver; class ImManager extends Base { const IM_APP_CODE = 'salescenter'; const OPTION_SALESCENTER_APPLICATION_ID = '~salescenter_app_id'; /** * @return string */ protected function getModuleName() { return 'im'; } /** * @return bool */ public function isApplicationInstalled() { $applicationId = static::getInstance()->getApplicationId(); if(!$applicationId) { static::installApplication(); } $applicationId = static::getInstance()->getApplicationId(); return $applicationId > 0; } public static function installApplication() { if(!static::getInstance()->isEnabled()) { return; } $application = \Bitrix\Im\Model\AppTable::getList([ 'filter' => [ '=MODULE_ID' => Driver::MODULE_ID, '=CODE' => static::IM_APP_CODE, ] ])->fetch(); if(!$application) { $iconId = static::getInstance()->saveApplicationIcon(); // no icon - no application if($iconId > 0) { $applicationId = \Bitrix\Im\App::register([ 'MODULE_ID' => Driver::MODULE_ID, 'BOT_ID' => 0, 'CODE' => static::IM_APP_CODE, 'REGISTERED' => 'Y', 'ICON_ID' => $iconId, 'JS' => 'BX.MessengerCommon.openStore()', 'CONTEXT' => 'lines', 'CLASS' => static::class, 'METHOD_LANG_GET' => 'getAppLangInfo', ]); if($applicationId > 0) { static::getInstance()->setApplicationId($applicationId); } } } else { static::getInstance()->setApplicationId($application['ID']); } } public static function unInstallApplication() { $applicationId = static::getInstance()->getApplicationId(); if($applicationId > 0) { \Bitrix\Im\App::unRegister([ 'ID' => $applicationId, 'FORCE' => 'Y' ]); static::getInstance()->setApplicationId(0); } } /** * @return int */ protected function getApplicationId() { return (int) Option::get(Driver::MODULE_ID, static::OPTION_SALESCENTER_APPLICATION_ID); } /** * @param int $applicationId */ protected function setApplicationId($applicationId) { $applicationId = (int) $applicationId; Option::set(Driver::MODULE_ID, static::OPTION_SALESCENTER_APPLICATION_ID, $applicationId); } /** * @param null $lang * @return array|bool */ public static function getAppLangInfo($command, $lang = null) { $title = Loc::getMessage('SALESCENTER_APP_TITLE', null, $lang); $description = Loc::getMessage('SALESCENTER_APP_DESCRIPTION', null, $lang); $result = false; if(strlen($title) > 0) { $result = [ 'TITLE' => $title, 'DESCRIPTION' => $description, 'COPYRIGHT' => '' ]; } return $result; } /** * @return bool|int|null */ protected function saveApplicationIcon() { $iconPath = \Bitrix\Main\Application::getDocumentRoot().'/bitrix/modules/'.static::IM_APP_CODE.'/install/icon/icon_chat.png'; if(\Bitrix\Main\IO\File::isFileExists($iconPath)) { return \CFile::SaveFile(\CFile::MakeFileArray($iconPath), static::IM_APP_CODE); } return null; } }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/salescenter/lib/integration/immanager.php