viewer.php
) offer pop-up boxes to add new contentdoAddContent.php
scriptdoAddContent.php
) contacts:uploader
module to take care of the actual uploadcore
module, to handle permissions, resource usage, setting the position of the uploaded item on the page, and to command the individual content-specific plugin to do its own management (such as maintaining a table of items and their metadata, creating thumbnails of uploaded images, etc.)
viewer.php
) instantiates the core module (aka the orchestrator module), which in turn initiates all plugins and other modulesaddItemList
, with the position in the page passed as argumentaddItemList
toggles the reveal/hide a box used to add Content Items. The box's ID is addItem_n
for some n, where n is the position on the page. The reveal/hiding toggling is handled by the JavaScript function toggleBlockElement
addBlock
; it primarily contains HTML links (one per type of content item) that invoke JavaScript functions or PHP scriptsaddItem
, with 2 arguments: the ID of the pop-up box (representing the position in the page where to insert the new item) and the code for the plugin that handles that particular content type. For example, for document upload, the involved plugin is "documents", with plugin code "d"addItem
uses XMLHttpRequest to contact the pluginHandler.php
script on the server. Various arguments are passed, including the code for the plugin type (for example "d" for "documents") and the method to use, which for uploading is addContentModule
pluginHandler.php
script on the server receives the XMLHttpRequest, then selects the appropriate plugin (for example "documents") and invokes the passed method (addContentModule
). Each content plugin that provides file upload must implement method by that name: it generates and returns an HTM form to upload files specific to that plugin typepluginHandler.php
), and passed through XMLHttpRequest to the invoking JavaScript, which inserts the HTML form on the page<form>
tag with class='dropzone' id='myDropzone_pluginCode'
, where pluginCode varies by plugin. The dropzone elements are used to interface with the dropzone software, which handles the front-end of the uploads, including the drag-and-drop graphicsdoAddContent.php
script. It contacts the uploader
module, which receives and processes the file just uploaded to the server. The uploader also accepts a customizable function, named nameHandler
, provided by the calling code in the doAddContent.php
scriptnameHandler
, is where plugin-specific actions take place. The nameMapping
method of the plugin in question (for example, "documents") is invoked – the plugins decides what name to store the file under. Next, the addNewContentItem
method of the core module is invoked, with information about the just-uploaded file (such as its type, size and the original file name.)addNewContentItem
method of the core module (in the file siteInitialization.php
) performs various actions:isAddAllowed
)permissions
module and categories
module to set the permissions of the newly-uploaded content object (new uploads inherit the permissions of the Category they are uploaded into)resourceUsage
module to store the filesizecategories
module to insert the new object in the specified position in the Category it was uploaded intoaddObject
method of the particular plugin in question, to let the plugin take care of accepting the uploaded content item. Arguments passed include the metadata and the full name of the temporary file being used for the upload (e.g. "/tmp/phpE2qaT3") – since the upload process has not yet been completedaddObject
methods:uploader
module, and the upload is completed!This item is attached to the following categories: “Content Management (v. 4)(Controls, Adding Content, Uploading Files, etc)”