http://wiki.ghostbsd.org/index.php?title=Module:Yesno&feed=atom&action=historyModule:Yesno - Revision history2024-03-29T13:59:09ZRevision history for this page on the wikiMediaWiki 1.26.3http://wiki.ghostbsd.org/index.php?title=Module:Yesno&diff=340&oldid=prevEricBSD: 1 revision imported2016-10-08T23:26:51Z<p>1 revision imported</p>
<table class='diff diff-contentalign-left'>
<tr style='vertical-align: top;' lang='en'>
<td colspan='1' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black; text-align: center;">Revision as of 23:26, 8 October 2016</td>
</tr><tr><td colspan='2' style='text-align: center;' lang='en'><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>EricBSDhttp://wiki.ghostbsd.org/index.php?title=Module:Yesno&diff=339&oldid=prevAdmin: 1 revision2013-12-15T20:54:56Z<p>1 revision</p>
<p><b>New page</b></p><div>-- Function allowing for consistent treatment of boolean-like wikitext input.<br />
-- It works similarly to the template {{yesno}}.<br />
return function (val, default)<br />
val = type(val) == 'string' and mw.ustring.lower(val) or val -- put in lower case<br />
if val == nil then<br />
return nil<br />
elseif val == false or val == 'no' or val == 'n' or val == 'false' or tonumber(val) == 0 then<br />
return false<br />
elseif val == true or val == 'yes' or val == 'y' or val == 'true' or tonumber(val) == 1 then<br />
return true<br />
else<br />
return default<br />
end<br />
end</div>Admin