From 0bbc358951e56fbb3e2e121a02cf213e280ffdc1 Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Thu, 23 May 2013 00:31:11 -0400 Subject: [PATCH] Add wgIsProbablyEditable for editability based on quickUserCan. It uses quickUserCan like SkinTemplate, for performance reasons. Bug: 43790 Change-Id: I2f77b69624cc1a4cd74c8178eea53681f3f2b107 --- includes/OutputPage.php | 2 ++ 1 file changed, 2 insertions(+) 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 ); } -- 2.20.1