Commit graph

224 commits

Author SHA1 Message Date
Victor Vasiliev
ce7681baf2 Fix stupid bug 2008-01-20 11:05:30 +00:00
Victor Vasiliev
07120a5077 * Fix empty file histories
* Fix Media: links to image redirects
2008-01-20 08:18:45 +00:00
Victor Vasiliev
d7a2058e15 Introduced File::getHistory(), which should be used instead of ugly nextHistoryLine() which is now deprecated 2008-01-20 06:48:57 +00:00
Raimond Spekking
6235449e09 * (bug 11809) Use formatNum() for more numbers
Based on a patch of Roozbeh Pournader
2007-10-30 11:57:39 +00:00
Rotem Liss
5987006713 Fixing display problem in image page in RTL wikis, when file name is LTR and is followed by the image size, by adding a direction mark. 2007-10-30 09:40:35 +00:00
Brion Vibber
9be2c3676a Revert r26281 for the moment. Big patch, changes several existing practices. Will want some public testing and more review before taking it to trunk. 2007-10-01 19:50:25 +00:00
Aaron Schulz
4febfc77c2 *Clean up deletion of revisions and remove some gaps
*Allow blocking of users to hide names
*Implement revision deletion for images/deleted files/deleted revs
*Log deletion set off for now
*Add 'hidden' file dir
*Dissallow merging via undelete (which was inefficient and hard to reverse)
*Use restore points and diffs to special:undelete
*Add a special page to merge pages
*Get changeslist to use tables to avoid ugly formatting
*Add logs into RC for rebuildrecentchanges.php
*Add private logs
*List private logs at specialpages
*Tweak/add some deletion and merge messages
2007-10-01 19:38:28 +00:00
Tim Starling
497649c904 In OggHandler:
* Changed display style: added a "more" link which expands a box for player selection. 
* Allow return to the still image only display.
* Fixed Java detection in IE (I hope)

