Merge "Configure footer and sidebar placements" into dev

This commit is contained in:
jenkins-bot 2015-12-02 22:42:52 +00:00 committed by Gerrit Code Review
commit 21db191b34
3 changed files with 7 additions and 7 deletions

View file

@ -97,8 +97,8 @@
}
},
"config": {
"@RelatedArticlesShowReadMore": "If true, shows ReadMore while hiding related articles from the sidebar on desktop.",
"RelatedArticlesShowReadMore": false,
"RelatedArticlesShowInSidebar": true,
"RelatedArticlesShowInFooter": false,
"RelatedArticlesUseCirrusSearch": false,
"RelatedArticlesOnlyUseCirrusSearch": false,
"RelatedArticlesLoggingSamplingRate": 0.01

View file

@ -40,10 +40,10 @@ class FooterHooks {
* to the output when:
*
* <ol>
* <li><code>$wgRelatedArticlesShowReadMore</code> is truthy</li>
* <li><code>$wgRelatedArticlesShowInFooter</code> is truthy</li>
* <li>On mobile, the output is being rendered with
* <code>SkinMinervaBeta<code></li>
* <li>On desktop, the beta feature has been enabled.</li>
* <li>On desktop, the beta feature has been enabled</li>
* <li>The page is in mainspace</li>
* </ol>
*
@ -53,7 +53,7 @@ class FooterHooks {
*/
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'RelatedArticles' );
$showReadMore = $config->get( 'RelatedArticlesShowReadMore' );
$showReadMore = $config->get( 'RelatedArticlesShowInFooter' );
$title = $out->getContext()->getTitle();
@ -170,7 +170,7 @@ class FooterHooks {
*/
public static function onGetBetaFeaturePreferences( User $user, array &$preferences ) {
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'RelatedArticles' );
$showReadMore = $config->get( 'RelatedArticlesShowReadMore' );
$showReadMore = $config->get( 'RelatedArticlesShowInFooter' );
if ( $showReadMore ) {
$wgExtensionAssetsPath = $config->get( 'ExtensionAssetsPath' );

View file

@ -157,7 +157,7 @@ class SidebarHooks {
private static function isInSidebar( $relatedPages, User $user ) {
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'RelatedArticles' );
if ( !$relatedPages || $config->get( 'RelatedArticlesShowReadMore' ) ) {
if ( !$relatedPages || !$config->get( 'RelatedArticlesShowInSidebar' ) ) {
return false;
}