/
mikopbx
/
ModuleDutchLanguagePack
Обзор
Документация
Войти
/
mikopbx
/
ModuleDutchLanguagePack
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
Setup/PbxExtensionSetup.php
126 строк
4 KB
Nikolay Beketov
chore: update copyright year to 2026
07 апр 2026, 17:10
07 апр 2026, 17:10
fb085a7
Код
Авторство
О чём код?
<?php declare(strict_types=1); /* * MikoPBX - free phone system for small business * Copyright © 2017-2026 Alexey Portnov and Nikolay Beketov * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program. * If not, see <https://www.gnu.org/licenses/>. */ namespace Modules\ModuleDutchLanguagePack\Setup; use MikoPBX\Core\System\SystemMessages; use MikoPBX\Modules\PbxExtensionUtils; use MikoPBX\Modules\Setup\PbxExtensionSetupBase; /** * PbxExtensionSetup * * Setup class for Dutch Language Pack Module * * This Language Pack module provides automatic installation of: * - Dutch UI translations from Messages/nl/ directory * - Dutch voice prompts from Sounds/nl-nl/ directory * * The base class handles all installation/uninstallation automatically: * - Sound files are installed via SoundFilesConf::installModuleSounds() * - Translations are loaded via MessagesProvider::loadModuleTranslations() * - No additional logic is required for Language Pack modules * * @package Modules\ModuleDutchLanguagePack\Setup */ class PbxExtensionSetup extends PbxExtensionSetupBase { /** * Module unique identifier */ protected string $moduleUniqueID = 'ModuleDutchLanguagePack'; /** * Additional actions before module installation * * For Language Pack modules, we check for conflicts with other Dutch packs. * Only one Language Pack per language is allowed. * * @return bool True if installation can proceed */ public function onBeforeModuleEnable(): bool { // Check for Language Pack conflicts $conflictModule = PbxExtensionUtils::checkLanguagePackConflict( $this->moduleUniqueID, 'nl-nl' ); if ($conflictModule !== null) { $this->messages[] = "Cannot install: Another Dutch Language Pack ($conflictModule) is already installed. Please uninstall it first."; return false; } return parent::onBeforeModuleEnable(); } /** * Additional actions after module installation * * @return bool True if successful */ public function onAfterModuleEnable(): bool { // Log successful installation SystemMessages::sysLogMsg( __CLASS__, 'Dutch Language Pack installed successfully (16 translation files, 642 sound files)', LOG_INFO ); return parent::onAfterModuleEnable(); } /** * Additional actions before module uninstallation * * @return bool True if uninstallation can proceed */ public function onBeforeModuleDisable(): bool { // Log uninstallation SystemMessages::sysLogMsg( __CLASS__, 'Uninstalling Dutch Language Pack', LOG_INFO ); return parent::onBeforeModuleDisable(); } /** * Additional actions after module uninstallation * * @return bool True if successful */ public function onAfterModuleDisable(): bool { // Log successful uninstallation SystemMessages::sysLogMsg( __CLASS__, 'Dutch Language Pack uninstalled successfully', LOG_INFO ); return parent::onAfterModuleDisable(); } }