Module:AFC submission catcheck
Revision as of 04:51, 20 April 2014 by blackwiki>Courcelles (Changed protection level of Module:AFC submission catcheck: Per RFPP request, "mother" template only template protected now ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
| 40x40px | This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This module is used by Template:AFC submission and its subtemplates to scan the content of AFC submissions. It's used to allow finding of drafts in improper content categories as well as to suppress the message that a draft has not been submitted when in fact it has been.
local i = {}
function i.checkforcats(frame)
local t = mw.title.getCurrentTitle()
tc = t:getContent()
if tc == nil then
return ""
end
tc = mw.ustring.gsub(tc,"%[%[Category:Articles created via the Article Wizard%]%]","")
tc = mw.ustring.gsub(tc,"<!--.--->","")
tc = mw.ustring.gsub(tc,"<nowiki>.-</nowiki>","")
if mw.ustring.match(tc, "%[%[%s-[Cc]ategory:" ) == nil then
return ""
else
return "[[Category:AfC submissions with categories]]"
end
end
return i