Definition at line 9 of file document_file_view.inc.
◆ __construct()
DocumentFileView::__construct |
( |
|
$library, |
|
|
|
$id = "documents" |
|
) |
| |
◆ drawView()
DocumentFileView::drawView |
( |
| ) |
|
Definition at line 108 of file document_file_view.inc.
112 $documents = $this->library->Documents(
"ORDER BY title DESC");
116 $table->column(
"ID",
"{document_id}",
true);
117 $table->column(
"Title",
"<b><a href='#' onclick='editFile({document_id});return false'>{title}</b></a>",
true,
"width: 40%")
118 ->column(
"Author",
"{author}",
true,
"width: 35%")
119 ->column(
"Last Modified",
"{last_modified}",
true,
"width: 25%;text-align: center");
124 $table->excelFile =
"documents";
125 $table->emptyMessage =
"No Documents have been added yet.";
128 $table->showSelectAll =
true;
129 $contextMenu =
$table->commandMenu();
130 $contextMenu->command(
"move_documents",
"Move Documents...",
"moveDocuments({$this->library->document_library_id})",
false);
131 $contextMenu->command(
"delete_documents",
"Delete Documents",
"deleteDocuments({$this->library->document_library_id})",
false);
134 $script .=
$table->writeScript();
139 <a href=
"#" class=
"button" onclick=
"addFile(); return false"> Add a New
Document </a>
140 <a href=
'#' class=
'button' onclick=
'moveDocuments(); return false'> Move Documents... </a>
141 <a href=
'#' class=
'button' onclick=
'deleteDocuments(); return false'> Delete Documents </a>
This class maps the publication table.
◆ writeScript()
DocumentFileView::writeScript |
( |
| ) |
|
Definition at line 20 of file document_file_view.inc.
24 <script type=
"text/javascript">
27 modalPopup(
"Edit Document Properties",
"/action/document/edit?document_id=" +
id, 900,
'auto');
32 modalPopup(
"Add a New Document",
"/action/document/upload?document_library_id=<?echo $this->library->document_library_id?>", 900,
'auto');
35 function editResult(result)
39 window.location.reload();
43 document.id(
'Document_form__error').set({
'text': result,
'display':
'table-cell'});
47 function uploadResult(result)
51 window.location.reload();
55 document.id(
'Document_form__error').set({
'text': result,
'display':
'table-cell'});
59 function moveDocuments(document_library_id)
61 var table = document.id(<?php echo $this->
id?>);
62 var document_ids = [];
63 table.getElements(
"input[type=checkbox]:checked").each(
function(cbox)
65 document_ids.push(cbox.value);
68 document_ids = document_ids.join(
",");
69 modalPopup(
"Move Documents",
"/action/document/move_documents?document_library_id=" + document_library_id +
"&document_ids=" + document_ids,
"700px",
"auto",
true);
72 function moveDocumentsResponse(response)
76 window.location.reload();
80 notification(response);
84 function deleteDocuments(document_library_id)
86 if (confirm(
"Are you sure you want to delete the selected documents?\nThis operation cannot be undone."))
88 var table = document.id(<?php echo $this->
id?>);
89 var document_ids = [];
90 table.getElements(
"input[type=checkbox]:checked").each(
function(cbox)
92 document_ids.push(cbox.value);
95 document_ids = document_ids.join(
",");
96 go(
"/action/document/delete_documents?document_library_id=" + document_library_id +
"&document_ids=" + document_ids);
◆ $id
◆ $library
DocumentFileView::$library |
The documentation for this class was generated from the following file: