From: Matthew Flaschen Date: Thu, 23 May 2013 04:31:11 +0000 (-0400) Subject: Add wgIsProbablyEditable for editability based on quickUserCan. X-Git-Tag: 1.31.0-rc.0~19279 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=0bbc358951e56fbb3e2e121a02cf213e280ffdc1;p=lhc%2Fweb%2Fwiklou.git Add wgIsProbablyEditable for editability based on quickUserCan. It uses quickUserCan like SkinTemplate, for performance reasons. Bug: 43790 Change-Id: I2f77b69624cc1a4cd74c8178eea53681f3f2b107 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 96a503e81c..96c7830a21 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3051,6 +3051,8 @@ $templates if ( $wgContLang->hasVariants() ) { $vars['wgUserVariant'] = $wgContLang->getPreferredVariant(); } + // Same test as SkinTemplate + $vars['wgIsProbablyEditable'] = $title->quickUserCan( 'edit', $user ) && ( $title->exists() || $title->quickUserCan( 'create', $user ) ); foreach ( $title->getRestrictionTypes() as $type ) { $vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type ); }