xoops_version.php - Module Manifest
Pregled
Section titled “Pregled”Datoteka xoops_version.php je srce vsakega modula XOOPS. Definira metapodatke modulov, tabele baz podatkov, predloge, bloke, konfiguracijske možnosti in namestitvene kljuke.
Osnovna struktura
Section titled “Osnovna struktura”<?php/** * Module manifest file */
$modversion = [ // Module identity '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__),
// Images 'image' => 'assets/images/logo.png', 'modicons16' => 'assets/images/icons/16', 'modicons32' => 'assets/images/icons/32',
// System settings 'system_menu' => 1, 'hasAdmin' => 1, 'adminindex' => 'admin/index.php', 'adminmenu' => 'admin/menu.php', 'hasMain' => 1, 'hasSearch' => 1, 'hasComments' => 0, 'hasNotification'=> 0,];Popolna referenca
Section titled “Popolna referenca”Identiteta modula
Section titled “Identiteta modula”| Ključ | Vrsta | Opis |
|---|---|---|
name | niz | Prikazno ime (uporabite jezikovno konstanto) |
version | niz | Semantična različica (MAJOR.MINOR.PATCH) |
description | niz | Opis modula |
author | niz | Ime primarnega avtorja |
credits | niz | Dodatni sodelavci |
license | niz | Ime licence |
dirname | niz | Ime imenika modula |
Tabele baze podatkov
Section titled “Tabele baze podatkov”$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
$modversion['tables'] = [ 'mymodule_items', 'mymodule_categories', 'mymodule_comments',];Predloge
Section titled “Predloge”$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', // default options 'can_clone' => true,];Možnosti konfiguracije
Section titled “Možnosti konfiguracije”$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', ],];Vrste obrazcev
Section titled “Vrste obrazcev”| vrsta oblike | vrsta vrednosti | Opis |
|---|---|---|
textbox | text/int | Enovrstični vnos |
textarea | text | Večvrstični vnos |
yesno | int | Yes/No radio |
select | text | Spustni meni izberite |
select_multi | array | Večkratna izbira |
group | int | Izbirnik skupine |
group_multi | array | Izbirnik več skupin |
user | int | Izbirnik uporabnika |
color | text | Izbirnik barv |
hidden | text | Skrito polje |
Elementi menija
Section titled “Elementi menija”// Main menu$modversion['sub'][] = [ 'name' => _MI_MYMODULE_SMENU_INDEX, 'url' => 'index.php',];
$modversion['sub'][] = [ 'name' => _MI_MYMODULE_SMENU_SUBMIT, 'url' => 'submit.php',];Kavlji za namestitev
Section titled “Kavlji za namestitev”$modversion['onInstall'] = 'include/oninstall.php';$modversion['onUpdate'] = 'include/onupdate.php';$modversion['onUninstall'] = 'include/onuninstall.php';Integracija iskanja
Section titled “Integracija iskanja”$modversion['hasSearch'] = 1;$modversion['search'] = [ 'file' => 'include/search.php', 'func' => 'mymodule_search',];Integracija komentarjev
Section titled “Integracija komentarjev”$modversion['hasComments'] = 1;$modversion['comments'] = [ 'itemName' => 'item_id', 'pageName' => 'item.php',];Obvestila
Section titled “Obvestila”$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, ], ],];Povezana dokumentacija
Section titled “Povezana dokumentacija”- Razvoj modula - Celoten vodnik po modulu
- Struktura modula - Struktura imenika
- Block-Development - Ustvarjanje blokov
- Database-Operations - Nastavitev baze podatkov