From 3da2a086fb696efcc6e86f81dc4a62de6f020e90 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 31 Jul 2013 21:44:46 +0200 Subject: [PATCH] call hook documentListItem --- views/bootstrap/class.Search.php | 173 ++++++++++++++++--------------- 1 file changed, 89 insertions(+), 84 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index adecc665c..ab359bd3d 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -327,95 +327,100 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style { $previewer = new SeedDMS_Preview_Previewer($cachedir, 40); foreach ($entries as $entry) { if(get_class($entry) == 'SeedDMS_Core_Document') { - $document = $entry; - $owner = $document->getOwner(); - $lc = $document->getLatestContent(); - $version = $lc->getVersion(); - $previewer->createPreview($lc); + $txt = $this->callHook('documentListItem', $entry, $previewer); + if(is_string($txt)) + echo $txt; + else { + $document = $entry; + $owner = $document->getOwner(); + $lc = $document->getLatestContent(); + $version = $lc->getVersion(); + $previewer->createPreview($lc); - if (in_array(3, $searchin)) - $comment = $this->markQuery(htmlspecialchars($document->getComment())); - else - $comment = htmlspecialchars($document->getComment()); - if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; - print ""; - //print ""; - if (in_array(2, $searchin)) { - $docName = $this->markQuery(htmlspecialchars($document->getName()), "i"); - } else { - $docName = htmlspecialchars($document->getName()); - } - print "getID()."\">"; - if($previewer->hasPreview($lc)) { - print "getID()."&version=".$lc->getVersion()."&width=40\" title=\"".htmlspecialchars($lc->getMimeType())."\">"; - } else { - print "getMimeIcon($lc->getFileType())."\" title=\"".htmlspecialchars($lc->getMimeType())."\">"; - } - print ""; - print "getID()."\">/"; - $folder = $document->getFolder(); - $path = $folder->getPath(); - for ($i = 1; $i < count($path); $i++) { - print htmlspecialchars($path[$i]->getName())."/"; - } - print $docName; - print ""; - print "
".getMLText('owner').": ".htmlspecialchars($owner->getFullName()).", ".getMLText('creation_date').": ".date('Y-m-d', $document->getDate()).", ".getMLText('version')." ".$version." - ".date('Y-m-d', $lc->getDate()).""; - if($comment) { - print "
".htmlspecialchars($comment).""; - } - print ""; - - print ""; - print "\n"; - print "\n"; - print ""; + print ""; + print "getID()."\">/"; + $folder = $document->getFolder(); + $path = $folder->getPath(); + for ($i = 1; $i < count($path); $i++) { + print htmlspecialchars($path[$i]->getName())."/"; + } + print $docName; + print ""; + print "
".getMLText('owner').": ".htmlspecialchars($owner->getFullName()).", ".getMLText('creation_date').": ".date('Y-m-d', $document->getDate()).", ".getMLText('version')." ".$version." - ".date('Y-m-d', $lc->getDate()).""; + if($comment) { + print "
".htmlspecialchars($comment).""; + } + print ""; - $display_status=$lc->getStatus(); - print "".getOverallStatusText($display_status["status"]). ""; - print ""; - print "
"; - if($document->getAccessMode($user) >= M_ALL) { -?> - - - -getAccessMode($user) >= M_READWRITE) { -?> - - - - - getID(); ?>" msg="" _href="../op/op.AddToClipboard.php?documentid=getID(); ?>&type=document&id=getID(); ?>&refferer=params['refferer']); ?>" title=""> -"; - print ""; + print ""; + print "\n"; + print "\n"; + print ""; - print "\n"; + $display_status=$lc->getStatus(); + print "".getOverallStatusText($display_status["status"]). ""; + print ""; + print "
"; + if($document->getAccessMode($user) >= M_ALL) { + ?> + + + + getAccessMode($user) >= M_READWRITE) { + ?> + + + + + getID(); ?>" msg="" _href="../op/op.AddToClipboard.php?documentid=getID(); ?>&type=document&id=getID(); ?>&refferer=params['refferer']); ?>" title=""> + "; + print ""; + + print "\n"; + } } elseif(get_class($entry) == 'SeedDMS_Core_Folder') { $folder = $entry; $owner = $folder->getOwner();