xoops_version.php - Modul-Manifest
Überblick
Abschnitt betitelt „Überblick“Die Datei xoops_version.php ist das Herzstück jedes XOOPS-Moduls. Sie definiert Modul-Metadaten, Datenbanktabellen, Templates, Blöcke, Konfigurationsoptionen und Installations-Hooks.
Grundstruktur
Abschnitt betitelt „Grundstruktur“<?php/** * Modul-Manifest-Datei */
$modversion = [ // Modul-Identität 'name' => _MI_MYMODULE_NAME, 'version' => '1.0.0', 'description' => _MI_MYMODULE_DESC, 'author' => 'Your Name', 'author_mail' => 'your@email.com', 'author_website' => 'https://yoursite.com', 'credits' => 'Contributors', 'license' => 'GPL 2.0 or later', 'license_url' => 'https://www.gnu.org/licenses/gpl-2.0.html', 'dirname' => basename(__DIR__),
// Bilder 'image' => 'assets/images/logo.png', 'modicons16' => 'assets/images/icons/16', 'modicons32' => 'assets/images/icons/32',
// System-Einstellungen 'system_menu' => 1, 'hasAdmin' => 1, 'adminindex' => 'admin/index.php', 'adminmenu' => 'admin/menu.php', 'hasMain' => 1, 'hasSearch' => 1, 'hasComments' => 0, 'hasNotification'=> 0,];Vollständige Referenz
Abschnitt betitelt „Vollständige Referenz“Modul-Identität
Abschnitt betitelt „Modul-Identität“| Schlüssel | Typ | Beschreibung |
|---|---|---|
name | string | Anzeigename (Sprachkonstante verwenden) |
version | string | Semantische Version (MAJOR.MINOR.PATCH) |
description | string | Modul-Beschreibung |
author | string | Primär-Autorenname |
credits | string | Zusätzliche Mitwirkende |
license | string | Lizenzname |
dirname | string | Modul-Verzeichnisname |
Datenbanktabellen
Abschnitt betitelt „Datenbanktabellen“$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
$modversion['tables'] = [ 'mymodule_items', 'mymodule_categories', 'mymodule_comments',];Templates
Abschnitt betitelt „Templates“$modversion['templates'] = [ ['file' => 'mymodule_index.tpl', 'description' => 'Index page template'], ['file' => 'mymodule_item.tpl', 'description' => 'Single item view'], ['file' => 'mymodule_category.tpl', 'description' => 'Category listing'],];$modversion['blocks'][] = [ 'file' => 'blocks/recent.php', 'name' => _MI_MYMODULE_BLOCK_RECENT, 'description' => _MI_MYMODULE_BLOCK_RECENT_DESC, 'show_func' => 'mymodule_recent_show', 'edit_func' => 'mymodule_recent_edit', 'template' => 'mymodule_block_recent.tpl', 'options' => '10|0', // Standardoptionen 'can_clone' => true,];Konfigurationsoptionen
Abschnitt betitelt „Konfigurationsoptionen“$modversion['config'][] = [ 'name' => 'items_per_page', 'title' => '_MI_MYMODULE_ITEMS_PER_PAGE', 'description' => '_MI_MYMODULE_ITEMS_PER_PAGE_DESC', 'formtype' => 'textbox', 'valuetype' => 'int', 'default' => 10,];
$modversion['config'][] = [ 'name' => 'enable_comments', 'title' => '_MI_MYMODULE_ENABLE_COMMENTS', 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1,];
$modversion['config'][] = [ 'name' => 'display_mode', 'title' => '_MI_MYMODULE_DISPLAY_MODE', 'description' => '', 'formtype' => 'select', 'valuetype' => 'text', 'default' => 'list', 'options' => [ _MI_MYMODULE_MODE_LIST => 'list', _MI_MYMODULE_MODE_GRID => 'grid', ],];Formulartypen
Abschnitt betitelt „Formulartypen“| formtype | valuetype | Beschreibung |
|---|---|---|
textbox | text/int | Einzeiliger Input |
textarea | text | Mehrzeiliger Input |
yesno | int | Ja/Nein Radio |
select | text | Dropdown-Select |
select_multi | array | Multi-Select |
group | int | Gruppen-Selector |
group_multi | array | Multi-Gruppen-Selector |
user | int | Benutzer-Selector |
color | text | Farbwähler |
hidden | text | Verstecktes Feld |
Menüelemente
Abschnitt betitelt „Menüelemente“// Haupt-Menü$modversion['sub'][] = [ 'name' => _MI_MYMODULE_SMENU_INDEX, 'url' => 'index.php',];
$modversion['sub'][] = [ 'name' => _MI_MYMODULE_SMENU_SUBMIT, 'url' => 'submit.php',];Installations-Hooks
Abschnitt betitelt „Installations-Hooks“$modversion['onInstall'] = 'include/oninstall.php';$modversion['onUpdate'] = 'include/onupdate.php';$modversion['onUninstall'] = 'include/onuninstall.php';Suchintegration
Abschnitt betitelt „Suchintegration“$modversion['hasSearch'] = 1;$modversion['search'] = [ 'file' => 'include/search.php', 'func' => 'mymodule_search',];Kommentarintegration
Abschnitt betitelt „Kommentarintegration“$modversion['hasComments'] = 1;$modversion['comments'] = [ 'itemName' => 'item_id', 'pageName' => 'item.php',];Benachrichtigungen
Abschnitt betitelt „Benachrichtigungen“$modversion['hasNotification'] = 1;$modversion['notification'] = [ 'lookup_file' => 'include/notification.php', 'lookup_func' => 'mymodule_notify_iteminfo', 'category' => [ [ 'name' => 'global', 'title' => _MI_MYMODULE_NOTIFY_GLOBAL, 'description' => '', 'subscribe_from' => 'index.php', ], [ 'name' => 'item', 'title' => _MI_MYMODULE_NOTIFY_ITEM, 'description' => '', 'subscribe_from' => 'item.php', 'item_name' => 'item_id', ], ], 'event' => [ [ 'name' => 'new_item', 'category' => 'global', 'title' => _MI_MYMODULE_NOTIFY_NEW_ITEM, 'caption' => _MI_MYMODULE_NOTIFY_NEW_ITEM_CAP, 'mail_template' => 'notify_newitem', 'mail_subject' => _MI_MYMODULE_NOTIFY_NEW_ITEM_SUBJ, ], ],];Verwandte Dokumentation
Abschnitt betitelt „Verwandte Dokumentation“- Module-Development - Vollständiger Modul-Leitfaden
- Module-Structure - Verzeichnisstruktur
- Block-Development - Erstellen von Blöcken
- Database-Operations - Datenbanksetup