Module:Citation/CS1/Utilities: Difference between revisions

    m>Trappist the monk
    No edit summary
    m>Trappist the monk
    No edit summary
    Line 10: Line 10:


    local cfg = mw.loadData ('Module:Citation/CS1/Configuration/sandbox');
    local cfg = mw.loadData ('Module:Citation/CS1/Configuration/sandbox');
    --[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
    Adds a category to z.maintenance_cats using names from the configuration file with additional text if any.
    To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maintenance_cats.
    ]]
    local added_maint_cats = {} -- list of maintenance categories that have been added to z.maintenance_cats
    local function add_maint_cat (key, arguments)
    if not added_maint_cats [key] then
    added_maint_cats [key] = true; -- note that we've added this category
    table.insert( z.maintenance_cats, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
    end
    end


    --[[--------------------------< I S _ S E T >------------------------------------------------------------------
    --[[--------------------------< I S _ S E T >------------------------------------------------------------------
    Line 213: Line 197:
    return value, selected;
    return value, selected;
    end
    --[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
    Adds a category to z.maintenance_cats using names from the configuration file with additional text if any.
    To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maintenance_cats.
    ]]
    local added_maint_cats = {} -- list of maintenance categories that have been added to z.maintenance_cats
    local function add_maint_cat (key, arguments)
    if not added_maint_cats [key] then
    added_maint_cats [key] = true; -- note that we've added this category
    table.insert( z.maintenance_cats, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
    end
    end
    end