mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-28 18:40:39 +00:00
add calling hook documentClipboardItem
This commit is contained in:
parent
79afdc7c55
commit
0f7df48c98
|
|
@ -1123,35 +1123,40 @@ $(function() {
|
||||||
//echo "<tr><th colspan=\"3\">Documents</th></tr>\n";
|
//echo "<tr><th colspan=\"3\">Documents</th></tr>\n";
|
||||||
foreach($clipboard['docs'] as $docid) {
|
foreach($clipboard['docs'] as $docid) {
|
||||||
if($document = $dms->getDocument($docid)) {
|
if($document = $dms->getDocument($docid)) {
|
||||||
$comment = $document->getComment();
|
$txt = $this->callHook('documentClipboardItem', $document, $previewer);
|
||||||
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
if(is_string($txt))
|
||||||
if($latestContent = $document->getLatestContent()) {
|
echo $txt;
|
||||||
$previewer->createPreview($latestContent);
|
else {
|
||||||
$version = $latestContent->getVersion();
|
$comment = $document->getComment();
|
||||||
$status = $latestContent->getStatus();
|
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
|
||||||
|
if($latestContent = $document->getLatestContent()) {
|
||||||
print "<tr>";
|
$previewer->createPreview($latestContent);
|
||||||
|
$version = $latestContent->getVersion();
|
||||||
|
$status = $latestContent->getStatus();
|
||||||
|
|
||||||
|
print "<tr>";
|
||||||
|
|
||||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||||
print "<td><a rel=\"document_".$docid."\" draggable=\"true\" ondragstart=\"onDragStartDocument(event);\" href=\"../op/op.Download.php?documentid=".$docid."&version=".$version."\">";
|
print "<td><a rel=\"document_".$docid."\" draggable=\"true\" ondragstart=\"onDragStartDocument(event);\" href=\"../op/op.Download.php?documentid=".$docid."&version=".$version."\">";
|
||||||
if($previewer->hasPreview($latestContent)) {
|
if($previewer->hasPreview($latestContent)) {
|
||||||
print "<img class=\"mimeicon\" width=\"40\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
print "<img class=\"mimeicon\" width=\"40\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||||
} else {
|
} else {
|
||||||
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||||
|
}
|
||||||
|
print "</a></td>";
|
||||||
|
} else
|
||||||
|
print "<td><img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></td>";
|
||||||
|
|
||||||
|
print "<td><a href=\"out.ViewDocument.php?documentid=".$docid."&showtree=".showtree()."\">" . htmlspecialchars($document->getName()) . "</a>";
|
||||||
|
if($comment) {
|
||||||
|
print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
||||||
}
|
}
|
||||||
print "</a></td>";
|
print "</td>\n";
|
||||||
} else
|
print "<td>\n";
|
||||||
print "<td><img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\"></td>";
|
print "<div class=\"list-action\"><a href=\"../op/op.RemoveFromClipboard.php?folderid=".$this->params['folder']->getID()."&id=".$docid."&type=document\" title=\"".getMLText('rm_from_clipboard')."\"><i class=\"icon-remove\"></i></a></div>";
|
||||||
|
print "</td>\n";
|
||||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$docid."&showtree=".showtree()."\">" . htmlspecialchars($document->getName()) . "</a>";
|
print "</tr>";
|
||||||
if($comment) {
|
|
||||||
print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
|
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
|
||||||
print "<td>\n";
|
|
||||||
print "<div class=\"list-action\"><a href=\"../op/op.RemoveFromClipboard.php?folderid=".$this->params['folder']->getID()."&id=".$docid."&type=document\" title=\"".getMLText('rm_from_clipboard')."\"><i class=\"icon-remove\"></i></a></div>";
|
|
||||||
print "</td>\n";
|
|
||||||
print "</tr>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user