[feature/attachment-improvements] Basic integration of plupload

Plupload configuration takes its values from appropriate places in phpBB's
settings.

Translation strings are also taken from a language file.

The HTML5 runtime correctly loads in the appropriate place of the attachment
section of a post.

$user->add_lang was modified to also return the strings that are added.

Actual uploading is still unimplemented.

PHPBB3-10929
[feature/attachment-improvements] Chunk size properly configured

The maximum 'safe' chunk size is chosen based on php.ini values.

PHPBB3-10929
[feature/attachment-improvements] Uploading via plupload now functions

Using the HTML5 uploader should now allow files to be uploaded and subjects
them to the same checks as old-style uploads received. Chunked uploads have
been tested but multiple uploads have not, either way, much more testing is
required.

The premature move_uploaded_file() may introduce a race condition since the
file is moved before any of the checks are performed on it.

PHPBB3-10929
[feature/attachment-improvements] Incorporated comments from the PR

Reverted changes to user.php since they are no longer needed.

Created a new cron job to clear the plupload temporary directory.

The file token used by plupload is now hashed and salted for increased
security.

Various changes to the install script and database schema have been made to
incorporate the above changes.

Uploading chunked files is still not working as the mimetype is lost over the
chunks and so the file fails preliminary image checks. The real file name as
belonging to the user is also lost during upload.

PHPBB3-10929
[feature/attachment-improvements] Replaced use of DIRECTORY_SEPARATOR with /

PHPBB3-10929
[feature/attachment-improvements] Modified tidy_uploads.php as per PR comments

$config now a class variable, doc block syntax made consistent, constant uses
uppercase.

PHPBB3-10929
[feature/attachment-improvements] Modified functions_upload.php per comments

phpbb_json_response instantiated, replaced use of request_var with $request
class and removed use of getallheaders() in favour of $request class.

PHPBB3-10929
[feature/attachment-improvements] Fixed $multipart to $is_multipart

PHPBB3-10929
[feature/attachment-improvements] Renamed $extensions to avoid redefinition

PHPBB3-10929
[feature/attachment-improvements] Added translation strings for errors

PHPBB3-10929
[feature/attachment-improvements] Server-side errors reported to client

Appropriate checking added to the javascript code to catch server-side upload
errors.

Fixed a bug where images were being resized to 0x0 and losing data.

PHPBB3-10929
[feature/attachment-improvements] More errors reported to client

Errors that can occur when the complete file is being processed are now
reported to the client.

PHPBB3-10929
[feature/attachment-improvements] Better integration of upload queue

While uploading, the queue widget will now correctly send aggregated
attachment data to the server to allow the server to keep track of multiple
uploads. Uploaded attachments can now be deleted by clicking their row and
further attachments can be added after the previous batch completes.

PHPBB3-10929
[feature/attachment-improvements] Moved plupload.js

Javascript plupload integration code moved from template directory to assets.

Other small changes addressing comments in the PR.

PHPBB3-10929
[feature/attachment-improvements] Brought JS file in-line with guidelines

Added doc blocks and adjusted the code in plupload.js to adhere to the coding
guidelines.

PHPBB3-10929
[feature/attachment-improvements] Improved readability of JS

Also changed the capitalisation of the custom plupload header to make it
consistent with other custom header uses.

PHPBB3-10929
[feature/attachment-improvements] Better doc blocks added to plupload.js

The doc blocks in plupload.js now contain @param and @return information.

Coding style was also updated in line with new Javascript coding guidelines.

PHPBB3-10929
[feature/attachment-improvements] 'Silent' error messages added

Upload errors no longer use alert() immediately and instead fail silently
with an indication of said failure. The error message is displayed on a user's
click.

PHPBB3-10929
[feature/attachment-improvements] Can now submit posts with attachments

Attachments uploaded with plupload now persist over save/preview/submit
actions.

PHPBB3-10929
[feature/attachment-improvements] Prepended paths with $phpbb_root_path

PHPBB3-10929