Module:Message box: Difference between revisions

Jump to navigation Jump to search
on second thoughts, I like this way of passing params to category handler better
m (fix brackets)
(on second thoughts, I like this way of passing params to category handler better)
Line 128:
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
 
Line 383:
 
-- 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 {}),
Line 396 ⟶ 388:
all = tconcat(self.allCats or {}),
nocat = args.nocat,
demospace = chdemospaceself.demospace,
page = chpageself.pageTitle and pageTitle.prefixedText or nil
}
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu