Module:Databox : Tameẓla gar ileqman

133 octets ajoutés ,  1 n wayyur aya
aucun résumé de modification
 
return false
end
 
local function isSet(var)
return not (var == nil or (type(var) == 'string' and mw.text.trim(var) == ''))
end
 
end
local lat_lon = frame:preprocess("{{GetLatLon|P625|P276|P159|item="..(itemId or '').."}}") or ''
local layer = ''nil
if has_value(properties, 'P3896') then
layer = claim({item=itemId, formatting="table", property="P3896", qualifier="P518", blacklist1= "Q94979808", rowformat = "$0", separator="###", editicon="no"}) or ''nil
end
local loc_map_image = ''nil
if has_value(properties, 'P242') then
loc_map_image = claim({item=itemId, formatting="table", property="P242", rowformat = "$0", editicon="no", list='false'}) or ''
end
local parentsloc_maps = ''nil
if isSet(lat_lon) or isSet(loc_map_image) then
dico["data"..(#data_properties+3)]loc_maps = frame:preprocess("{{Location maps|lat_lon="..(lat_lon or '').."|layer="..(layer or '').."|locator_map="..(loc_map_image or '').."}}")
end
local parents = nil
if has_value(properties, 'P131') then
parents = getParentValues({item=itemId, sorting="-1", separator="</tr>", rowformat = "<tr><td>'''$0'''</td><td>$1</td>", editicon="no"}) or ''
end
if isSet(loc_maps) or isSet(parents) then
if mw.ustring.len(mw.text.trim(lat_lon)) > 0 or mw.ustring.len(mw.text.trim(loc_map_image)) > 0 or mw.ustring.len(mw.text.trim(parents)) > 0 then
dico["header"..(#data_properties+2)] = getLabel({'Q17334923'})
dico["data"..(#data_properties+3)] = frame:preprocess("{{Location maps|lat_lon="..lat_lon.."|layer="..layer.."|locator_map="..loc_map_image.."}}")
dico["data"..(#data_properties+4)] = parents
end
dico["data"..(#data_properties+3)] = loc_maps
dico["data"..(#data_properties+4)] = parents
return infobox(dico)
17 665

modifications