diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php
index a437912d6..d9f2a8a0c 100644
--- a/views/bootstrap/class.Search.php
+++ b/views/bootstrap/class.Search.php
@@ -123,6 +123,20 @@ function typeahead() { /* {{{ */
echo json_encode($recs);
} /* }}} */
+ public function folderListHeaderName() { /* {{{ */
+ $orderby = $this->params['orderby'];
+ $fullsearch = $this->params['fullsearch'];
+ parse_str($_SERVER['QUERY_STRING'], $tmp);
+ $tmp['orderby'] = ($orderby=="n"||$orderby=="na") ? "nd" : "n";
+ $headcol = getMLText("name");
+ if(!$fullsearch) {
+ $headcol .= $orderby." ".($orderby=="n"||$orderby=="na"?' ':($orderby=="nd"?' ':' '))."";
+ $tmp['orderby'] = ($orderby=="d"||$orderby=="da") ? "dd" : "d";
+ $headcol .= " ".($orderby=="d"||$orderby=="da"?' ':($orderby=="dd"?' ':' '))."";
+ }
+ return $headcol;
+ } /* }}} */
+
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@@ -606,92 +620,89 @@ function typeahead() { /* {{{ */
// $this->contentContainerStart();
$txt = $this->callHook('searchListHeader', $orderby, 'asc');
- if(is_string($txt))
+ if(is_string($txt)) {
echo $txt;
- else {
- parse_str($_SERVER['QUERY_STRING'], $tmp);
- $tmp['orderby'] = ($orderby=="n"||$orderby=="na") ? "nd" : "n";
+ } elseif(is_array($txt)) {
print "
";
print "\n\n";
- print " | \n";
- print "".getMLText("name");
- if(!$fullsearch) {
- print $orderby." ".($orderby=="n"||$orderby=="na"?' ':($orderby=="nd"?' ':' '))."";
- $tmp['orderby'] = ($orderby=="d"||$orderby=="da") ? "dd" : "d";
- print " ".($orderby=="d"||$orderby=="da"?' ':($orderby=="dd"?' ':' '))."";
- }
- print " | \n";
- //print "".getMLText("attributes")." | \n";
- print "".getMLText("status")." | \n";
- print "".getMLText("action")." | \n";
- print "
\n\n\n";
+ foreach($txt as $headcol)
+ echo "".$headcol." | \n";
+ print "\n\n";
+ } else {
+ echo $this->folderListHeader(null, 'search');
+ /*
+ print "";
+ print "\n\n";
+ $headcols['image'] = $this->folderListHeaderImage();
+ $headcols['name'] = $this->folderListHeaderName();
+ $headcols['status'] = getMLText("status");
+ $headcols['action'] = getMLText("action");
+ foreach($headcols as $headcol)
+ echo "".$headcol." | \n";
+ print "
\n\n";
+ */
}
+ print "\n";
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile);
foreach ($entries as $entry) {
if($entry->isType('document')) {
- $txt = $this->callHook('documentListItem', $entry, $previewer, false, 'search');
+ $document = $entry;
+ if($lc = $document->getLatestContent())
+ $previewer->createPreview($lc);
+
+ $lcattributes = $lc ? $lc->getAttributes() : null;
+ $attrstr = '';
+ if($lcattributes) {
+ $attrstr .= "\n";
+ $attrstr .= "".getMLText('name')." | ".getMLText('attribute_value')." |
";
+ foreach($lcattributes as $lcattribute) {
+ $arr = $this->callHook('showDocumentContentAttribute', $lc, $lcattribute);
+ if(is_array($arr)) {
+ $attrstr .= "";
+ $attrstr .= "".$arr[0].": | ";
+ $attrstr .= "".$arr[1]." | ";
+ $attrstr .= "
";
+ } elseif(is_string($arr)) {
+ $attrstr .= $arr;
+ } else {
+ $attrdef = $lcattribute->getAttributeDefinition();
+ $attrstr .= "".htmlspecialchars($attrdef->getName())." | ".htmlspecialchars(implode(', ', $lcattribute->getValueAsArray()))." |
\n";
+ // TODO: better use printAttribute()
+ // $this->printAttribute($lcattribute);
+ }
+ }
+ $attrstr .= "
\n";
+ }
+ $docattributes = $document->getAttributes();
+ if($docattributes) {
+ $attrstr .= "\n";
+ $attrstr .= "".getMLText('name')." | ".getMLText('attribute_value')." |
";
+ foreach($docattributes as $docattribute) {
+ $arr = $this->callHook('showDocumentAttribute', $document, $docattribute);
+ if(is_array($arr)) {
+ $attrstr .= "";
+ $attrstr .= "".$arr[0].": | ";
+ $attrstr .= "".$arr[1]." | ";
+ $attrstr .= "
";
+ } elseif(is_string($arr)) {
+ $attrstr .= $arr;
+ } else {
+ $attrdef = $docattribute->getAttributeDefinition();
+ $attrstr .= "".htmlspecialchars($attrdef->getName())." | ".htmlspecialchars(implode(', ', $docattribute->getValueAsArray()))." |
\n";
+ }
+ }
+ $attrstr .= "
\n";
+ }
+ $extracontent = array();
+ $extracontent['below_title'] = $this->getListRowPath($document);
+ if($attrstr)
+ $extracontent['bottom_title'] = '
'.$this->printPopupBox(''.getMLText('attributes').'', $attrstr, true);
+
+ $txt = $this->callHook('documentListItem', $entry, $previewer, false, 'search', $extracontent);
if(is_string($txt))
echo $txt;
else {
- $document = $entry;
- $owner = $document->getOwner();
- if($lc = $document->getLatestContent())
- $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) . "...";
-
- $lcattributes = $lc ? $lc->getAttributes() : null;
- $attrstr = '';
- if($lcattributes) {
- $attrstr .= "\n";
- $attrstr .= "".getMLText('name')." | ".getMLText('attribute_value')." |
";
- foreach($lcattributes as $lcattribute) {
- $arr = $this->callHook('showDocumentContentAttribute', $lc, $lcattribute);
- if(is_array($arr)) {
- $attrstr .= "";
- $attrstr .= "".$arr[0].": | ";
- $attrstr .= "".$arr[1]." | ";
- $attrstr .= "
";
- } elseif(is_string($arr)) {
- $attrstr .= $arr;
- } else {
- $attrdef = $lcattribute->getAttributeDefinition();
- $attrstr .= "".htmlspecialchars($attrdef->getName())." | ".htmlspecialchars(implode(', ', $lcattribute->getValueAsArray()))." |
\n";
- // TODO: better use printAttribute()
- // $this->printAttribute($lcattribute);
- }
- }
- $attrstr .= "
\n";
- }
- $docattributes = $document->getAttributes();
- if($docattributes) {
- $attrstr .= "\n";
- $attrstr .= "".getMLText('name')." | ".getMLText('attribute_value')." |
";
- foreach($docattributes as $docattribute) {
- $arr = $this->callHook('showDocumentAttribute', $document, $docattribute);
- if(is_array($arr)) {
- $attrstr .= "";
- $attrstr .= "".$arr[0].": | ";
- $attrstr .= "".$arr[1]." | ";
- $attrstr .= "
";
- } elseif(is_string($arr)) {
- $attrstr .= $arr;
- } else {
- $attrdef = $docattribute->getAttributeDefinition();
- $attrstr .= "".htmlspecialchars($attrdef->getName())." | ".htmlspecialchars(implode(', ', $docattribute->getValueAsArray()))." |
\n";
- }
- }
- $attrstr .= "
\n";
- }
- $extracontent = array();
- $extracontent['below_title'] = $this->getListRowPath($document);
- if($attrstr)
- $extracontent['bottom_title'] = '
'.$this->printPopupBox(''.getMLText('attributes').'', $attrstr, true);
print $this->documentListRow($document, $previewer, false, 0, $extracontent);
}
} elseif($entry->isType('folder')) {
@@ -700,12 +711,6 @@ function typeahead() { /* {{{ */
echo $txt;
else {
$folder = $entry;
- $owner = $folder->getOwner();
- if (in_array(2, $searchin)) {
- $folderName = $this->markQuery(htmlspecialchars($folder->getName()), "i");
- } else {
- $folderName = htmlspecialchars($folder->getName());
- }
$attrstr = '';
$folderattributes = $folder->getAttributes();
diff --git a/views/bootstrap/class.ViewFolder.php b/views/bootstrap/class.ViewFolder.php
index ffd14c398..78d071436 100644
--- a/views/bootstrap/class.ViewFolder.php
+++ b/views/bootstrap/class.ViewFolder.php
@@ -382,7 +382,6 @@ $('body').on('click', '.order-btn', function(ev) {
if($documents === null)
$documents = $folder->getDocuments($orderby[0], $orderdir);
$documents = SeedDMS_Core_DMS::filterAccess($documents, $user, M_READ);
- $parent = $onepage ? $folder->getParent() : null;
$txt = $this->callHook('folderListPreContent', $folder, $subFolders, $documents);
if(is_string($txt))
@@ -390,23 +389,18 @@ $('body').on('click', '.order-btn', function(ev) {
$i = 0;
if ((count($subFolders) > 0)||(count($documents) > 0)){
$txt = $this->callHook('folderListHeader', $folder, $orderby, $orderdir);
- if(is_string($txt))
+ if(is_string($txt)) {
echo $txt;
- else {
+ } elseif(is_array($txt)) {
print "