cvs: phpdoc /xsl phpweb.xsl

From: Date: Fri, 25 Apr 2003 20:05:01 +0000
Subject: cvs: phpdoc /xsl phpweb.xsl
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969352875@lists.php.net to get a copy of this message
goba Fri Apr 25 16:05:01 2003 EDT Modified files: /phpdoc/xsl phpweb.xsl Log: Use titleabbrev in sidebar lists if possible. If not, fall back to the real title. Index: phpdoc/xsl/phpweb.xsl diff -u phpdoc/xsl/phpweb.xsl:1.7 phpdoc/xsl/phpweb.xsl:1.8 --- phpdoc/xsl/phpweb.xsl:1.7 Fri Apr 25 14:43:58 2003 +++ phpdoc/xsl/phpweb.xsl Fri Apr 25 16:05:01 2003 @@ -3,7 +3,7 @@ PHP.net web site specific stylesheet - $Id: phpweb.xsl,v 1.7 2003/04/25 18:43:58 goba Exp $ + $Id: phpweb.xsl,v 1.8 2003/04/25 20:05:01 goba Exp $ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -77,6 +77,7 @@ </xsl:text> <xsl:call-template name="phpdoc.nav.array"> <xsl:with-param name="node" select="."/> + <xsl:with-param name="useabbrev" select="'1'"/> </xsl:call-template> <xsl:text>,</xsl:text> </xsl:if> @@ -126,9 +127,21 @@ <!-- Prints out one PHP array with page name and title --> <xsl:template name="phpdoc.nav.array"> <xsl:param name="node" select="/foo"/> + <xsl:param name="useabbrev" select="'0'"/> + + <!-- Get usual title --> <xsl:variable name="title"> <xsl:apply-templates select="$node" mode="phpdoc.object.title"/> </xsl:variable> + + <!-- Compute titleabbrev value --> + <xsl:variable name="titleabbrev"> + <xsl:if test="$useabbrev = '1' and string($node/titleabbrev) != ''"> + <xsl:value-of select="$node/titleabbrev" /> + </xsl:if> + </xsl:variable> + + <!-- Print out PHP array --> <xsl:text>array('</xsl:text> <xsl:choose> <!-- special handling for copyright, as we have it @@ -147,7 +160,16 @@ <!-- use the substring replace template defined in Docbook XSL's lib to escape apostrophes --> <xsl:call-template name="string.subst"> - <xsl:with-param name="string" select="$title"/> + <xsl:with-param name="string"> + <xsl:choose> + <xsl:when test="$titleabbrev != ''"> + <xsl:value-of select="$titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$title"/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> <xsl:with-param name="target" select='"&apos;"'/> <xsl:with-param name="replacement" select='"\&apos;"'/> </xsl:call-template>

« previous php.doc (#969352875) next »