Robert Vogel has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/365990 )
Change subject: BSExtensions: Fixed UserMiniProfile usage
......................................................................
BSExtensions: Fixed UserMiniProfile usage
=> soft requires I35d3b540fdab7da0a9605b91d69b10d3273949b6
=> Nees cherry-pick to REL1_27
Authors:
* Removed using specific width and height
Avatars:
* Removed forcing of specific height and width for every UserMiniprofile that
is showing an avatar as user profile image
Readers:
* Removed usage of width and height setting from Authors extension
Change-Id: I3347db9f2bcdcaadc2b980d16c89333e629192ed
---
M Authors/Authors.class.php
M Avatars/Avatars.class.php
M Readers/Readers.class.php
3 files changed, 12 insertions(+), 32 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions
refs/changes/90/365990/1
diff --git a/Authors/Authors.class.php b/Authors/Authors.class.php
index 6d9ff09..143e6c7 100644
--- a/Authors/Authors.class.php
+++ b/Authors/Authors.class.php
@@ -141,10 +141,6 @@
$aBlacklist = BsConfig::get( 'MW::Authors::Blacklist' );
$sMoreImage = BsConfig::get( 'MW::Authors::MoreImage' );
- $aParams = array();
- $aParams['width'] = BsConfig::get( 'MW::Authors::ImageWidth' );
- $aParams['height'] = BsConfig::get( 'MW::Authors::ImageHeight'
);
-
$sPrintable = $oSkin->getRequest()->getVal( 'printable', 'no' );
$iArticleId = $oTitle->getArticleID();
@@ -224,7 +220,9 @@
}
$aDetails['username'] = $oAuthorUser->getName();
- $oUserMiniProfileView =
BsCore::getInstance()->getUserMiniProfile( $oAuthorUser, $aParams );
+ $oUserMiniProfileView =
BsCore::getInstance()->getUserMiniProfile(
+ $oAuthorUser
+ );
if ( $sPrintable == 'yes' ) {
$oUserMiniProfileView->setOption(
'print', true );
}
@@ -235,7 +233,9 @@
}
if ( $bAddMore === true ) {
- $oMoreAuthorsView =
BsCore::getInstance()->getUserMiniProfile( new User(), $aParams );
+ $oMoreAuthorsView =
BsCore::getInstance()->getUserMiniProfile(
+ new User()
+ );
$oMoreAuthorsView->setOption(
'userdisplayname', wfMessage( 'bs-authors-show-all-authors' )->plain() );
$oMoreAuthorsView->setOption( 'userimagesrc',
$this->getImagePath( true ) . '/' . $sMoreImage );
$oMoreAuthorsView->setOption( 'linktargethref',
$oTitle->getLocalURL( array( 'action' => 'history' ) ) );
diff --git a/Avatars/Avatars.class.php b/Avatars/Avatars.class.php
index 7b00663..6f0ae97 100644
--- a/Avatars/Avatars.class.php
+++ b/Avatars/Avatars.class.php
@@ -126,28 +126,12 @@
$oUserMiniProfileView->setUserImageSrc(BsConfig::get('MW::DefaultUserImage'));
return true;
}
+
# Set or generate user's avatar
-
$oUserMiniProfileView->setUserImageSrc($this->generateAvatar($oUser, $aParams));
-
- $oFile = self::getAvatarFile( $oUser->getId() );
-
- if( !$oFile || !$oFile->exists() ) {
- return true;
- }
- if( !isset( $aParams['width'] ) ) {
- $aParams['width'] = $oFile->getWidth();
- }
- if( $aParams['width'] > $oFile->getWidth() ) {
- $aParams['width'] = $oFile->getWidth();
- }
- if( !isset( $aParams['height'] ) ) {
- $aParams['height'] = $oFile->getHeight();
- }
- if( $aParams['height'] > $oFile->getHeight() ) {
- $aParams['height'] = $oFile->getHeight();
- }
-
- $oUserMiniProfileView->setOptions( $aParams );
+ $oUserMiniProfileView->setUserImageSrc( $this->generateAvatar(
+ $oUser,
+ $aParams
+ ));
return true;
}
diff --git a/Readers/Readers.class.php b/Readers/Readers.class.php
index 3bcf98b..f29ed17 100644
--- a/Readers/Readers.class.php
+++ b/Readers/Readers.class.php
@@ -206,15 +206,11 @@
);
if ( $oDbr->numRows( $res ) > 0 ) {
- $aParams = array();
- $aParams['width'] = BsConfig::get(
'MW::Authors::ImageWidth' );
- $aParams['height'] = BsConfig::get(
'MW::Authors::ImageHeight' );
-
$oViewReaders = new ViewReaders();
while ( $row = $oDbr->fetchObject( $res ) ) {
$oUser = User::newFromId(
(int)$row->readers_user_id );
- $oUserMiniProfile =
$this->mCore->getUserMiniProfile( $oUser, $aParams );
+ $oUserMiniProfile =
$this->mCore->getUserMiniProfile( $oUser );
$oViewReaders->addItem( $oUserMiniProfile );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/365990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3347db9f2bcdcaadc2b980d16c89333e629192ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Robert Vogel <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits