Basculer le menu
Changer de menu des préférences
Basculer le menu personnel
Non connecté(e)
Votre adresse IP sera visible au public si vous faites des modifications.
Version datée du 1 octobre 2025 à 12:40 par Hiob (discussion | contributions) (init)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

La documentation pour ce module peut être créée à Module:Infobox/Configs/Plugin/doc

local config = {
    titre = function(args) 
        return args.nom or '{{PAGENAME}}' 
    end,
    
    -- Icône avec type et nom pour les plugins
    icone = {
        type = 'fas',
        nom = 'puzzle-piece'
    },
    
    image = function(args) 
        if args.image then
            return {
                nom = args.image,
                taille = args.tailleimage or "280x200px",
                legende = args.legende or args.nom or '{{PAGENAME}}'
            }
        end
        return nil
    end,

    -- Configuration du champ "type" avec validation et catégorisation
    typeField = {
        required = true, -- Le type est obligatoire pour les plugins
        allowedValues = {
            ['économie'] = {
                display = 'Économie',
                category = 'Plugins d\'économie'
            },
            ['pvp'] = {
                display = 'PvP',
                category = 'Plugins de PvP'
            },
            ['roleplay'] = {
                display = 'Roleplay',
                category = 'Plugins de roleplay'
            },
            ['administration'] = {
                display = 'Administration',
                category = 'Plugins d\'administration'
            },
            ['protection'] = {
                display = 'Protection',
                category = 'Plugins de protection'
            },
            ['cosmétique'] = {
                display = 'Cosmétique',
                category = 'Plugins cosmétiques'
            },
            ['communication'] = {
                display = 'Communication',
                category = 'Plugins de communication'
            },
            ['utilitaire'] = {
                display = 'Utilitaire',
                category = 'Plugins utilitaires'
            },
            ['mini-jeu'] = {
                display = 'Mini-jeu',
                category = 'Plugins de mini-jeux'
            },
            ['monde'] = {
                display = 'Monde',
                category = 'Plugins de monde'
            },
            ['inventaire'] = {
                display = 'Inventaire',
                category = 'Plugins d\'inventaire'
            },
            ['transport'] = {
                display = 'Transport',
                category = 'Plugins de transport'
            },
            ['magie'] = {
                display = 'Magie',
                category = 'Plugins de magie'
            },
            ['mob'] = {
                display = 'Mob',
                category = 'Plugins de mobs'
            },
            ['craft'] = {
                display = 'Craft',
                category = 'Plugins de craft'
            }
        },
        errorMessage = 'Type de plugin non reconnu. Types autorisés : économie, pvp, roleplay, administration, protection, cosmétique, communication, utilitaire, mini-jeu, monde, inventaire, transport, magie, mob, craft'
    },

    -- Configuration du champ "status" avec validation et catégorisation
    statusField = {
        required = true, -- Le status est obligatoire
        allowedValues = {
            ['installé'] = {
                display = 'Installé',
                category = 'Plugin installé'
            },
            ['désinstallé'] = {
                display = 'Désinstallé',
                category = 'Plugin désinstallé'
            },
            ['en test'] = {
                display = 'En test',
                category = 'Plugin en test'
            },
            ['obsolète'] = {
                display = 'Obsolète',
                category = 'Plugin obsolète'
            },
            ['prévu'] = {
                display = 'Prévu',
                category = 'Plugin prévu'
            },
            ['abandonné'] = {
                display = 'Abandonné',
                category = 'Plugin abandonné'
            }
        },
        errorMessage = 'Status de plugin non reconnu. Status autorisés : installé, désinstallé, en test, obsolète, prévu, abandonné'
    },

    sections = {
        {
            titre = 'Plugin',
            champs = {
                { cle = 'type', label = 'Type', required = true },
                { cle = 'dev', label = 'Développeur(s)' },
                { cle = 'bukkit', label = 'Bukkit', format = 'bukkit_link' },
                { cle = 'hangar', label = 'Hangar', format = 'hangar_link' },
                { cle = 'modrinth', label = 'Modrinth', format = 'modrinth_link' },
                { cle = 'builtbybit', label = 'Builtbybit', format = 'builtbybit_link' },
                { cle = 'spigot', label = 'Spigot', format = 'spigot_link' },
                { cle = 'dépendance', label = 'Dépendance' },
                { cle = 'compatibilité', label = 'Compatibilité' },
                { cle = 'sources', label = 'Sources' }
            }
        },
        {
            titre = 'Nefald',
            champs = {
                { cle = 'status', label = 'Status', required = true },
                { cle = 'grade', label = 'Grade requis', format = 'grade_link' }
            }
        },
        {
            titre = 'Article',
            champs = {
                { cle = 'derniere_revision', label = 'Dernière révision', auto = 'revision_date' }
            }
        }
    },

    -- Formatters spéciaux pour les liens
    formatters = {
        bukkit_link = function(value)
            return '[https://dev.bukkit.org/projects/' .. value .. '/ ' .. value .. ']'
        end,
        hangar_link = function(value)
            return '[https://hangar.papermc.io/' .. value .. '/ ' .. value .. ']'
        end,
        modrinth_link = function(value)
            return '[https://modrinth.com/project/' .. value .. '/ ' .. value .. ']'
        end,
        builtbybit_link = function(value)
            return '[https://builtbybit.com/resources/' .. value .. '/ ' .. value .. ']'
        end,
        spigot_link = function(value)
            return '[http://www.spigotmc.org/resources/' .. value .. '/ ' .. value .. ']'
        end,
        grade_link = function(value)
            return '[[' .. value .. ']]'
        end,
        revision_date = function()
            return '{{REVISIONDAY}}/{{REVISIONMONTH}}/{{REVISIONYEAR}}'
        end
    }
}

return config