Content deleted Content added
m Archiving 1 discussion(s) from Template talk:Documentation) (bot |
m Archiving 1 discussion(s) from Template talk:Documentation) (bot |
||
Line 407:
:::::I don't think we should have a hack that only works for modules. If this is the desired behaviour, how about putting it into the module proper so that it will work this way for templates and other pages too? — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 01:31, 8 February 2014 (UTC)
::::::Yes, I think that would be desirable. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:22, 8 February 2014 (UTC)
== Line 402 (protectionlevel) ==
{{Edit protected|ans=yes}}
In line 402 of Module:Documentation an lua protectionlevel function - mw.title.new("text").protectionLevels["action"], should be used instead of the parser function "protectionlevel". See also [[mw:Extension:Scribunto/Lua_reference_manual#Title_objects]], where the Lua function protectionLevels is documented.--[[User:Snaevar|Snaevar]] ([[User talk:Snaevar|talk]]) 16:56, 28 February 2014 (UTC)
* {{Ping|Mr. Stradivarius|Jackmcbarn|Anomie}} as I know you are all Lua geniuses and competent with protection level stuffs... — <span class="nowrap">{{U|[[User:Technical 13|Technical 13]]}}</span> <sup>([[User talk:Technical 13|t]] • [[Special:EmailUser/Technical 13|e]] • [[Special:Contribs/Technical 13|c]])</sup> 01:19, 13 March 2014 (UTC)
::I'll take a look at it. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 01:22, 13 March 2014 (UTC)
:::{{ping|Jackmcbarn}} I see that <code>title.protectionLevels</code> gives a table like this:
<source lang="lua">
{
["edit"] = {
"sysop"
},
["move"] = {
"sysop"
}
}
</source>
:::Why not just like this?
<source lang="lua">
{
["edit"] = "sysop",
["move"] = "sysop"
}
</source>
:::Can there be more than one protection level for each protection type? And am I always guaranteed to find the highest protection level by using <code>title.protectionLevels.edit[1]</code>? Enquiring minds need to know. :) — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 02:21, 13 March 2014 (UTC)
::::For now, yes, just use [1]. In the future, an update to MediaWiki could allow multiple protection levels on the same action. (Beware that if the page is unprotected, the return value may be {}, not always { edit = {} } as you might expect. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 02:50, 13 March 2014 (UTC)
:::::Thanks, that helps a lot. I've now updated the module to use protectionLevels, so I guess we can consider this request answered. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 04:08, 13 March 2014 (UTC)
|