Extension:PageAttachment

What can this extension do?
This extension extends MediaWiki to allow adding files to a page as attachments.

By default, attachments are only allowed to be added to pages in the "Main" namespace. Through configuration changes, attachments can be allowed to be attached to any other pages under other namespaces, for example, "User Talk" pages.

Usage
Supported use-cases:
 * View attachments
 * Upload & attach a file
 * Browse/search for existing (uploaded) files and attach
 * Download an attachment
 * Remove an attachment (does not delete the file from MediaWiki repository)
 * View an attachment file's history
 * View audit log (Audit logging by default is turned off)
 * For a specific attachment
 * For all attachmnets for a page
 * Auto remove an attachment when the attachment file is deleted from MediaWiki repository
 * Auto restore an attachment when a file deleted from MediaWiki repository is restored and if it was attached to any page

Download instructions
This project is hosted on Google Code at the following link:

MediaWiki PageAttachment on Google Code

NOTE: Code and download package soon to be released

Installation
Step 1

To install this extension, add the following to LocalSettings.php:

Step 2

Review the following file for available & default configurations:

config/DefaultConfigurations.php

Step 3

To override defaults and to set site specific configurations, update the following file:

config/SiteSpecificConfigurations.php

For example see the following file contained in the downloaded package:

exmaple-configuration/SiteSpecificConfigurations.php

Step 4

Run MediaWiki's update to create required database tables.

Please Consult: update.php

File Upload
Note: MediaWiki file upload functionality must be enabled for this extension to work.

Please consult: Configuring File Uploads

Allowed Namespaces
Attachments are allowed only on pages under configured namespaces.

By default, only "Main" namespace is enabled:

To add other namespaces, for example, "Talk", "User", and "User Talk" add the following in the site specific configuration file:

MediaWiki User Rights
For upload & attachment activity, check is made to ensure the following:
 * User is not blocked
 * Wiki is not in readonly mode

PageAttachment User Rights
This extension maintains page attachment specific rights separately.

Page attachment specific rights are:
 * View attachments
 * Upload & attach a file
 * Browse/Search for existing (uploaded) files and attach
 * Remove attachments
 * Download attachments
 * View history
 * View audit log (if audit logging is enabled)

NOTE: View rights must be enabled for all other rights to work

The rights can be applied:
 * When login is not required
 * Only at the activity level (e.g. upload & attach a file)
 * When login is required
 * At a group level
 * At a user specific level

NOTE: The groups/users must be valid MediaWiki groups/users.

Cache

 * Server side cache
 * Internal
 * MediaWiki's Cache
 * Browser cache
 * Ajax

User Interface

 * User name format
 * Status message format
 * Attachment display section
 * CSS files
 * For left-to-right (LTR) language
 * For right-to-left (RTL) language
 * Image files
 * Column widths