goba            Fri Mar 15 08:42:23 2002 EDT

  Modified files:              
    /phpdoc/xsl phpweb.xsl.in 
  Log:
  PHPweb customizations seem to be OK. Test please on servers! 
  
  
Index: phpdoc/xsl/phpweb.xsl.in
diff -u phpdoc/xsl/phpweb.xsl.in:1.1 phpdoc/xsl/phpweb.xsl.in:1.2
--- phpdoc/xsl/phpweb.xsl.in:1.1        Fri Mar 15 07:34:27 2002
+++ phpdoc/xsl/phpweb.xsl.in    Fri Mar 15 08:42:23 2002
@@ -2,16 +2,14 @@
 <!-- 
 
   PHP.net web site specific stylesheet
-  [This is really a bare bones version of what the phpweb
-   sheets need to be. Needs much more logic!]
 
-  $Id: phpweb.xsl.in,v 1.1 2002/03/15 12:34:27 goba Exp $
+  $Id: phpweb.xsl.in,v 1.2 2002/03/15 13:42:23 goba Exp $
 
 -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 version="1.0">
 
-<xsl:import href="@DOCBOOKXSL_HTML@"/>
+<xsl:import href="file:///g:/phpcvs/phpdoc-tools/xsl/html/chunk.xsl"/>
 <xsl:include href="html-common.xsl"/>
 
 <xsl:param name="base.dir" select="'php/'"/>
@@ -20,28 +18,85 @@
 <xsl:param name="default.encoding" select="'@ENCODING@'"/>
 <xsl:param name="saxon.character.representation" select="'native'"/>
 
-<!-- Special PHP code navigation for generated pages --> 
+<!-- Special PHP code navigation for generated pages
+     Note: I have used xsl:text instead of
+     xsl:processing-instrunction, because the later
+     added > to end the PI, instead of ?> with saxon
+ --> 
 <xsl:template name="header.navigation">
-
- <xsl:processing-instruction name="php">
-require('shared-manual.inc');
-sendManualHeaders('@ENCODING@','@LANG@');
-// We need more navigation code here...
-  <xsl:text>manualHeader('</xsl:text>
+ <xsl:param name="prev" select="/foo"/>
+ <xsl:param name="next" select="/foo"/>
+ <xsl:variable name="home" select="/*[1]"/>
+ <xsl:variable name="up" select="parent::*"/>
+
+ <xsl:text disable-output-escaping="yes">&lt;?php
+  require('shared-manual.inc');
+  sendManualHeaders('@ENCODING@','@LANG@');
+  setupNavigation(array(
+    'home' =&gt; </xsl:text>
+ 
+ <xsl:call-template name="phpdoc.nav.array">
+  <xsl:with-param name="node" select="$home"/>
+ </xsl:call-template>
+  
+ <xsl:text disable-output-escaping="yes">,
+    'prev' =&gt; </xsl:text>
+
+ <xsl:call-template name="phpdoc.nav.array">
+  <xsl:with-param name="node" select="$prev"/>
+ </xsl:call-template>
+
+ <xsl:text disable-output-escaping="yes">,
+    'next' =&gt; </xsl:text>
+
+ <xsl:call-template name="phpdoc.nav.array">
+  <xsl:with-param name="node" select="$next"/>
+ </xsl:call-template>
+ 
+ <xsl:text disable-output-escaping="yes">,
+    'up' =&gt; </xsl:text>
+
+ <xsl:call-template name="phpdoc.nav.array">
+  <xsl:with-param name="node" select="$up"/>
+ </xsl:call-template>
+
+ <xsl:text disable-output-escaping="yes">,
+    'toc' =&gt; array(</xsl:text>
+ 
+ <xsl:for-each select="../*">
+  <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
+  <xsl:if test="$ischunk='1'">
+   <xsl:text>
+      </xsl:text>
+   <xsl:call-template name="phpdoc.nav.array">
+    <xsl:with-param name="node" select="."/>
+   </xsl:call-template>
+   <xsl:text>,</xsl:text>
+  </xsl:if>
+ </xsl:for-each>
+
+ <xsl:text>
+    )
+  ));
+  manualHeader('</xsl:text>
   <xsl:apply-templates select="." mode="phpdoc.object.title"/>
   <xsl:text>','</xsl:text>
   <xsl:call-template name="href.target">
    <xsl:with-param name="object" select="."/>
   </xsl:call-template>
   <xsl:text>');</xsl:text>
- </xsl:processing-instruction>
+<xsl:text disable-output-escaping="yes">
+?&gt;
+</xsl:text>
 
 </xsl:template>
 
-<!-- Special PHP code navigation for generated pages --> 
 <xsl:template name="footer.navigation">
 
- <xsl:processing-instruction name="php">
+<!-- Same as the manualHeader() call above -->
+<xsl:text disable-output-escaping="yes">
+&lt;?php
+</xsl:text>
   <xsl:text>manualFooter('</xsl:text>
   <xsl:apply-templates select="." mode="phpdoc.object.title"/>
   <xsl:text>','</xsl:text>
@@ -49,8 +104,41 @@
    <xsl:with-param name="object" select="."/>
   </xsl:call-template>
   <xsl:text>');</xsl:text>
- </xsl:processing-instruction>
+<xsl:text disable-output-escaping="yes">
+?&gt;
+</xsl:text>
+
+</xsl:template>
+
+<!-- Eliminate HTML from chunked file contents -->
+<xsl:template name="chunk-element-content">
+ <xsl:param name="prev"></xsl:param>
+ <xsl:param name="next"></xsl:param>
+
+ <xsl:call-template name="header.navigation">
+  <xsl:with-param name="prev" select="$prev"/>
+  <xsl:with-param name="next" select="$next"/>
+ </xsl:call-template>
+
+ <xsl:apply-imports/>
+
+ <xsl:call-template name="footer.navigation">
+  <xsl:with-param name="prev" select="$prev"/>
+  <xsl:with-param name="next" select="$next"/>
+ </xsl:call-template>
+
+</xsl:template>
 
+<!-- Prints out one PHP array with page name and title -->
+<xsl:template name="phpdoc.nav.array">
+ <xsl:param name="node" select="/foo"/>  
+ <xsl:text>array('</xsl:text>
+ <xsl:call-template name="href.target">
+  <xsl:with-param name="object" select="$node"/>
+ </xsl:call-template>
+ <xsl:text>','</xsl:text>
+ <xsl:apply-templates select="$node" mode="phpdoc.object.title"/>
+ <xsl:text>')</xsl:text>
 </xsl:template>
 
 </xsl:stylesheet>


Reply via email to