Elsewhere:
* Changed MediaTransformOutput::toHtml() parameters, now accepts a single associative array with well-defined elements. Allows OggHandler to distinguish between file download links and image description links. 
* Made image links consistently have an anchor tag with class=image, instead of a mixture of image and internalParse.
* Made most images have a border=0 attribute, instead of just images on the image description page. Does not appear to adversely affect display at all, it was just convenient. 
* Use the image name as the title attribute for the <a> tag, when an a caption was not given by the user
* Block centering by the auto margins method in ImageGallery
* Fixed complete breakage of the thumbnail on upload conflict feature
* TODO: test DjVu
2007-08-31 02:51:23 +00:00
Rob Church
46ca61acf6 * Drop useless image parameter from deletion links in file histories
* Drop useless `wpEditToken` parameter from same
2007-08-27 13:59:41 +00:00
Nick Jenkins
786e93fb37 Static code analysis housekeeping time... things that could be double-checked are marked with "[Note: some-comment]" :
if-if-else without curly braces [api/ApiQuerySiteinfo.php] --> adding
Unused global declaration:  $wgGroupPermissions --> removing 
Unused global declaration:  $wgEmailConfirmToEdit (line 301) --> removing 
Variable $id appears only once (line 1021)  --> removing 
Variable $m was used before it was defined (line 805) --> defining.
Variable $retval was used before it was defined (line 2346) --> renaming to $result
Variable $rcid appears only once (line 244 of RecentChange.php)  --> using this instead of $change [Note: was left over from r24607 refactoring, revert if wrong please]
Unused global declaration:  $wgCommandLineMode (line 11) --> removing
Variable $k appears only once (line 132 of ImagePage.php) --> removing.
Variable $info appears only once (line 311 of ImagePage.php)  --> removing.
Unused global declaration:  $wgTitle (line 569 of ImagePage.php) -> removing.
Variable $handlerParams was used before it was defined (line 616 of Linker.php) --> resolved by Raymond in r24966
Variable $match was used before it was defined (line 1031 of Linker.php) --> defining.
Unused global declaration:  $wgEnotifWatchlist (line 253 of UserMailer.php) --> removing 
Unused global declaration:  $wgShowUpdatedMarker (line 253 of UserMailer.php) --> removing 
Variable $img appears only once (line 446 of SpecialUpload.php) --> added definition, defined as null, flagged with @todo  [Note: should $img be defined in this context, or is it intended to be null? And should the return value after the hook be checked in some way?]
Unused global declaration:  $wgEnableAPI (line 739 of SpecialUpload.php) --> removing.
Unused global declaration:  $wgNamespaceProtection (line 1030 of OutputPage.php) --> removing.
Unused global declaration:  $wgContLang (line 18 of SpecialWatchlist.php) --> removing.
Unused global declaration:  $wgRawHtml (line 269 of SpecialMovepage.php) --> removing.
The value of variable $page was never used (line 331 of SpecialUndelete.php) --> removing line, as $page gets redefined a few lines down.
Variable $synIndex appears only once (line 521 of MagicWord.php) --> commenting out.
Variable $case appears only once (line 539 of MagicWord.php) --> removing from foreach index key usage.
Variable $wgUser appears only once (line 1039 of Title.php) --> adding line to declare as a global, would be null otherwise.
Variable $m was used before it was defined (line 285 of Title.php) --> defining.
Variable $id appears only once (line 1150 of Title.php) --> removing from foreach index key usage.
Variable $subpage appears only once (line 1297 of Title.php) --> commenting out.
Variable $restrictions appears only once (line 1399 of Title.php) --> commenting out.
Variable $mime appears only once (line 210 of filerepo/OldLocalFile.php) --> removing.
Variable $deprefixedName appears only once (line 213 of filerepo/LocalFile.php) --> removing.
Variable $m appears only once (line 541 of filerepo/LocalFile.php) --> removing.
Variable $where appears only once (line 1245 of filerepo/LocalFile.php) --> removing.
Variable $info appears only once (line 1427 of filerepo/LocalFile.php) --> removing.
Variable $rel appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $zone appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $nbytes appears only once (line 208 of media/Generic.php) --> added a return line that uses $nbytes. [Note: I'm assuming that this was the intent]
Variable $offset appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $limit appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $groupTarget appears only once (line 203 of SpecialListusers.php) --> removing.
Unused global declaration:  $wgLang (line 74 of SpecialWantedpages.php) --> removing.
Variable $block appears only once (line 244 of SpecialProtectedpages.php) --> removing.
Variable $offset appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Variable $limit appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Unused global declaration:  $wgLang (line 30 of FileDeleteForm.php) --> removing.
Unused global declaration:  $wgServer (line 30 of FileDeleteForm.php) --> removing.
2007-08-21 03:57:54 +00:00
Rob Church
65d74391fd * Confirmation is now required when deleting old versions of files
* Users can now enter comments when deleting old versions of files
2007-08-17 20:53:17 +00:00
Tim Starling
164bb322f2 Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.

Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
Raimond Spekking
428485b579 * Prettifying file history table a bit. Especially for histories with long comments/descriptions it look clearer now. 2007-07-30 21:09:31 +00:00
Rob Church
f38f2fabe9 Some style tweaks, per Brion 2007-07-30 00:46:09 +00:00
Rob Church
3857b9b490 * (bug 10739) Users can now enter comments when reverting files
* You'll see some commented-out bits left in indicating I had bigger plans for the interface - some notes there, in case it's possible in the future
2007-07-29 22:00:46 +00:00
Rob Church
76d497b919 Lucky bug 2007-07-29 20:12:28 +00:00
Rob Church
c3a0ee7268 Note 2007-07-29 18:53:40 +00:00
Rob Church
13d79cb849 Whoops, missed this one... 2007-07-29 18:51:36 +00:00
Rob Church
6b1f079e79 * Use a table to present file histories
* (bug 10741) Don't show deletion links for non-sysops [in file histories]
2007-07-29 18:41:49 +00:00
Rob Church
b8f8c25260 strpos() !== false is faster than strstr() 2007-07-29 16:50:40 +00:00
Tim Starling
5c4b57817b Committing some work in progress -- abstraction of handler-specific metadata formatting. The return format of MediaHandler::formatMetadata() might still need some tweaking, but I believe there is feature parity at this point. 2007-07-28 01:15:35 +00:00
Tim Starling
ca76169bbe * Introduced FileRepoStatus -- result class for file repo operations.
* Ported file delete/restore to the filerepo framework. Some user-visible changes in error reporting. 
* $wgSaveDeletedFiles has been removed, the feature is now enabled unconditionally. Added a "deleted" directory for the default location, protected by a .htaccess file and the practical obscurity of content hashes.
* Fixed bug 2735: "Preview" shown in title bar for action=submit on special pages
* Removed "restore" links from the deletion log embedded in Special:Undelete
* Added img_sha1/oi_sha1 fields, preserved through upload, delete and restore
* Referenced the new oi_metadata etc. fields to preserve metadata across upload and delete/restore.
2007-07-22 14:45:12 +00:00
Yuri Astrakhan
a863e2bee3 filerepo: fixed mem leak for history lines and exposed repository name 2007-07-07 03:04:20 +00:00
Rotem Liss
15dd9dea43 In RTL wikis using Firefox, the padding doesn't work and the filetoc only contains one space between each item, and this is because the whitespace between the items; there is no space between imagelinks and metadata (because there is no whitespace), so adding one space to work around that (of course this whole bug should be fixed somehow). 2007-07-07 02:00:02 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Tim Starling
fad02b983d fix total breakage of image revert 2007-06-20 07:40:42 +00:00
Tim Starling
85fa7504e6 * Split off ultimate base class FileRepo from FSRepo
* Use rawurlencode() for paths instead of urlencode()
* Moved functionality of LocalFile::loadFromFile() to a public static function. This allows Special:Upload to entirely avoid loading metadata from the (potentially remote) store. Changed purgeMetadataCache() to use loadFromDB() instead of loadFromFile().
* Redefined private virtual URLs, giving them a repo name component instead of a host.
* Moved is_writable($wgUploadDirectory) in SpecialUpload.php to the repo
* Added some filename validation to the FSRepo's store/publish
* Changed store and publish to use relative destinations instead of absolute, as was documented
* Deprecated File::recordUpload()! Now use upload() to do both publish and record. Moved the UI bits to SpecialUpload.
* Create a null revision on reupload
* Changed most of the member variable names in UploadForm. $this->mUpload followed by some ambiguous word or abbreviation was not a good naming convention. Also did some reformatting and assorted code cleanup.
2007-06-16 02:55:25 +00:00
Tim Starling
e173697025 Don't delete images in foreign repositories. Also fixed image counter downwards drift bug. 2007-06-04 21:03:36 +00:00
Brion Vibber
078a5ad895 aaaand one more 2007-06-04 15:58:16 +00:00
Brion Vibber
eb35eaa785 fix to fix for calling convention :D 2007-06-04 15:57:22 +00:00
Tim Starling
d25024f93f Fix calling convention to makeThumbLinkObj() 2007-06-04 15:52:22 +00:00
Tim Starling
ed4303922f Merged filerepo-work branch:
* Added support for configuration of an arbitrary number of commons-style file repositories.
* Split Image.php into filerepo/File.php and filerepo/LocalFile.php
* Renamed Image::getImagePath() to File::getPath()
* Added initial support for timestamp-based file fetching (OldLocalFile), to be expanded upon by aaron.
* Changed the interface for Image/File object creation: use wfFindFile() or wfLocalFile() depending on semantics
* ImageGallery::add() now accepts a title object as the first parameter
* Moved file handling operations on upload from SpecialUpload to File
* Removed path-related functions from ImageFunctions.php. Removed static path accessors from File. 
* Added a Content-Disposition header to thumb.php output
* Improved thumb.php error handling
* Updated the unit test suite to kind of partially work with modern computers. RunTests.php doesn't work just yet. Fixed an actual regression that the test suite detected -- moved some defines to Defines.php where they will be loaded consistently.
2007-05-30 21:02:32 +00:00
Aaron Schulz
428da92d01 *A bit of cleanup for bug 5057, make upload link consistent with reupload-own right checking 2007-05-22 02:22:59 +00:00
Magnus Manske
46a6e4efe6 New hook 'ImageOpenShowImageInlineBefore' for upcoming extension 2007-05-16 19:52:22 +00:00
Brion Vibber
67c4772b67 Fix regression causing incorrect image data to be stored in the oldimage table.
The call to upgradeRow() in purgeMetadataCache(), indirectly called during upload, caused data for the new file to be written into the 'image' table in the database before migration from 'image' to 'oldimage'. Thus data for the new file was recorded as belonging to the old file.
Have replaced this call with a call to loadFromFile(), so the new data goes only into cache
at this time, and won't get written to the database until after.
The 'purge' action in ImagePage now explicitly calls the upgradeRow() function in addition to cache purging... is it needed elsewhere?
This whole mess still stinks of race  conditions, though. Sigh.
2007-05-04 19:39:19 +00:00
Aaron Schulz
62c20a7563 *Replace calls to $this->blockedIPpage() with $wgOut->blockedPage() since the former refers to a non-existent function in EditPage. 2007-05-04 19:17:36 +00:00
Tim Starling
ac14a8a6b7 Use makeKnownLinkObj() instead of makeLinkObj() for multipage prev/next links. Image pages do not need to exist to work. 2007-05-04 14:27:52 +00:00
Brion Vibber
f83d881fb1 Normalize escaping for some image page messages:
* HTML-escape the image filename when made into an original-size link for HTML purity
* Use inline wiki parsing instead of raw HTML for show-big-image-thumb and file-nohires messages. This is cleaner (less raw HTML yay) while avoiding breaking the "<small>" tags which are for some reason in the defaults and likely any customizations (sigh) and will allow the pixel values to have localized number formatting if appropriate parser function is used
2007-04-30 17:41:12 +00:00
Raimond Spekking
fd100716f3 Fix regression, broken since r21411:
Wrong messages were shown beneath small images at image description page.
2007-04-27 22:04:01 +00:00
Nick Jenkins
bd23ec29c6 Doc tweaks:
* Seems like an opportune time to introduce "@addtogroup Media" documentation tags.
* Merge "@addtogroup Metadata" (used by Exif.php) into "@addtogroup Media".
* Few more moving comment blocks to above classes.
2007-04-24 06:53:31 +00:00
Tim Starling
b15d8cffc4 * Introduced media handler modules for file-type specific operations: thumbnailing, img_metadata, capabilities, etc.
* Deprecated $wgUseImageResize, thumbnailing will be enabled unconditionally.
* Fixed interaction of page parameter to ImagePage with the HTML file cache
* Improved error reporting for image thumbnailing
* Fixed MIME type for SVG files, will be silently changed from image/svg to image/svg+xml after loading from the database.
* Workaround for djvutoxml bug #1704049 (poor performance). Use djvudump instead.
* Fixed odd behaviour in ImagePage on DjVu thumbnailing errors
* Improved error reporting for image thumbnailing
* Added sharpening option for ImageMagick thumbnailing
* Removed Image::selectPage(), added page parameters to getWidth() and getHeight(), deprecated Image::renderThumb() and Image::getThumbnail()
* Changed default contents of img_metadata to empty string instead of a:0:{}
* Moved responsibility for respecting $wgGenerateThumbnailOnParse from the UI to Image.php
2007-04-20 12:31:36 +00:00
Tim Starling
a7c8d93b7e * Fix extension of DJVU output
* Specify output type in ImageMagick SVG rendering command line
* Make some Image functions static, for the benefit of WebStore.
* Fixed SVG MIME type, will be image/svg+xml from now on with both accepted.
2007-03-31 17:15:00 +00:00
Brion Vibber
629435171a * (bug 9411) Fix for shared image descriptions using query-string titles
Extracted URL-query-append logic from Title to wfAppendQuery(), using this in two places now.
2007-03-26 14:33:08 +00:00
Brion Vibber
0b0eed5cba Fix for 'shareddescriptionfollows' message in some non-standard languages (noticed on simple); use wfEmptyMsg() check 2007-03-18 03:44:32 +00:00
Brion Vibber
9150412fe7 For now revert the rev_deleted branch merge; don't want trunk to get too far gone before changes are reviewed!
Reverted: 20511, 20510, 20507, 20474, 20461, 20460, 20457, 20448, 20446
2007-03-16 16:01:07 +00:00
Aaron Schulz
2448539ad9 *Merge in phase3_rev_deleted/includes 2007-03-14 15:50:06 +00:00
Raimond Spekking
a9e30b0b6b * (bug 7782) fix for .svg 2007-03-05 19:53:41 +00:00
Raimond Spekking
c97d076ed1 * (bug 7782) Standardisation of file info at image description pages.
* tweak formatSize/Linker.php for smarter output of big numbers
* RELEASE-NOTES forgotten in r20044
2007-02-27 18:27:11 +00:00
Raimond Spekking
10741f6f13 Suppress external weblink arrow for uploading a new image version 2007-02-09 22:19:54 +00:00
Antoine Musso
a27383b672 Fix #8858 : handle $wgImageLimits changes correctly 2007-02-02 16:22:22 +00:00