This commit is contained in:
2023-04-13 17:50:50 +03:00
parent 4c78e1c77a
commit 31fe238dbf
2 changed files with 13 additions and 15 deletions
+9 -9
View File
@@ -6,7 +6,7 @@ IncludeModuleLangFile(__FILE__);
class bx_null extends \CModule class bx_null extends \CModule
{ {
public $sys = []; public $module = [];
var $MODULE_GROUP_RIGHTS = 'Y'; var $MODULE_GROUP_RIGHTS = 'Y';
function __construct() function __construct()
@@ -16,18 +16,18 @@ class bx_null extends \CModule
$module = json_decode(file_get_contents(__DIR__.'/../.module.json'), true); $module = json_decode(file_get_contents(__DIR__.'/../.module.json'), true);
} }
$this->sys = $module; $this->module = $module;
$this->MODULE_ID = $module['id']; $this->MODULE_ID = $module['id'];
$this->MODULE_VERSION = $module['version']; $this->MODULE_VERSION = $module['version'];
$this->MODULE_VERSION_DATE = $module['date']; $this->MODULE_VERSION_DATE = $module['date'];
$langPrefix = strtoupper($module['prefix']); $langPrefix = $module['prefix'];
$this->PARTNER_NAME = GetMessage("{$langPrefix}_PARTNER_NAME"); $this->PARTNER_NAME = GetMessage("{$langPrefix}_partner_name");
$this->PARTNER_URI = GetMessage("{$langPrefix}_PARTNER_URI"); $this->PARTNER_URI = GetMessage("{$langPrefix}_partner_uri");
$this->MODULE_NAME = GetMessage("{$langPrefix}_MODULE_NAME"); $this->MODULE_NAME = GetMessage("{$langPrefix}_module_name");
$this->MODULE_DESCRIPTION = GetMessage("{$langPrefix}_MODULE_DESCRIPTION"); $this->MODULE_DESCRIPTION = GetMessage("{$langPrefix}_module_description");
} }
@@ -35,8 +35,8 @@ class bx_null extends \CModule
{ {
global $DOCUMENT_ROOT, $APPLICATION; global $DOCUMENT_ROOT, $APPLICATION;
if(is_array($this->sys['deps'])){ if(is_array($this->module['deps'])){
foreach ($this->sys['deps'] as $moduleId){ foreach ($this->module['deps'] as $moduleId){
if (!\Bitrix\Main\Loader::includeModule($moduleId)) { if (!\Bitrix\Main\Loader::includeModule($moduleId)) {
$APPLICATION->ThrowException("Module {$moduleId} not installed!"); $APPLICATION->ThrowException("Module {$moduleId} not installed!");
return false; return false;
+4 -6
View File
@@ -1,7 +1,5 @@
<? <?
$MESS ['BX_NULL_PARTNER_NAME'] = "CoreLion"; $MESS ['bx_null_partner_name'] = "CoreLion";
$MESS ['BX_NULL_PARTNER_URI'] = "https://corelion.ru/"; $MESS ['bx_null_partner_uri'] = "https://corelion.ru/";
$MESS ['BX_NULL_MODULE_NAME'] = "Создание CML"; $MESS ['bx_null_module_name'] = "Bx: Null";
$MESS ['BX_NULL_MODULE_DESCRIPTION'] = "Работа с форматом CML"; $MESS ['bx_null_module_description'] = "Null module";
$MESS ['BX_NULL_INSTALL_MODULE'] = "Установка модуля";
$MESS ['BX_NULL_DELETE_MODULE'] = "Деинсталляция модуля";