r70624 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70623‎ | r70624 | r70625 >
Date:12:15, 7 August 2010
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: improve docs, mark one private function as such and remove one unused global
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php
@@ -1,8 +1,9 @@
22 <?php
33 /**
4 - * A special page for uploading Avatars
5 - * This page is a big hack -- its just the image upload page with some changes to
6 - * upload the actual avatar files. The avatars are not held as MediaWiki images, but
 4+ * A special page for uploading avatars
 5+ * This page is a big hack -- it's just the image upload page with some changes
 6+ * to upload the actual avatar files.
 7+ * The avatars are not held as MediaWiki images, but
78 * rather based on the user_id and in multiple sizes
89 *
910 * Requirements: Need writable directory $wgUploadPath/avatars
@@ -60,10 +61,11 @@
6162
6263 /**
6364 * Show some text and linkage on successful upload.
64 - * @access private
 65+ *
 66+ * @param $ext String: file extension (gif, jpg or png)
6567 */
66 - function showSuccess( $ext ) {
67 - global $wgUser, $wgOut, $wgContLang, $wgDBname, $wgUploadPath, $wgUploadAvatarInRecentChanges;
 68+ private function showSuccess( $ext ) {
 69+ global $wgUser, $wgOut, $wgDBname, $wgUploadPath, $wgUploadAvatarInRecentChanges;
6870
6971 $log = new LogPage( wfMsgForContent( 'user-profile-picture-log' ) );
7072 if ( !$wgUploadAvatarInRecentChanges ) {
@@ -121,8 +123,10 @@
122124 * Displays the main upload form, optionally with a highlighted
123125 * error message up at the top.
124126 *
125 - * @param string $msg as HTML
126 - * @access private
 127+ * @param $msg String: error message as HTML
 128+ * @param $sessionKey String: session key in case this is a stashed upload
 129+ * @param $hideIgnoreWarning Boolean: whether to hide "ignore warning" check box
 130+ * @return HTML output
127131 */
128132 protected function getUploadForm( $message = '', $sessionKey = '', $hideIgnoreWarning = false ) {
129133 global $wgOut, $wgUser, $wgLang, $wgUploadDirectory, $wgRequest, $wgUseCopyrightUpload;
@@ -212,6 +216,13 @@
213217 return $output;
214218 }
215219
 220+ /**
 221+ * Gets an avatar image with the specified size
 222+ *
 223+ * @param $size String: size of the image ('s' for small, 'm' for medium,
 224+ * 'ml' for medium-large and 'l' for large)
 225+ * @return String: full img HTML tag
 226+ */
216227 function getAvatar( $size ) {
217228 global $wgUser, $wgDBname, $wgUploadDirectory, $wgUploadPath;
218229 $files = glob( $wgUploadDirectory . '/avatars/' . $wgDBname . '_' . $wgUser->getID() . '_' . $size . "*" );

Status & tagging log