From 6ff71bdc09555b581b23ef375be672b435f9bbfe Mon Sep 17 00:00:00 2001 From: steinm Date: Mon, 4 Feb 2013 14:44:32 +0000 Subject: [PATCH] - show message when clipboard is empty --- views/bootstrap/class.Bootstrap.php | 106 +++++++++++++++------------- 1 file changed, 55 insertions(+), 51 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 82823ebd4..b38b75e49 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1011,67 +1011,71 @@ class LetoDMS_Bootstrap_Style extends LetoDMS_View_Common { echo "
\n"; $clipboard = $this->params['session']->getClipboard(); // print_r($clipboard); - print ""; - if($clipboard['folders']) { - //echo "\n"; - foreach($clipboard['folders'] as $folderid) { - 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 "\n"; - print "\n"; - print "\n"; - print "\n"; - } - } - } - $previewer = new LetoDMS_Preview_Previewer($this->params['cachedir'], 40); - if($clipboard['docs']) { - //echo "\n"; - 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(); - - print ""; - - if (file_exists($dms->contentDir . $latestContent->getPath())) { - print ""; - } else - print ""; - - print "
Folders
getID()."\" draggable=\"true\" ondragstart=\"onDragStartFolder(event);\" href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".$showtree."\">imgpath."folder.png\" width=\"24\" height=\"24\" border=0>getID()."&showtree=".$showtree."\">" . htmlspecialchars($folder->getName()) . ""; - if($comment) { - print "
".htmlspecialchars($comment).""; - } - print "
\n"; - print "params['folder']->getID()."&id=".$folderid."&type=folder\">"; - print "
Documents
"; - 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 "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">" . htmlspecialchars($document->getName()) . ""; + if(!$clipboard['docs'] && !$clipboard['folders']) { + print "
Drag icon of folder or document here!
"; + } else { + print ""; + if($clipboard['folders']) { + //echo "\n"; + foreach($clipboard['folders'] as $folderid) { + 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 "\n"; + print "\n"; print "\n"; - print ""; + print "\n"; } } } + $previewer = new LetoDMS_Preview_Previewer($this->params['cachedir'], 40); + if($clipboard['docs']) { + //echo "\n"; + 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(); + + print ""; + + if (file_exists($dms->contentDir . $latestContent->getPath())) { + print ""; + } else + print ""; + + print "\n"; + print "\n"; + print ""; + } + } + } + } + print "
Folders
getID()."\" draggable=\"true\" ondragstart=\"onDragStartFolder(event);\" href=\"out.ViewFolder.php?folderid=".$folder->getID()."&showtree=".$showtree."\">imgpath."folder.png\" width=\"24\" height=\"24\" border=0>getID()."&showtree=".$showtree."\">" . htmlspecialchars($folder->getName()) . ""; if($comment) { print "
".htmlspecialchars($comment).""; } print "
\n"; - print "params['folder']->getID()."&id=".$docid."&type=document\">"; + print "params['folder']->getID()."&id=".$folderid."&type=folder\">"; print "
Documents
"; + 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 "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">" . htmlspecialchars($document->getName()) . ""; + if($comment) { + print "
".htmlspecialchars($comment).""; + } + print "
\n"; + print "params['folder']->getID()."&id=".$docid."&type=document\">"; + print "
"; } - print "
"; echo "
\n"; } /* }}} */