(bug 3359) Add hooks on completion of file upload
authorRob Church <robchurch@users.mediawiki.org>
Thu, 13 Apr 2006 18:29:18 +0000 (18:29 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Thu, 13 Apr 2006 18:29:18 +0000 (18:29 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/SpecialUpload.php

index d5eec3e..a212fbc 100644 (file)
@@ -61,7 +61,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   magic words
 * (bug 5403) Fix Special:Newpages RSS/Atom feeds
 * Reject malformed addresses in X-Forwarded-For entries
-
+* (bug 3359) Add hooks on completion of file upload
 
 == Compatibility ==
 
index 50ace1e..64dce31 100644 (file)
@@ -380,6 +380,9 @@ string $saveName: destination file name
 string $tempName: filesystem path to the temporary file for checks
 string &$error: output: HTML error to show if upload canceled by returning false
 
+'UploadComplete': Upon completion of a file upload
+$image: Image object representing the file that was uploaded
+
 'UserCan': To interrupt/advise the "user can do X to Y article" check
 $title: Title object being checked against
 $user : Current user object
index 31c4f3c..367b937 100644 (file)
@@ -331,6 +331,7 @@ class UploadForm {
 
                        if ( $success ) {
                                $this->showSuccess();
+                               wfRunHooks( 'UploadComplete', &$img );
                        } else {
                                // Image::recordUpload() fails if the image went missing, which is
                                // unlikely, hence the lack of a specialised message