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.

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,
    
    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,

    sections = {
        {
            champs = {
                { cle = 'type', label = 'Type', 
                  process = function(value, args)
                    local types = {
                        ['économie'] = 'Économie',
                        ['pvp'] = 'PvP', 
                        ['roleplay'] = 'Roleplay',
                        ['administration'] = 'Administration',
                        ['protection'] = 'Protection',
                        ['cosmétique'] = 'Cosmétique',
                        ['communication'] = 'Communication',
                        ['utilitaire'] = 'Utilitaire',
                        ['mini-jeu'] = 'Mini-jeu',
                        ['monde'] = 'Monde',
                        ['inventaire'] = 'Inventaire',
                        ['transport'] = 'Transport',
                        ['magie'] = 'Magie',
                        ['mob'] = 'Mob'
                    }
                    return types[value] or value
                  end
                },
                { cle = 'dev', label = 'Développeur' },
                { cle = 'status', label = 'Statut' },
                { cle = 'grade', label = 'Grade requis' }
            }
        },
        {
            titre = 'Téléchargements',
            champs = {
                { cle = 'bukkit', label = 'Bukkit',
                  process = function(value) 
                    return value and '[https://dev.bukkit.org/projects/' .. value .. ' Bukkit]' or nil 
                  end
                },
                { cle = 'hangar', label = 'Hangar (PaperMC)',
                  process = function(value) 
                    return value and '[https://hangar.papermc.io/projects/' .. value .. ' Hangar]' or nil 
                  end
                },
                { cle = 'modrinth', label = 'Modrinth',
                  process = function(value) 
                    return value and '[https://modrinth.com/plugin/' .. value .. ' Modrinth]' or nil 
                  end
                },
                { cle = 'builtbybit', label = 'BuiltByBit',
                  process = function(value) 
                    return value and '[https://builtbybit.com/resources/' .. value .. ' BuiltByBit]' or nil 
                  end
                },
                { cle = 'spigot', label = 'Spigot',
                  process = function(value) 
                    return value and '[https://www.spigotmc.org/resources/' .. value .. ' Spigot]' or nil 
                  end
                },
                { cle = 'sources', label = 'Code source' }
            }
        },
        {
            titre = 'Compatibilité',
            champs = {
                { cle = 'dépendance', label = 'Dépendances' },
                { cle = 'compatibilité', label = 'Compatible avec' }
            }
        }
    },

    -- Ajout des catégories automatiques selon le type
    categories = function(args, config, frame)
        local cats = {}
        
        -- Catégorie générale
        table.insert(cats, 'Plugins Minecraft')
        
        -- Catégorie selon le type
        if args.type then
            local typeCategories = {
                ['économie'] = 'Plugins d\'économie',
                ['pvp'] = 'Plugins de PvP',
                ['roleplay'] = 'Plugins de roleplay',
                ['administration'] = 'Plugins d\'administration',
                ['protection'] = 'Plugins de protection',
                ['cosmétique'] = 'Plugins cosmétiques',
                ['communication'] = 'Plugins de communication',
                ['utilitaire'] = 'Plugins utilitaires',
                ['mini-jeu'] = 'Plugins de mini-jeux',
                ['monde'] = 'Plugins de monde',
                ['inventaire'] = 'Plugins d\'inventaire',
                ['transport'] = 'Plugins de transport',
                ['magie'] = 'Plugins de magie',
                ['mob'] = 'Plugins de mobs'
            }
            if typeCategories[args.type] then
                table.insert(cats, typeCategories[args.type])
            end
        end
        
        return cats
    end
}

return config