From: Jack Phoenix Date: Thu, 21 Dec 2017 07:42:19 +0000 (+0200) Subject: Make ImagePage#getThumbPrevText and ImagePage#makeSizeLink protected instead of private X-Git-Tag: 1.31.0-rc.0~1055^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_modifier.php?a=commitdiff_plain;h=741b09c1f4ed3ba8075d5c0f1d2e17cdbdc798a4;p=lhc%2Fweb%2Fwiklou.git Make ImagePage#getThumbPrevText and ImagePage#makeSizeLink protected instead of private So that extensions wishing to modify ImagePage#openShowImage() that want to preserve most of the existing functionality (at least in certain contexts) do not have to copypaste these two methods over. ImagePage#openShowImage() itself is ridiculously large and it's absurd that to change a few things there you need to copy over the whole giant block of code, but that's a separate matter. Inspired by wikiHow's WikihowImagePage extension and their associated core hacks to ImagePage.php, which hopefully won't be needed in the future. Change-Id: Ic5e16acfc2cf4683154a60a3eaa9df69d30d03cb --- diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index 1dcdc65ff2..8724c454e0 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -632,7 +632,7 @@ EOT * @param string $sizeLinkBigImagePreview HTML for the current size * @return string HTML output */ - private function getThumbPrevText( $params, $sizeLinkBigImagePreview ) { + protected function getThumbPrevText( $params, $sizeLinkBigImagePreview ) { if ( $sizeLinkBigImagePreview ) { // Show a different message of preview is different format from original. $previewTypeDiffers = false; @@ -670,7 +670,7 @@ EOT * @param int $height * @return string */ - private function makeSizeLink( $params, $width, $height ) { + protected function makeSizeLink( $params, $width, $height ) { $params['width'] = $width; $params['height'] = $height; $thumbnail = $this->displayImg->transform( $params );