[Mediawiki-l] Remove the Edit-section Link

Rowan Collins rowan.collins at gmail.com
Thu Nov 10 13:47:10 UTC 2005


On 10/11/05, jaro <november.diary at gmail.com> wrote:
> Ok thank you very much :) that helped.
>
> But i'l ask more.. Do you know where I can see the code for that. What php
> file would that be? The other users might forget inserting
> "__NOEDITSECTION__" and i want to eliminate that probablitiy.

Well, they can be disabled for all pages by individual users in their
preferences, and you can set the default value for logged out and new
users in LocalSettings.php, as explained in this part of
DefaultSettings.php (remember never to edit DefaultSettings directly;
it is for system defaults, and will be overwritten on upgrade):

/**
 * Settings added to this array will override the language globals for the user
 * preferences used by anonymous visitors and newly created accounts. (See names
 * and sample values in languages/Language.php)
 * For instance, to disable section editing links:
 *  $wgDefaultUserOptions ['editsection'] = 0;
 *
 */
$wgDefaultUserOptions = array();


As for "what file would that be", what is it you want to change -
disable section editting for all pages? Disable based on some
hard-coded list or regex, or by namespace? Create an easier way to
disable it (rather than just teaching your users the existing way,
which isn't exactly difficult once you know it)?

Anyway, the code that determines *whether to show* the edit links (by
looking in the user prefs, and checking for the "__NOEDITSECTION__"
magic word) appears to be in includes/Parser.php, function
formatHeadings().

--
Rowan Collins BSc
[IMSoP]



More information about the MediaWiki-l mailing list