mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-21 17:11:38 +00:00
showing the clipboard will filter out those objects which are no longer available
This commit is contained in:
parent
a85a620d80
commit
3301dbeda5
|
@ -1237,68 +1237,77 @@ $(function() {
|
||||||
function mainClipboard($clipboard){ /* {{{ */
|
function mainClipboard($clipboard){ /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$content = '';
|
$content = '';
|
||||||
if(!$clipboard['docs'] && !$clipboard['folders']) {
|
$foldercount = $doccount = 0;
|
||||||
$content .= "<div class=\"alert\">".getMLText("drag_icon_here")."</div>";
|
if($clipboard['folders']) {
|
||||||
} else {
|
foreach($clipboard['folders'] as $folderid) {
|
||||||
$content .= "<table class=\"table\">";
|
/* FIXME: check for access rights, which could have changed after adding the folder to the clipboard */
|
||||||
if($clipboard['folders']) {
|
if($folder = $dms->getFolder($folderid)) {
|
||||||
foreach($clipboard['folders'] as $folderid) {
|
$comment = $folder->getComment();
|
||||||
if($folder = $dms->getFolder($folderid)) {
|
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
||||||
$comment = $folder->getComment();
|
$content .= "<tr rel=\"folder_".$folder->getID()."\" class=\"folder\" ondragover=\"allowDrop(event)\" ondrop=\"onDrop(event)\">";
|
||||||
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
$content .= "<td><a rel=\"folder_".$folder->getID()."\" draggable=\"true\" ondragstart=\"onDragStartFolder(event);\" href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".showtree()."\"><img draggable=\"false\" src=\"".$this->imgpath."folder.png\" width=\"24\" height=\"24\" border=0></a></td>\n";
|
||||||
$content .= "<tr rel=\"folder_".$folder->getID()."\" class=\"folder\" ondragover=\"allowDrop(event)\" ondrop=\"onDrop(event)\">";
|
$content .= "<td><a href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".showtree()."\">" . htmlspecialchars($folder->getName()) . "</a>";
|
||||||
$content .= "<td><a rel=\"folder_".$folder->getID()."\" draggable=\"true\" ondragstart=\"onDragStartFolder(event);\" href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".showtree()."\"><img draggable=\"false\" src=\"".$this->imgpath."folder.png\" width=\"24\" height=\"24\" border=0></a></td>\n";
|
if($comment) {
|
||||||
$content .= "<td><a href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".showtree()."\">" . htmlspecialchars($folder->getName()) . "</a>";
|
$content .= "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
||||||
|
}
|
||||||
|
$content .= "</td>\n";
|
||||||
|
$content .= "<td>\n";
|
||||||
|
$content .= "<div class=\"list-action\"><a class=\"removefromclipboard\" rel=\"F".$folderid."\" msg=\"".getMLText('splash_removed_from_clipboard')."\" _href=\"../op/op.RemoveFromClipboard.php?folderid=".(isset($this->params['folder']) ? $this->params['folder']->getID() : '')."&id=".$folderid."&type=folder\" title=\"".getMLText('rm_from_clipboard')."\"><i class=\"icon-remove\"></i></a></div>";
|
||||||
|
$content .= "</td>\n";
|
||||||
|
$content .= "</tr>\n";
|
||||||
|
$foldercount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($this->params['cachedir'], 40);
|
||||||
|
if($clipboard['docs']) {
|
||||||
|
foreach($clipboard['docs'] as $docid) {
|
||||||
|
/* FIXME: check for access rights, which could have changed after adding the document to the clipboard */
|
||||||
|
if($document = $dms->getDocument($docid)) {
|
||||||
|
$comment = $document->getComment();
|
||||||
|
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
||||||
|
if($latestContent = $document->getLatestContent()) {
|
||||||
|
$previewer->createPreview($latestContent);
|
||||||
|
$version = $latestContent->getVersion();
|
||||||
|
$status = $latestContent->getStatus();
|
||||||
|
|
||||||
|
$content .= "<tr>";
|
||||||
|
|
||||||
|
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||||
|
$content .= "<td><a rel=\"document_".$docid."\" draggable=\"true\" ondragstart=\"onDragStartDocument(event);\" href=\"../op/op.Download.php?documentid=".$docid."&version=".$version."\">";
|
||||||
|
if($previewer->hasPreview($latestContent)) {
|
||||||
|
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"40\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||||
|
} else {
|
||||||
|
$content .= "<img draggable=\"false\" class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||||
|
}
|
||||||
|
$content .= "</a></td>";
|
||||||
|
} else
|
||||||
|
$content .= "<td><img draggable=\"false\" class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></td>";
|
||||||
|
|
||||||
|
$content .= "<td><a href=\"out.ViewDocument.php?documentid=".$docid."&showtree=".showtree()."\">" . htmlspecialchars($document->getName()) . "</a>";
|
||||||
if($comment) {
|
if($comment) {
|
||||||
$content .= "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
$content .= "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
||||||
}
|
}
|
||||||
$content .= "</td>\n";
|
$content .= "</td>\n";
|
||||||
$content .= "<td>\n";
|
$content .= "<td>\n";
|
||||||
$content .= "<div class=\"list-action\"><a class=\"removefromclipboard\" rel=\"F".$folderid."\" msg=\"".getMLText('splash_removed_from_clipboard')."\" _href=\"../op/op.RemoveFromClipboard.php?folderid=".(isset($this->params['folder']) ? $this->params['folder']->getID() : '')."&id=".$folderid."&type=folder\" title=\"".getMLText('rm_from_clipboard')."\"><i class=\"icon-remove\"></i></a></div>";
|
$content .= "<div class=\"list-action\"><a class=\"removefromclipboard\" rel=\"D".$docid."\" msg=\"".getMLText('splash_removed_from_clipboard')."\" _href=\"../op/op.RemoveFromClipboard.php?folderid=".(isset($this->params['folder']) ? $this->params['folder']->getID() : '')."&id=".$docid."&type=document\" title=\"".getMLText('rm_from_clipboard')."\"><i class=\"icon-remove\"></i></a></div>";
|
||||||
$content .= "</td>\n";
|
$content .= "</td>\n";
|
||||||
$content .= "</tr>\n";
|
$content .= "</tr>";
|
||||||
|
$doccount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$previewer = new SeedDMS_Preview_Previewer($this->params['cachedir'], 40);
|
|
||||||
if($clipboard['docs']) {
|
|
||||||
foreach($clipboard['docs'] as $docid) {
|
|
||||||
if($document = $dms->getDocument($docid)) {
|
|
||||||
$comment = $document->getComment();
|
|
||||||
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
|
||||||
if($latestContent = $document->getLatestContent()) {
|
|
||||||
$previewer->createPreview($latestContent);
|
|
||||||
$version = $latestContent->getVersion();
|
|
||||||
$status = $latestContent->getStatus();
|
|
||||||
|
|
||||||
$content .= "<tr>";
|
|
||||||
|
|
||||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
|
||||||
$content .= "<td><a rel=\"document_".$docid."\" draggable=\"true\" ondragstart=\"onDragStartDocument(event);\" href=\"../op/op.Download.php?documentid=".$docid."&version=".$version."\">";
|
|
||||||
if($previewer->hasPreview($latestContent)) {
|
|
||||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"40\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
|
||||||
} else {
|
|
||||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
|
||||||
}
|
|
||||||
$content .= "</a></td>";
|
|
||||||
} else
|
|
||||||
$content .= "<td><img draggable=\"false\" class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></td>";
|
|
||||||
|
|
||||||
$content .= "<td><a href=\"out.ViewDocument.php?documentid=".$docid."&showtree=".showtree()."\">" . htmlspecialchars($document->getName()) . "</a>";
|
|
||||||
if($comment) {
|
|
||||||
$content .= "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
|
||||||
}
|
|
||||||
$content .= "</td>\n";
|
|
||||||
$content .= "<td>\n";
|
|
||||||
$content .= "<div class=\"list-action\"><a class=\"removefromclipboard\" rel=\"D".$docid."\" msg=\"".getMLText('splash_removed_from_clipboard')."\" _href=\"../op/op.RemoveFromClipboard.php?folderid=".(isset($this->params['folder']) ? $this->params['folder']->getID() : '')."&id=".$docid."&type=document\" title=\"".getMLText('rm_from_clipboard')."\"><i class=\"icon-remove\"></i></a></div>";
|
|
||||||
$content .= "</td>\n";
|
|
||||||
$content .= "</tr>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$content .= "</table>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* $foldercount or $doccount will only count objects which are
|
||||||
|
* actually available
|
||||||
|
*/
|
||||||
|
if($foldercount || $doccount) {
|
||||||
|
$content = "<table class=\"table\">".$content;
|
||||||
|
$content .= "</table>";
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
$content .= "<div class=\"alert\">".getMLText("drag_icon_here")."</div>";
|
||||||
return $content;
|
return $content;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -1309,7 +1318,7 @@ $(function() {
|
||||||
*/
|
*/
|
||||||
function printClipboard($clipboard){ /* {{{ */
|
function printClipboard($clipboard){ /* {{{ */
|
||||||
$this->contentHeading(getMLText("clipboard"), true);
|
$this->contentHeading(getMLText("clipboard"), true);
|
||||||
echo "<div id=\"main-clipboard\" class=\"well\" ondragover=\"allowDrop(event)\" ondrop=\"onAddClipboard(event)\">\n";
|
echo "<div id=\"main-clipboard\" _class=\"well\" ondragover=\"allowDrop(event)\" ondrop=\"onAddClipboard(event)\">\n";
|
||||||
echo $this->mainClipboard($clipboard);
|
echo $this->mainClipboard($clipboard);
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user