Manual:File page warnings



creates a framework for adding warnings about different file types to file pages. Here's how to implement it:

return array( 'module' => 'pdfhandler.filewarning', // The name of the module you created above  'link' => 'http://example.com', // The link for your link to more information about the problem or solutions  'messages' => array( // The names of the messages you created above 'main' => '...', 'header' => '...', 'footer' => '...', 'info' => '...' ) );
 * 1) Add messages for the warning. There will be a maximum of four, only one of them is required:
 * 2) 'main' - this will be the text of the warning.
 * 3) 'header' - a title for the warning to grab the user's attention
 * 4) 'footer' - a qualification of the warning, for example "This is a warning about all PDF files, not this particular file."
 * 5) 'info' - text for a link to more information. The URL can be supplied later.
 * 6) Create and register a ResourceLoader module with the messages you just created. This will be used to load them onto the client.
 * 7) Create or locate a MediaHandler subclass for the type of file you're trying to handle. Most files get handled by ImageHandler or a subclass thereof by default, if a specialized handler doesn't exist for your filetype, you can create it.
 * 8) Override the default implementations of the   and   methods on your MediaHandler class. needsWarning should return true if you want a warning to be used, and getWarningConfig should return an object of the following structure:

After that, your warning should show up! Report any bugs in Phabricator and we'll get to it as soon as we can.