Module:Message box: Difference between revisions

Jump to navigation Jump to search
m>Mr. Stradivarius
allow small=left for ambox
m>Mr. Stradivarius
replace remaining "title" variables with "self.title"
Line 212: Line 212:
         self.name = args.name
         self.name = args.name
         local nameTitle = getTitleObject(name)
         local nameTitle = getTitleObject(name)
         self.isTemplatePage = nameTitle and title.prefixedText == ('Template:' .. nameTitle.text) and true or false
         self.isTemplatePage = nameTitle and self.title.prefixedText == ('Template:' .. nameTitle.text) and true or false


         -- Get the self.issue value.
         -- Get the self.issue value.
Line 244: Line 244:
                 -- If we couldn't process the talk page link, get the talk page of the current page.
                 -- If we couldn't process the talk page link, get the talk page of the current page.
                 local success
                 local success
                 success, talkTitle = pcall(title.talkPageTitle, title)
                 success, talkTitle = pcall(self.title.talkPageTitle, self.title)
                 if not success then
                 if not success then
                     talkTitle = nil
                     talkTitle = nil
Line 346: Line 346:


     -- Add template-namespace categories.
     -- Add template-namespace categories.
     self.isTemplatePage = type(self.name) == 'string' and title.prefixedText == ('Template:' .. self.name)
     self.isTemplatePage = type(self.name) == 'string' and self.title.prefixedText == ('Template:' .. self.name)
     if cfg.templateCategory then
     if cfg.templateCategory then
         if self.name then
         if self.name then
Line 363: Line 363:
         if not self.name and not self.title.isSubpage then
         if not self.name and not self.title.isSubpage then
             templateCat = templateErrorCategory
             templateCat = templateErrorCategory
         elseif type(self.name) == 'string' and title.prefixedText == ('Template:' .. name) then
         elseif type(self.name) == 'string' and self.title.prefixedText == ('Template:' .. name) then
             local paramsToCheck = cfg.templateErrorParamsToCheck or {}
             local paramsToCheck = cfg.templateErrorParamsToCheck or {}
             local count = 0
             local count = 0
Line 385: Line 385:
     -- Categories for all namespaces.
     -- Categories for all namespaces.
     if self.invalidType then
     if self.invalidType then
         local allSort = (nsid == 0 and 'Main:' or '') .. title.prefixedText
         local allSort = (nsid == 0 and 'Main:' or '') .. self.title.prefixedText
         self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
         self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
     end
     end