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/modules/acrit.import/lib/ |
Upload File : |
<?php namespace Acrit\Import; use Bitrix\Main\Config\Option; class Helper { /** * Check updates */ public static function checkModuleUpdates($strModuleID, &$intDateTo){ $arAvailableUpdates = array(); include_once($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/main/classes/general/update_client_partner.php'); if(class_exists('\CUpdateClientPartner')) { $arUpdateList = \CUpdateClientPartner::GetUpdatesList($errorMessage, LANGUAGE_ID, 'Y', array(), array('fullmoduleinfo' => 'Y')); if(is_array($arUpdateList) && is_array($arUpdateList['MODULE'])){ foreach($arUpdateList['MODULE'] as $arModuleData){ if($arModuleData['@']['ID'] == $strModuleID){ if(preg_match('#^(\d{1,2})\.(\d{1,2})\.(\d{4})$#', $arModuleData['@']['DATE_TO'], $arMatch)){ $intDateTo = mktime(23, 59, 59, $arMatch[2], $arMatch[1], $arMatch[3]); } if(is_array($arModuleData['#']) && is_array($arModuleData['#']['VERSION'])){ foreach($arModuleData['#']['VERSION'] as $arVersion){ $arAvailableUpdates[$arVersion['@']['ID']] = $arVersion['#']['DESCRIPTION'][0]['#']; } } } } } } return $arAvailableUpdates; } /** * Show success */ public static function showSuccess($strMessage=null, $strDetails=null) { ob_start(); \CAdminMessage::ShowMessage(array( 'MESSAGE' => $strMessage, 'DETAILS' => $strDetails, 'HTML' => true, 'TYPE' => 'OK', )); return ob_get_clean(); } /** * Show note */ public static function showNote($strNote, $bCompact=false, $bCenter=false, $bReturn=false) { if($bReturn){ ob_start(); } $arClass = array(); if($bCompact){ $arClass[] = 'acrit-exp-note-compact'; } if($bCenter){ $arClass[] = 'acrit-exp-note-center'; } print '<div class="'.implode(' ', $arClass).'">'; print BeginNote(); print $strNote; print EndNote(); print '</div>'; if($bReturn){ return ob_get_clean(); } } }