20 $this->library =
$mgr->library;
23 $this->facetManager =
new FacetManager(
'facet_manager', $this->table);
36 $docWidth = $showUploadDetails ?
"40%" :
"80%";
38 $table =
new DataListView($this->mgr->documents,
"document_library");
40 ->column(
"Author",
"{author}",
true,
"width: 20%");
42 if ($showUploadDetails)
44 $table->column(
"Uploaded By",
"{Owner.first_name} {Owner.last_name}",
false,
"width: 20%; text-align: center")
45 ->column(
"Last Modified",
"{last_modified:short}",
false,
"width: 30%; text-align: center");
49 $table->emptyMessage =
"There are no matching documents";
67 if(checkRole($this->library->upload_files))
69 $details_icon =
"icon_edit.png";
70 $fn =
"editDocumentDetailsDialog";
74 $details_icon =
"icon_view.png";
75 $fn =
"showDocumentDetailsDialog";
78 $titleText =
Settings::getValue(
"document",
"link_to_details") ?
"<a class='document_title' href='document_details?document_id={document_id}'>{title}</a>" :
79 "<span class='document_title'>{title}</span>";
81 $details_link =
"<a href=\"edit_document?document_id={document_id}\" onclick=\"documentMgr.{$fn}({document_id}); return false;\"><img src=\"/fakoli/images/{$details_icon}\" style=\"border: none;display: inline-block;vertical-align: middle;padding-right: 4px\"></a>\n";
83 if(checkRole($this->library->delete_files))
85 $delete_link .=
"<a href=\"delete_document?document_id={document_id}\" onclick=\"documentMgr.deleteFile({document_id}); return false;\"><img alt=\"delete\" src=\"/fakoli/images/icon_delete_trash.png\"></a>\n";
88 return $document->format(
"$titleText<br/><img style='display:inline-block;vertical-align: middle' src='$icon' alt='$type'/> <a href='/action/document/download?document_id={document_id}'>Download</a> $size <span style='display: inline-block'> {$details_link} {$delete_link}</span>");
93 $script .= $this->facetManager->writeScript();
94 $script .= $this->table->writeScript();
98 <script type=
"text/javascript" src=
"/components/document/js/document_manager.js"></script>
99 <script type=
"text/javascript">
102 window.addEvent(
'domready',
function()
104 documentMgr =
new DocumentManager(<?php echo $this->library->document_library_id ?>);
108 function editResult(result)
110 documentMgr.editResult(result);
114 function uploadResult(responseText)
116 documentMgr.uploadResult(responseText);
128 $this->facetManager->drawForm();
129 $this->table->drawView();
136 if(!checkRole(
"admin") && !checkRole($this->library->upload_files))
141 echo
"<div id='document_library_button_row'>\n";
142 if (checkRole($this->library->upload_files))
144 echo
"<button id='upload' class='button' onclick='documentMgr.uploadFile()'>Upload a File...</button>\n";
147 if (checkRole(
"admin"))
149 echo
"<button id='rescan' class='button' onclick='documentMgr.rescanLibrary()'>Rescan</button>\n";
157 $facet =
new MultiSelectFacetFilter(
"owner_id", array(
Document =>
"{Owner.first_name} {Owner.last_name}"));
159 $facet->dropdownMaxWidth =
"160px";
160 $facet->width =
"200px";
161 $facet->height =
"240px";
179 $table =
new DataListView(
$libraries,
"libraries");
181 ->column(
"Identifier",
"{identifier}",
true,
"width: 15%")
182 ->column(
"Owner",
"{getOwnerName()}",
true,
"width: 20%")
183 ->column(
"# Docs",
"{countDocuments()}",
true,
"width: 15%;text-align: right");
188 $table->emptyMessage =
"No Document Libraries have been created.";
195 return $library->format(
"<a href='document_library_form?document_library_id={document_library_id}'>{name}</a>{description}");
200 return $this->table->writeScript();
205 $this->table->drawView();
218 return $library->format(
"<a href='/admin/document_library_form?document_library_id={document_library_id}'>{name}</a>{description}");
if(! $document_library_id) $library
AdminDocumentLibraryListView($libraries)
formatTitleLink($library)
This class maps the publication table.
formatTitleLink($library)
DocumentLibraryListView($libraries)
formatDocumentTitle($document)
The DocumentManager class provides the core API and management functions for uploading documents and ...
static usingFeature()
Uses the specified framework feature(s).
static using()
Import the datamodels, views and manifest for the specified component(s).
static getValue($component, $name)
Retrieve the value of the specified Setting.
static addFacets($manager, $classes, $dropdown=true, $max_width="200px", $width="200px", $height="120px")
if(! $document_id) $document
$table column("Redirect From", "<a href='redirect_form?redirect_id={redirect_id}'>{redirect_from}</a>", true, "width: 30%") -> column("Redirect To", "<a href='{redirect_to}' target='_blank'>{redirect_to}</a>", true, "width: 30%") ->column("Last Modified", "{last_modified}", true, "width: 20%; text-align: center") ->column("Override", "{ override true