Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 See also  














Module:Toolbar






Ænglisc
Аԥсшәа
العربية

Azərbaycanca
تۆرکجه
Basa Bali


Bosanski
Cebuano
Chi-Chewa
Dansk
Ελληνικά
فارسی
Føroyskt
Fulfulde

  / Gõychi Konknni

ि
Ilokano
Bahasa Indonesia
Íslenska
Jawa


Қазақша
Ikirundi
Kurdî
Latviešu
ि


مصرى
Bahasa Melayu
Мокшень


ି
Oʻzbekcha / ўзбекча

Polski
Português
Scots
Shqip

Simple English
سنڌي
Slovenščina
کوردی
Српски / srpski
Srpskohrvatski / српскохрватски
Tagalog
ி
 

Türkçe
Türkmençe
Тыва дыл
Українська
اردو
Tiếng Vit

Yorùbá


Batak Toba
Betawi
 

Edit links
 









Module
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
Wikimedia Foundation
MediaWiki
Meta-Wiki
Wikispecies
Wikifunctions
Wikimania
Wikiquote
Wikisource
 
















Appearance
   

 





Permanently protected module

From Wikipedia, the free encyclopedia
 


This module implements {{toolbar}}. Please see the template page for documentation.

See also

-- This module implements {{toolbar}}.

local mArguments -- Lazily initialise [[Module:Arguments]]
local mTableTools = require('Module:TableTools')
local yesno = require('Module:Yesno')

local p = {}

function p.main(frame)
 mArguments = require('Module:Arguments')
 local args = mArguments.getArgs(frame)
 return p._main(args)
end

function p._main(args)
 local toolbarItems = p.makeToolbarItems(args)
 if not toolbarItems then
  -- Return the blank string if no arguments were specified, rather than
  -- returning empty brackets.
  return ''
 elseif yesno(args.span) == false then
  return string.format(
   '(%s)',
   toolbarItems
  )
 else
  return string.format(
   '<span class="plainlinks%s"%s>(%s)</span>',
   type(args.class) == 'string' and ' ' .. args.class or '',
   type(args.style) == 'string' and string.format(' style="%s"', args.style) or '',
   toolbarItems
  )
 end
end

function p.makeToolbarItems(args)
 local nums = mTableTools.numKeys(args)
 local sep = (args.separator or 'pipe') .. '-separator'
 sep = mw.message.new(sep):plain()
 local ret = {}
 for i, v in ipairs(nums) do
  ret[#ret + 1] = mw.ustring.gsub(args[v], "%[%[::+(.-)%]%]", "[[:%1]]")
 end
 if #ret > 0 then
  return table.concat(ret, sep)
 else
  return nil
 end
end

return p

Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Toolbar&oldid=885216335"

Category: 
Modules subject to page protection
Hidden category: 
Wikipedia fully protected modules
 



This page was last edited on 26 February 2019, at 18:14 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki