Revision: 59 Author: matt Date: 2006-08-07 18:08:00 +0000 (Mon, 07 Aug 2006)
Log Message: ----------- Get stylesheets from a dot-dir so it's hidden. Use uri at root of XML for breadcrumbs Modified Paths: -------------- trunk/plugins/demo/gallery Added Paths: ----------- trunk/demo/gallery/.stylesheets/ Removed Paths: ------------- trunk/demo/gallery/stylesheets/ Copied: trunk/demo/gallery/.stylesheets (from rev 56, trunk/demo/gallery/stylesheets) Modified: trunk/plugins/demo/gallery =================================================================== --- trunk/plugins/demo/gallery 2006-08-07 18:06:27 UTC (rev 58) +++ trunk/plugins/demo/gallery 2006-08-07 18:08:00 UTC (rev 59) @@ -296,7 +296,7 @@ } my $out = $input->transform( - XSLT($self->config->docroot . '/stylesheets/imagesheet2html.xsl', + XSLT($self->config->docroot . '/.stylesheets/imagesheet2html.xsl', $prev ? ('prev' => uri_encode($prev)) : (), $next ? ('next' => uri_encode($next)) : (), ) @@ -477,7 +477,7 @@ } my $out = $input->transform( - XSLT($self->config->docroot . "/stylesheets/filelist2proofsheet.xsl") + XSLT($self->config->docroot . "/.stylesheets/filelist2proofsheet.xsl") ); # Now we have the full proofsheet, we need to trim it down to just the @@ -528,20 +528,21 @@ } split(/\//, $uri)); my $dirpath = $self->client->headers_in->filename(); + print "URI: $uri\n"; my $mm = File::MMagic->new; $self->log(LOGINFO, "Augmenting images info"); - for my $node ($dom->findnodes('//images/image')) { - $self->log(LOGINFO, "got an image"); + for my $node ($dom->findnodes('//images/image'), $dom->findnodes('//albums/album')) + { + $self->log(LOGINFO, "got an " . $node->nodeName); my $filename = $node->findnodes('./filename/text()'); $self->log(LOGINFO, "filename = $filename"); my $fullpath = catfile($dirpath, "$filename"); $self->log(LOGINFO, "fullpath = $fullpath"); my $ct = $mm->checktype_filename($fullpath); $node->appendWellBalancedChunk(<<EOXML); -<uri>$uri</uri> <dirpath>$dirpath</dirpath> <content-type>$ct</content-type> EOXML @@ -583,14 +584,17 @@ EOXML $dom->documentElement->firstChild->appendWellBalancedChunk($config_xml); - + $dom->documentElement->appendWellBalancedChunk("<uri>$uri</uri>"); + + print "Tranform: " . $dom->toString; + XML::LibXSLT->register_function("urn:ax-app-gallery", "epoch-to-date", sub { my $epoch = shift; my @p=gmtime($epoch); $p[4]++; $p[5]+=1900; return "$p[5]-$p[4]-$p[3]"; }); $out = $out->transform( - XSLT($self->config->docroot . '/stylesheets/proofsheet2html.xsl') + XSLT($self->config->docroot . '/.stylesheets/proofsheet2html.xsl') ); return OK, $out; -} \ No newline at end of file +}