From: Bogdan Stancescu Date: Sun, 5 Oct 2003 09:44:20 +0000 (+0000) Subject: Added per page support for inhibiting editsection links via the __NOEDITSECTION__... X-Git-Tag: 1.1.0~224 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=49c130124fbdacc28ed66995e1c205c06d64517d;p=lhc%2Fweb%2Fwiklou.git Added per page support for inhibiting editsection links via the __NOEDITSECTION__ magic word: some pages are known to be rendered ugly with editsection links (e.g. when using tables) --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 284d1553f3..18fefbb1a5 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1378,6 +1378,13 @@ $t[] = "" ; $esr=$wgUser->getID() && $wgUser->getOption( "editsectiononrightclick" ); } + # Inhibit editsection links if requested in the page + if ($es) { + $esw=& MagicWord::get(MAG_NOEDITSECTION); + if ($esw->matchAndRemove( $text )) { + $es=0; + } + } # if the string __NOTOC__ (not case-sensitive) occurs in the HTML, # do not add TOC $mw =& MagicWord::get( MAG_NOTOC ); diff --git a/languages/Language.php b/languages/Language.php index 05e78eacf5..a5d6454a3e 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -283,6 +283,7 @@ this (alternative: like this?).", # ID CASE SYNONYMS MAG_REDIRECT => array( 0, "#redirect" ), MAG_NOTOC => array( 0, "__NOTOC__" ), + MAG_NOEDITSECTION => array( 0, "__NOEDITSECTION__" ), MAG_START => array( 0, "__START__" ), MAG_CURRENTMONTH => array( 1, "{{CURRENTMONTH}}" ), MAG_CURRENTMONTHNAME => array( 1, "{{CURRENTMONTHNAME}}" ),