add div.statusbar-container, remove old code, make drag&drop work

This commit is contained in:
Uwe Steinmann 2019-07-12 16:43:34 +02:00
parent 9579c0480b
commit 19f5990080

View File

@ -128,6 +128,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
$this->params['session']->clearSplashMsg();
echo "<div class=\"splash\" data-type=\"".$flashmsg['type']."\"".(!empty($flashmsg['timeout']) ? ' data-timeout="'.$flashmsg['timeout'].'"': '').">".$flashmsg['msg']."</div>\n";
}
echo "<div class=\"statusbar-container\"><h1>".getMLText('recent_uploads')."</h1></div>\n";
foreach($hookObjs as $hookObj) {
if (method_exists($hookObj, 'startBody')) {
$hookObj->startBody($this);
@ -398,7 +399,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
for ($i = 0; $i < count($path); $i++) {
$txtpath .= "<li>";
if ($i +1 < count($path)) {
$txtpath .= "<a href=\"../out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" class=\"table-row-folder droptarget\" formtoken=\"".createFormKey('movefolder')."\">".
$txtpath .= "<a href=\"../out/out.ViewFolder.php?folderid=".$path[$i]->getID()."&showtree=".showtree()."\" data-droptarget=\"folder_".$path[$i]->getID()."\" rel=\"folder_".$path[$i]->getID()."\" class=\"table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">".
htmlspecialchars($path[$i]->getName())."</a>";
}
else {
@ -1675,7 +1676,7 @@ $(function() {
onCreateLi: function(node, $li) {
// Add 'icon' span before title
if(node.is_folder)
$li.find('.jqtree-title').before('<i class="icon-folder-close-alt table-row-folder droptarget" data-droptarget="folder_' + node.id + '" rel="folder_' + node.id + '"></i> ').attr('rel', 'folder_' + node.id).attr('formtoken', '<?php echo createFormKey('movefolder'); ?>').attr('data-uploadformtoken', '<?php echo createFormKey('adddocument'); ?>');
$li.find('.jqtree-title').before('<i class="icon-folder-close-alt table-row-folder droptarget" data-droptarget="folder_' + node.id + '" rel="folder_' + node.id + '"></i> ').attr('rel', 'folder_' + node.id).attr('formtoken', '<?php echo createFormKey(''); ?>').attr('data-uploadformtoken', '<?php echo createFormKey(''); ?>');
else
$li.find('.jqtree-title').before('<i class="icon-file"></i> ');
}
@ -2174,9 +2175,15 @@ $(document).ready( function() {
";
} /* }}} */
function documentListRowStart($document) { /* {{{ */
/**
* Start the row for a folder in list of documents and folders
*
* For a detailed description see
* {@link SeedDMS_Bootstrap_Style::folderListRowStart()}
*/
function documentListRowStart($document, $class='') { /* {{{ */
$docID = $document->getID();
return "<tr id=\"table-row-document-".$docID."\" class=\"table-row-document droptarget\" data-droptarget=\"document_".$docID."\" rel=\"document_".$docID."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
return "<tr id=\"table-row-document-".$docID."\" class=\"table-row-document droptarget ".($class ? ' '.$class : '')."\" data-droptarget=\"document_".$docID."\" rel=\"document_".$docID."\" formtoken=\"".createFormKey('')."\" draggable=\"true\">";
} /* }}} */
function documentListRowEnd($document) { /* {{{ */
@ -2316,8 +2323,40 @@ $(document).ready( function() {
return $content;
} /* }}} */
function folderListRowStart($folder) { /* {{{ */
return "<tr id=\"table-row-folder-".$folder->getID()."\" draggable=\"true\" data-droptarget=\"folder_".$folder->getID()."\" rel=\"folder_".$folder->getID()."\" class=\"folder table-row-folder droptarget\" data-uploadformtoken=\"".createFormKey('adddocument')."\" formtoken=\"".createFormKey('movefolder')."\">";
/**
* Start the row for a folder in list of documents and folders
*
* This method creates the starting tr tag for a new table row containing
* a folder list entry. The tr tag contains various attributes which are
* used for removing the table line and to make drap&drop work.
*
* id=table-row-folder-<id> : used for identifying the row when removing the table
* row after deletion of the folder by clicking on the delete button in that table
* row.
* data-droptarget=folder_<id> : identifies the folder represented by this row
* when it used as a target of the drag&drop operation.
* If an element (either a file or a dragged item) is dropped on this row, the
* data-droptarget will be evaluated to identify the underlying dms object.
* Dropping a file on a folder will upload that file into the folder. Droping
* an item (which is currently either a document or a folder) from the page will
* move that item into the folder.
* rel=folder_<id> : This data is put into drag data when a drag starts. When the
* item is dropped on some other item this data will identify the source object.
* The attributes data-droptarget and rel are usually equal. At least there is
* currently no scenario where they are different.
* formtoken=<token> : token made of key 'movefolder'
* formtoken is also placed in the drag data just like the value of attibute 'rel'.
* This is always set to a value made of 'movefolder'.
* data-uploadformtoken=<token> : token made of key 'adddocument'
* class=table-row-folder : The class must have a class named 'table-row-folder' in
* order to be draggable and to extract the drag data from the attributes 'rel' and
* 'formtoken'
*
* @param object $folder
* @return string starting tr tag for a table
*/
function folderListRowStart($folder, $class='') { /* {{{ */
return "<tr id=\"table-row-folder-".$folder->getID()."\" draggable=\"true\" data-droptarget=\"folder_".$folder->getID()."\" rel=\"folder_".$folder->getID()."\" class=\"folder table-row-folder droptarget".($class ? ' '.$class : '')."\" data-uploadformtoken=\"".createFormKey('')."\" formtoken=\"".createFormKey('')."\">";
} /* }}} */
function folderListRowEnd($folder) { /* {{{ */