57 $document->filter =
new InclusionFilter(
"document_id",
"title",
"notes",
"keywords",
"file",
"author",
"publication_date",
"document_library_id",
"owner_id",
"allow_access");
59 $form =
new AutoForm(
$document,
"POST",
"/action/document/upload?document_library_id=$document_library_id");
60 $form->ajaxSubmit(
"function(result) {uploadResult(result);}",
"function() {document.id('{$form->id}_error').set('text','Failed to communicate with server'); }");
61 $form->hide(
"document_library_id",
"owner_id");
62 $form->required(
"title");
63 $form->validator->add(
new RequiredFileValidator(
"file",
"File",
"You must select a file to upload."));
64 $form->annotate(
"keywords",
"Separate keywords with a comma");
65 $form->getRenderer(
"title")->autocomplete =
false;
84 if (!
$_POST[
"publication_date"])
$_POST[
"publication_date"] = date(
"m/d/Y");
98 echo
$form->writeScript();
This class maps the publication table.
The DocumentManager class provides the core API and management functions for uploading documents and ...
static getMaxUploadSize()
Returns the maximum allowed file upload size in human-readable format.
static using()
Import the datamodels, views and manifest for the specified component(s).
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
static usingFile()
Uses the specified framework file(s) from the framework directory.
Constructs a folder selection tree for the specified document library.
static addTaxonomyFieldRenderers($form, $showSelectAll=true, $group=null, $limitTo=null)
$method
Pull out a simple reference to the request method.
uploadLibraryFile($field, $document)
if(!checkRole($library->allow_access) &&! $library->allowAccess()) $document
if($folder_select) $fileUpload
if(! $document_library_id) global $library