X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Factions%2FInfoAction.php;h=f8ba08c3bab863437ff7d8ec5e80938aa50ef875;hp=bfba59a02c7fbef60fb72110290d773bc40799c0;hb=04d1aa3033f40a38d721f7f0e88b5bac440d2869;hpb=bfb8f5c9d3d2046271c027401e31c9645ad792cd diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index bfba59a02c..f8ba08c3ba 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -103,6 +103,9 @@ class InfoAction extends FormlessAction { } } + // "Help" button + $this->addHelpLink( 'Page information' ); + // Page header if ( !$this->msg( 'pageinfo-header' )->isDisabled() ) { $content .= $this->msg( 'pageinfo-header' )->parse(); @@ -276,11 +279,13 @@ class InfoAction extends FormlessAction { // Language in which the page content is (supposed to be) written $pageLang = $title->getPageLanguage()->getCode(); + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + $pageLangHtml = $pageLang . ' - ' . Language::fetchLanguageName( $pageLang, $lang->getCode() ); // Link to Special:PageLanguage with pre-filled page title if user has permissions if ( $config->get( 'PageLanguageUseDB' ) - && $title->userCan( 'pagelang', $user ) + && $permissionManager->userCan( 'pagelang', $user, $title ) ) { $pageLangHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink( SpecialPage::getTitleValueFor( 'PageLanguage', $title->getPrefixedText() ), @@ -297,7 +302,7 @@ class InfoAction extends FormlessAction { $modelHtml = htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) ); // If the user can change it, add a link to Special:ChangeContentModel if ( $config->get( 'ContentHandlerUseDB' ) - && $title->userCan( 'editcontentmodel', $user ) + && $permissionManager->userCan( 'editcontentmodel', $user, $title ) ) { $modelHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink( SpecialPage::getTitleValueFor( 'ChangeContentModel', $title->getPrefixedText() ), @@ -447,7 +452,7 @@ class InfoAction extends FormlessAction { // Display image SHA-1 value if ( $title->inNamespace( NS_FILE ) ) { - $fileObj = wfFindFile( $title ); + $fileObj = $services->getRepoGroup()->findFile( $title ); if ( $fileObj !== false ) { // Convert the base-36 sha1 value obtained from database to base-16 $output = Wikimedia\base_convert( $fileObj->getSha1(), 36, 16, 40 );