Module:Category handler: Difference between revisions
Content added Content deleted
(add support for "categories=no" and "category2=¬") |
(better fallback behaviour if we are over the expensive function count) |
||
Line 103: | Line 103: | ||
---------------------------------------------------------------------- |
---------------------------------------------------------------------- |
||
-- Get |
-- Get [[Module:Namespace detect]] and declare the table of functions |
||
-- return. |
-- that we will return. |
||
local NamespaceDetect = require('Module:Namespace detect') |
local NamespaceDetect = require('Module:Namespace detect') |
||
local p = {} |
local p = {} |
||
Line 116: | Line 116: | ||
-- Find whether we need to return a category or not. |
-- Find whether we need to return a category or not. |
||
local function needsCategory( pageObject, args ) |
local function needsCategory( pageObject, args ) |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
if args[cfg.nocat] == cfg.nocatTrue |
if args[cfg.nocat] == cfg.nocatTrue |
||
or args[cfg.categories] == cfg.categoriesNo |
or args[cfg.categories] == cfg.categoriesNo |
||
Line 129: | Line 122: | ||
and args[cfg.category2] ~= cfg.category2Yes |
and args[cfg.category2] ~= cfg.category2Yes |
||
and args[cfg.category2] ~= cfg.category2Negative ) |
and args[cfg.category2] ~= cfg.category2Negative ) |
||
⚫ | |||
⚫ | |||
return false |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
-- of the old template was to assume the page was not a subpage, so we will do |
|||
-- the same here. |
|||
⚫ | |||
return false |
|||
⚫ | |||
if args[cfg.subpage] == cfg.subpageOnly |
|||
⚫ | |||
return false |
return false |
||
⚫ | |||
⚫ | |||
end |
end |
||
⚫ | |||
end |
end |
||