preliminary TOC working
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Nov 2005 19:05:38 +0000 (19:05 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Nov 2005 19:05:38 +0000 (19:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2077 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/AddedContent.pm
Open-ILS/web/opac/skin/default/js/rdetail.js

index 5327c68..2066cc7 100644 (file)
@@ -164,12 +164,13 @@ sub toc {
        my $doc = XML::LibXML->new->parse_string($data);
        my $ret = {};
 
-       my $reviews = $doc->findnodes("//*[local-name()='Review']");
-
-       # XXX
-       $ret->{text} = $reviews->toString();
+       my @nodes =  $doc->findnodes("//*[local-name()='TOCText']")->get_nodelist();
+               
+       if($nodes[0]) {
+               return $nodes[0]->textContent;
+       }
 
-       return $ret;
+       return "";
 }
 
 
index a2c6394..1493f5b 100644 (file)
@@ -115,7 +115,7 @@ function rdetailShowExtra(type) {
        switch(type) {
                case "copyinfo": unHideMe($('rdetail_copy_info_div')); break;
                case "reviews": unHideMe($('rdetail_reviews_div')); break;
-               case "tocs": unHideMe($('rdetail_tocs_div')); break;
+               case "toc": unHideMe($('rdetail_toc_div')); break;
        }
 }
 
@@ -159,7 +159,7 @@ function rdetailShowTOC(r) {
        var resp = r.getResultObject();
        if(resp) {
                unHideMe($('rdetail_toc_link'));
-               $('rdetail_toc_div').appendChild(text(resp));
+               $('rdetail_toc_div').innerHTML = resp;
        }
 }