CMS  Version 3.9
edit.inc File Reference

Go to the source code of this file.

Functions

 onDeleteDocument (&$document)
 
 replaceLibraryFile ($field, $document)
 

Variables

 $document_id = checkNumeric($_GET["document_id"])
 
if(! $document_id$document = new Document($document_id)
 
 $library = $document->DocumentLibrary()
 
if(!checkRole($library->allow_access) &&! $library->allowAccess()) $document filter = new InclusionFilter("document_id", "title", "notes", "keywords", "image_id", "author", "file", "url", "allow_access", "publication_date", "publication")
 
 $form = new AutoForm($document, "POST", "/action/document/edit?document_id=$document_id")
 
 $fileUpload = new FileUploadFieldRenderer($form, "file_upload", "Replace File", replaceLibraryFile)
 
$form allowDelete = true
 
$form onDelete = onDeleteDocument
 
 $notes = $form->getRenderer("notes")
 
$notes colspan = 1
 
$notes columns = 38
 
 $allowAccessList = new CheckListFieldRenderer($form, "allow_access", "Allow Access", DocumentManager::getRoleOptions())
 
 if ( $method=="POST")
 

Function Documentation

◆ onDeleteDocument()

onDeleteDocument ( $document)

Definition at line 88 of file edit.inc.

89 {
90  $library = $document->DocumentLibrary();
92  $mgr->deleteDocument($document);
93 }
The DocumentManager class provides the core API and management functions for uploading documents and ...
if(! $document_id) $document
Definition: edit.inc:43
$library
Definition: edit.inc:44

◆ replaceLibraryFile()

replaceLibraryFile (   $field,
  $document 
)

Definition at line 95 of file edit.inc.

96 {
97  if (!$_FILES[$field] || !$_FILES[$field]["name"]) return;
98 
99  $library = $document->DocumentLibrary();
100 
102  $document->file = $mgr->uploadFile($field, dirname($document->file));
103 }

Variable Documentation

◆ $allowAccessList

$allowAccessList = new CheckListFieldRenderer($form, "allow_access", "Allow Access", DocumentManager::getRoleOptions())

Definition at line 69 of file edit.inc.

◆ $document

if (! $document_id) $document = new Document($document_id)

Definition at line 43 of file edit.inc.

◆ $document_id

$document_id = checkNumeric($_GET["document_id"])

Definition at line 37 of file edit.inc.

◆ $fileUpload

$fileUpload = new FileUploadFieldRenderer($form, "file_upload", "Replace File", replaceLibraryFile)

Definition at line 54 of file edit.inc.

◆ $form

$form = new AutoForm($document, "POST", "/action/document/edit?document_id=$document_id")

Definition at line 53 of file edit.inc.

◆ $library

$library = $document->DocumentLibrary()

Definition at line 44 of file edit.inc.

◆ $notes

$notes = $form->getRenderer("notes")

Definition at line 64 of file edit.inc.

◆ allowDelete

$form allowDelete = true

Definition at line 61 of file edit.inc.

◆ colspan

$notes colspan = 1

Definition at line 65 of file edit.inc.

◆ columns

$notes columns = 38

Definition at line 66 of file edit.inc.

◆ filter

if (!checkRole( $library->allow_access) &&! $library->allowAccess()) $document filter = new InclusionFilter("document_id", "title", "notes", "keywords", "image_id", "author", "file", "url", "allow_access", "publication_date", "publication")

Definition at line 51 of file edit.inc.

◆ if

if($method=="POST") (   $method = = "POST")

Definition at line 71 of file edit.inc.

◆ onDelete

$form onDelete = onDeleteDocument

Definition at line 62 of file edit.inc.