uawdijnntqw1x1x1
IP : 18.217.1.165
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
/
b24.axolotl.ru
/
.
/
public_html
/
bitrix
/
modules
/
im
/
lib
/
promotion.php
/
/
<?php namespace Bitrix\Im; class Promotion { const DEVICE_TYPE_WEB = "web"; // browser + desktop const DEVICE_TYPE_BROWSER = "browser"; const DEVICE_TYPE_DESKTOP = "desktop"; const DEVICE_TYPE_MOBILE = "mobile"; const DEVICE_TYPE_ALL = "all"; private static function getConfig() { $result = []; if (!\Bitrix\Main\Loader::includeModule('ui')) { return $result; } /* $result[] = [ "ID" => 'im:video:01042020:web', "USER_TYPE" => \Bitrix\Main\UI\Tour::USER_TYPE_OLD, "DEVICE_TYPE" => self::DEVICE_TYPE_WEB ]; */ $result[] = [ "ID" => 'ol:crmform:17092021:web', "USER_TYPE" => \Bitrix\Main\UI\Tour::USER_TYPE_OLD, "DEVICE_TYPE" => self::DEVICE_TYPE_WEB ]; $result[] = [ "ID" => 'im:call-document:16102021:web', "USER_TYPE" => \Bitrix\Main\UI\Tour::USER_TYPE_ALL, "DEVICE_TYPE" => self::DEVICE_TYPE_WEB ]; $result[] = [ "ID" => 'imbot:support24:25112021:web', "USER_TYPE" => \Bitrix\Main\UI\Tour::USER_TYPE_OLD, "DEVICE_TYPE" => self::DEVICE_TYPE_WEB ]; return $result; } public static function getActive($type = self::DEVICE_TYPE_ALL) { $result = []; if (!\Bitrix\Main\Loader::includeModule('ui')) { return $result; } foreach (self::getConfig() as $config) { $tour = self::getTour($config, $type); if (!$tour || !$tour->isAvailable()) { continue; } $result[] = $tour->getId(); } return $result; } public static function read($id) { $tour = self::getTourById($id); if (!$tour || !$tour->isAvailable()) { return false; } $userId = Common::getUserId(); $tour->setViewDate($userId); if (\Bitrix\Main\Loader::includeModule('pull')) { \Bitrix\Pull\Event::add($userId, [ 'module_id' => 'im', 'command' => 'promotionRead', 'params' => ['id' => $id], 'extra' => \Bitrix\Im\Common::getPullExtra() ]); } return true; } public static function getDeviceTypes() { return [ self::DEVICE_TYPE_ALL, self::DEVICE_TYPE_WEB, self::DEVICE_TYPE_BROWSER, self::DEVICE_TYPE_DESKTOP, self::DEVICE_TYPE_MOBILE, ]; } private static function getTour($config, $type = self::DEVICE_TYPE_ALL) { if (!\Bitrix\Main\Loader::includeModule('ui')) { return null; } if ($type === self::DEVICE_TYPE_WEB) { if (!( $config['DEVICE_TYPE'] === self::DEVICE_TYPE_ALL || $config['DEVICE_TYPE'] === self::DEVICE_TYPE_BROWSER || $config['DEVICE_TYPE'] === self::DEVICE_TYPE_DESKTOP )) { return false; } } else if ($type === self::DEVICE_TYPE_MOBILE) { if ( $config['DEVICE_TYPE'] !== self::DEVICE_TYPE_MOBILE && $config['DEVICE_TYPE'] !== self::DEVICE_TYPE_ALL ) { return false; } } else if ($type !== self::DEVICE_TYPE_ALL) { if ( $config['DEVICE_TYPE'] !== self::DEVICE_TYPE_ALL && $config['DEVICE_TYPE'] !== self::DEVICE_TYPE_WEB && $config['DEVICE_TYPE'] !== $type ) { return false; } } $tour = new \Bitrix\Main\UI\Tour($config["ID"]); $params = array( "USER_TYPE" => "setUserType", "USER_TIMESPAN" => "setUserTimeSpan", "LIFETIME" => "setLifetime", "START_DATE" => "setStartDate", "END_DATE" => "setEndDate", ); foreach ($params as $param => $setter) { if (isset($config[$param])) { $tour->$setter($config[$param]); } } return $tour; } private static function getTourById($id) { foreach (self::getConfig() as $config) { if ($config['ID'] === $id) { return self::getTour($config); } } return null; } }
/var/www/axolotl/data/www/b24.axolotl.ru/./public_html/bitrix/modules/im/lib/promotion.php