Modul:PageUtil: Unterschied zwischen den Versionen
2015-03-11
K (Schützte „Modul:PageUtil“: Häufig eingebundenes Modul: gem. Spezial:Diff/137172234 ([Bearbeiten=Nur angemeldete, nicht neue Benutzer] (unbeschränkt) [Verschieben=Nur Administratoren] (unbeschränkt))) |
(2015-03-11) |
||
Zeile 1: | Zeile 1: | ||
--[=[ | --[=[ 2015-03-11 | ||
PageUtil | PageUtil | ||
* merge() | * merge() | ||
Zeile 96: | Zeile 96: | ||
local page = mw.title.new( access ) | local page = mw.title.new( access ) | ||
local r | local r | ||
if page.exists then | if page then | ||
if page.exists then | |||
local source = page.prefixedText | |||
local segment = string.format( "PageUtilMerge-%d", alias ) | |||
local seed | |||
if page.namespace == 0 then | |||
seed = ":" .. source | |||
else | |||
seed = source | |||
end | |||
r = frame:expandTemplate( { title = seed } ) | |||
r = string.format( "<span id='%s'></span>\n%s", segment, r ) | |||
table.insert( assembly, { source, segment } ) | |||
else | else | ||
r = string.format( "<div class=\"error\">%s</div>", | |||
page.prefixedText ) | |||
end | end | ||
else | else | ||
r = string.format( "<div class=\"error\">%s</div>", | r = string.format( "<div class=\"error\">%s '%s'</div>", | ||
page | "Unknown page", access ) | ||
end | end | ||
return r | return r |