From d8f43bef3a7bc0636d0754c9fba64c76ac98680c Mon Sep 17 00:00:00 2001 From: steinm Date: Sat, 2 Feb 2013 15:58:52 +0000 Subject: [PATCH] - corrected output of clipboard --- views/bootstrap/class.Bootstrap.php | 92 +++++++++++++++-------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 91077f236..82823ebd4 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -338,8 +338,12 @@ class LetoDMS_Bootstrap_Style extends LetoDMS_View_Common { echo "\n"; return; } /* }}} */ @@ -1011,57 +1015,59 @@ class LetoDMS_Bootstrap_Style extends LetoDMS_View_Common { if($clipboard['folders']) { //echo "Folders\n"; foreach($clipboard['folders'] as $folderid) { - $folder = $dms->getFolder($folderid); - $comment = $folder->getComment(); - if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; - print "getID()."\" class=\"folder\" ondragover=\"allowDrop(event)\" ondrop=\"onDrop(event)\">"; - // print ""; - print "getID()."\" draggable=\"true\" ondragstart=\"onDragStartFolder(event);\" href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".$showtree."\">imgpath."folder.png\" width=\"24\" height=\"24\" border=0>\n"; - print "getID()."&showtree=".$showtree."\">" . htmlspecialchars($folder->getName()) . ""; - if($comment) { - print "
".htmlspecialchars($comment).""; + if($folder = $dms->getFolder($folderid)) { + $comment = $folder->getComment(); + if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; + print "getID()."\" class=\"folder\" ondragover=\"allowDrop(event)\" ondrop=\"onDrop(event)\">"; + // print ""; + print "getID()."\" draggable=\"true\" ondragstart=\"onDragStartFolder(event);\" href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".$showtree."\">imgpath."folder.png\" width=\"24\" height=\"24\" border=0>\n"; + print "getID()."&showtree=".$showtree."\">" . htmlspecialchars($folder->getName()) . ""; + if($comment) { + print "
".htmlspecialchars($comment).""; + } + print "\n"; + print "\n"; + print "params['folder']->getID()."&id=".$folderid."&type=folder\">"; + print "\n"; + print "\n"; } - print "\n"; - print "\n"; - print "params['folder']->getID()."&id=".$folderid."&type=folder\">"; - print "\n"; - print "\n"; } } $previewer = new LetoDMS_Preview_Previewer($this->params['cachedir'], 40); if($clipboard['docs']) { //echo "Documents\n"; foreach($clipboard['docs'] as $docid) { - $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(); - - print ""; + 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(); + + print ""; - if (file_exists($dms->contentDir . $latestContent->getPath())) { - print ""; - if($previewer->hasPreview($latestContent)) { - print "getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; - } else { - print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + if (file_exists($dms->contentDir . $latestContent->getPath())) { + print ""; + if($previewer->hasPreview($latestContent)) { + print "getID()."&version=".$latestContent->getVersion()."&width=40\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + } else { + print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + } + print ""; + } else + print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; + + print "" . htmlspecialchars($document->getName()) . ""; + if($comment) { + print "
".htmlspecialchars($comment).""; } - print ""; - } else - print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; - - print "" . htmlspecialchars($document->getName()) . ""; - if($comment) { - print "
".htmlspecialchars($comment).""; + print "\n"; + print "\n"; + print "params['folder']->getID()."&id=".$docid."&type=document\">"; + print "\n"; + print ""; } - print "\n"; - print "\n"; - print "params['folder']->getID()."&id=".$docid."&type=document\">"; - print "\n"; - print ""; } } }