hholzgra                Mon Jan 16 10:37:59 2006 UTC

  Modified files:              
    /phpdoc/xsl html-chunk.xsl 
  Log:
  determine default role for <function> depending on the manual part we're in
  
  
http://cvs.php.net/viewcvs.cgi/phpdoc/xsl/html-chunk.xsl?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc/xsl/html-chunk.xsl
diff -u phpdoc/xsl/html-chunk.xsl:1.3 phpdoc/xsl/html-chunk.xsl:1.4
--- phpdoc/xsl/html-chunk.xsl:1.3       Mon Jan 16 01:27:14 2006
+++ phpdoc/xsl/html-chunk.xsl   Mon Jan 16 10:37:59 2006
@@ -3,7 +3,7 @@
 
   html-common.xsl: Common HTML customizations
 
-  $Id: html-chunk.xsl,v 1.3 2006/01/16 01:27:14 hholzgra Exp $
+  $Id: html-chunk.xsl,v 1.4 2006/01/16 10:37:59 hholzgra Exp $
 
 -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -70,31 +70,48 @@
     <xsl:value-of select="translate(translate(string(current()),'_','-'),
                       
'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
   </xsl:variable>
+  <xsl:variable name="rolename">
+   <xsl:choose>
+    <xsl:when test="./@role">
+     <xsl:copy-of select="string(./@role)"/>
+    </xsl:when>
+    <xsl:when test="ancestor::[EMAIL PROTECTED]'zend'] or ancestor::[EMAIL 
PROTECTED]'tsrm']">
+     <xsl:choose>
+      <xsl:when test="string(current()) = translate(string(current()),
+                                                    
'abcdefghijklmnopqrstuvwxyz',
+                                                    
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')">
+       <xsl:copy-of select="'zend-macro'"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:copy-of select="'zend-api'"/>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:copy-of select="'php'"/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:variable>
   <xsl:variable name="targetid">
    <xsl:choose>
-    <xsl:when test="./@role='php'">
+    <xsl:when test="$rolename='php'">
      <xsl:if test="count(//[EMAIL PROTECTED]('function.',$idbase)])>0">
-         <xsl:copy-of select="concat('function.',$idbase)"/>
+      <xsl:copy-of select="concat('function.',$idbase)"/>
      </xsl:if>
-       </xsl:when>
-    <xsl:when test="./@role='zend-api'">
+    </xsl:when>
+    <xsl:when test="$rolename='zend-api'">
      <xsl:if test="count(//[EMAIL PROTECTED]('zend-api.',$idbase)])>0">
-         <xsl:copy-of select="concat('zend-api.',$idbase)"/>
+      <xsl:copy-of select="concat('zend-api.',$idbase)"/>
      </xsl:if>
-       </xsl:when>
-    <xsl:when test="./@role='zend-macro'">
+    </xsl:when>
+    <xsl:when test="$rolename='zend-macro'">
      <xsl:if test="count(//[EMAIL PROTECTED]('zend-macro.',$idbase)])>0">
-         <xsl:copy-of select="concat('zend-macro.',$idbase)"/>
+      <xsl:copy-of select="concat('zend-macro.',$idbase)"/>
      </xsl:if>
-       </xsl:when>
-    <xsl:when test="./@role='libc'">
+    </xsl:when>
+    <xsl:when test="$rolename='libc'">
      <xsl:copy-of 
select="concat('http://www.opengroup.org/onlinepubs/007908799/xsh/',string(current()))"/>
-       </xsl:when>
-    <xsl:otherwise>
-     <xsl:if test="count(//[EMAIL PROTECTED]('function.',$idbase)])>0">
-         <xsl:copy-of select="concat('function.',$idbase)"/>
-     </xsl:if>
-       </xsl:otherwise>
+    </xsl:when>
    </xsl:choose>
   </xsl:variable>
   <xsl:choose>

Reply via email to