|
Main sidebar
|
PITS /
01193Summary:
$RecentUploadsFmt should use $ChangeSummaryCreated: 2010-05-11 08:15
Status: Open
Category: Feature
From: Eemeli Aro
Assigned:
Priority: 55
Version: 2.2.6+
Description: The way At the moment, HandlePostUpload will log uploads by setting the Better consistency with This would require a new global variable for holding the change summaries, but it would only need to be set when the action is about to be performed. In the following sample implementation, I'm calling it Using: $RecentUploadsFmt['$SiteGroup.AllRecentChanges'] =
'* [[{$Group}/]] / [[(Path:/pmwiki/uploads/{$Group}/)$upname]] '
.'. . . $CurrentTime by $AuthorLink: $ChangeSummary';
$UploadSummaryFmt['upload'] = 'Uploaded to [[{$Group}/{$Name}]] ($upsize $[bytes])';
The following change would allow the use of a similar log format as in use now on pmwiki.org, while also allowing the reuse of Index: scripts/upload.php
===================================================================
--- scripts/upload.php (revision 2556)
+++ scripts/upload.php (working copy)
@@ -199,7 +199,7 @@
function HandlePostUpload($pagename, $auth = 'upload') {
global $UploadVerifyFunction, $UploadFileFmt, $LastModFile,
- $EnableUploadVersions, $Now, $RecentUploadsFmt, $FmtV;
+ $EnableUploadVersions, $Now, $RecentUploadsFmt, $FmtV, $ChangeSummary, $UploadSummaryFmt;
UploadAuth($pagename, $auth);
$uploadfile = $_FILES['uploadfile'];
$upname = $_REQUEST['upname'];
@@ -222,6 +222,7 @@
if (IsEnabled($RecentUploadsFmt, 0)) {
$FmtV['$upname'] = $upname;
$FmtV['$upsize'] = $uploadfile['size'];
+ $ChangeSummary = FmtPageName(@$UploadSummaryFmt['upload'], $pagename);
PostRecentChanges($pagename, '', '', $RecentUploadsFmt);
}
}
|