diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 79ac853c1..566d25d7f 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1266,13 +1266,13 @@ $(function() { if (file_exists($dms->contentDir . $latestContent->getPath())) { print ""; if($previewer->hasPreview($latestContent)) { - print "getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + print "getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; } else { - print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; } print ""; } else - print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; print "" . htmlspecialchars($document->getName()) . ""; if($comment) { @@ -1292,17 +1292,56 @@ $(function() { echo "\n"; } /* }}} */ + /** + * Print button with link for deleting a document + * + * This button is used in document listings (e.g. on the ViewFolder page) + * for deleting a document. In seeddms version < 4.3.9 this was just a + * link to the out/out.RemoveDocument.php page which asks for confirmation + * an than calls op/op.RemoveDocument.php. Starting with version 4.3.9 + * the button just opens a small popup asking for confirmation and than + * calls the ajax command 'deletedocument'. The ajax call is called + * in the click function of 'button.removedocument'. That button needs + * to have two attributes: 'rel' for the id of the document, and 'msg' + * for the message shown by notify if the document could be deleted. + * + * @param object $document document to be deleted + * @param string $msg message shown in case of successful deletion + */ function printDeleteDocumentButton($document, $msg){ /* {{{ */ $docid = $document->getID(); ?> - + addFooterJS(" -$('#delete-btn-".$docid."').popover({ +$('#delete-document-btn-".$docid."').popover({ title: '".getMLText("rm_document")."', placement: 'left', html: true, - content: '
".getMLText("confirm_rm_document", array ("documentname" => htmlspecialchars($document->getName())))."
'}); + content: '
".getMLText("confirm_rm_document", array ("documentname" => htmlspecialchars($document->getName(), ENT_QUOTES)))."
'}); +"); + } /* }}} */ + + /** + * Print button with link for deleting a folder + * + * This button works like document delete button + * {@link SeedDMS_Bootstrap_Style::printDeleteDocumentButton()} + * + * @param object $folder folder to be deleted + * @param string $msg message shown in case of successful deletion + */ + function printDeleteFolderButton($folder, $msg){ /* {{{ */ + $folderid = $folder->getID(); +?> + +addFooterJS(" +$('#delete-folder-btn-".$folderid."').popover({ + title: '".getMLText("rm_folder")."', + placement: 'left', + html: true, + content: '
".getMLText("confirm_rm_folder", array ("foldername" => htmlspecialchars($folder->getName(), ENT_QUOTES)))."
'}); "); } /* }}} */