From: Timo Tijhof Date: Wed, 23 Aug 2017 19:30:01 +0000 (+0100) Subject: Skin: Remove more use of QuickTemplate::setRef() X-Git-Tag: 1.31.0-rc.0~2312^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=429f557cc7f68a469f16cb9d5ce37a2cf33221c8;p=lhc%2Fweb%2Fwiklou.git Skin: Remove more use of QuickTemplate::setRef() Follows-up 2c01147c13be. * language_links: The local array variable is only used once to obtain the value from Skin::getLanguages(), and then never passed elsewhere or otherwise potentially changed, so this reference doesn't seem useful. The getLanguages() method itself also creates a new array every time it is called, so the reference from there can't change either. * Same for content_navigation and content_actions. These are never modified, and the method that returns the array creates a new one on each call. Follows-up r3014 (f4755755daed1f8). * Same for bodytext. Presumably these were only set as references to save memory. Bug: T140664 Change-Id: I1224a7a89c1d7ad05c73132ff73299fd78ade7fb --- diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index cbffe1e571..180a6df9c4 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -462,11 +462,11 @@ class SkinTemplate extends Skin { $tpl->set( 'printfooter', $this->printSource() ); // Wrap the bodyText with #mw-content-text element $out->mBodytext = $this->wrapHTML( $title, $out->mBodytext ); - $tpl->setRef( 'bodytext', $out->mBodytext ); + $tpl->set( 'bodytext', $out->mBodytext ); $language_urls = $this->getLanguages(); if ( count( $language_urls ) ) { - $tpl->setRef( 'language_urls', $language_urls ); + $tpl->set( 'language_urls', $language_urls ); } else { $tpl->set( 'language_urls', false ); } @@ -475,8 +475,8 @@ class SkinTemplate extends Skin { $tpl->set( 'personal_urls', $this->buildPersonalUrls() ); $content_navigation = $this->buildContentNavigationUrls(); $content_actions = $this->buildContentActionUrls( $content_navigation ); - $tpl->setRef( 'content_navigation', $content_navigation ); - $tpl->setRef( 'content_actions', $content_actions ); + $tpl->set( 'content_navigation', $content_navigation ); + $tpl->set( 'content_actions', $content_actions ); $tpl->set( 'sidebar', $this->buildSidebar() ); $tpl->set( 'nav_urls', $this->buildNavUrls() );