Changes

Jump to: navigation, search

Module:Message box

198 bytes removed, 00:31, 28 September 2013
on second thoughts, I like this way of passing params to category handler better
function box:setTitle(args)
-- Get the title object and the namespace.
local self.pageTitle = getTitleObject(args.page ~= '' and args.page) self.title = self.pageTitle or mw.title.getCurrentTitle() local self.demospace = box.getNamespaceId(args.demospace ~= '' and args.demospace)or nil self.nsid = box.getNamespaceId(self.demospace ) or self.title.namespace
end
-- Convert category tables to strings and pass them through [[Module:Category handler]].
local chpage, chdemospace
local currentTitle = mw.title.getCurrentTitle()
if self.title ~= currentTitle then
chpage = self.title.prefixedText
end
if self.nsid ~= currentTitle.namespace then
chdemospace = self.nsid
end
self.categories = categoryHandler{
main = tconcat(self.mainCats or {}),
all = tconcat(self.allCats or {}),
nocat = args.nocat,
demospace = chdemospaceself.demospace, page = chpageself.pageTitle and pageTitle.prefixedText or nil
}
end
Anonymous user

Navigation menu