Modul:LinkISBN: Unterschied zwischen den Versionen

K
+yesno
KKeine Bearbeitungszusammenfassung
K (+yesno)
Zeile 2: Zeile 2:


local ci = require( 'Modul:Check_isxn' )
local ci = require( 'Modul:Check_isxn' )
local yn = require( 'Modul:Yesno' )


li.invalid = '&nbsp;<span class="error">Ungültige ISBN</span>[[Kategorie:Seiten mit ISBN-Fehlern]]'
li.invalid = '&nbsp;<span class="error">Ungültige ISBN</span>[[Kategorie:Seiten mit ISBN-Fehlern]]'
Zeile 37: Zeile 38:


function li.linkISBNSet( args )
function li.linkISBNSet( args )
args['isbn'] = args['isbn'] or args[1] or ''
args.isbn   = args.isbn or args[1] or ''
args['noerror'] = args['noerror'] or ''
args.noerror = args.noerror or ''
if (args['noerror'] == 'j') or (args['noerror'] == 'y') then args['noerror'] = true
args.noerror = yn( args.noerror, false )
else args['noerror'] = false end
args.demo   = args.demo or ''
args['demo'] = args['demo'] or ''


local s
local s
Zeile 54: Zeile 54:
-- split seperate ISBNs and analyse them
-- split seperate ISBNs and analyse them
for s in mw.ustring.gmatch( args.isbn .. ',', '([^,]+)' ) do
for s in mw.ustring.gmatch( args.isbn .. ',', '([^,]+)' ) do
s = li.linkISBN( s, args['noerror'], args['demo'] )
s = li.linkISBN( s, args.noerror, args.demo )
if s ~= '' then
if s ~= '' then
if result == '' then result = s
if result == '' then result = s
Anonymer Benutzer