FANDOM


local p = {}
 
 
 
function makeLinkText(reviewerName,altLink,userOrGroup)
    local linkText = ""
    if (reviewerName == nil) then
        linkText = "unknown"
        else
    linkText = "[["
    if (altLink) then
        linkText = linkText .. altLink
    else
        local isUser = nil
        if not (userOrGroup == nil) then
            if (userOrGroup == "user") then
                isUser = "true"
            else 
                if (userOrGroup == "group") then
                    isUser = "false"
                end
            end
 
        end
        if (isUser == nil) then
            local userSpaceLink = "User:" .. reviewerName
            if mw.title.new(userSpaceLink) then
                isUser = "true"
            else
                isUser = "false"
            end
 
        end
 
        local newLink = ""
         if (isUser == "true") then
             newLink = "User:" .. reviewerName
         else
             newLink = reviewerName
         end
        linkText = linkText .. newLink
    end
    linkText = linkText .. "|" .. reviewerName .. "]]"
    end
    return linkText
end
 
function p.MakeCategories( frame )
    local tArgs = frame:getParent()
 
	if not(tArgs.args[1]) then
		tArgs = frame
	end
 
	local reviewerName = tArgs.args[1] or tArgs.args["reviewerName"]
 
	local wikitextOut = ""
	if not (tArgs.args["suppressCategories"]) then
	    wikitextOut = wikitextOut .. "[[Category:articles under review]]"
	    if (reviewerName) then
	        local reviewCat = "[[Category:articles under review by "
	       reviewCat = reviewCat .. reviewerName
	       reviewCat = reviewCat .. "]]"
	        wikitextOut = wikitextOut .. reviewCat
	    end
    end
    return wikitextOut
end
 
function p.main( frame )
    local tArgs = frame:getParent()
 
	if not(tArgs.args[1]) then
		tArgs = frame
	end
 
	local reviewerName = tArgs.args[1] or tArgs.args["reviewerName"]
	local altLink = tArgs.args[2] or tArgs.args["altLink"]
	local userOrGroup = tArgs.args["userOrGroup"]
 
	local displayText = "''This article is under review by "
	displayText = displayText .. makeLinkText(reviewerName,altLink,userOrGroup)
	displayText = displayText .. "''"
    local wikitextOut = displayText
    return wikitextOut
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.