]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/xslt/ls2theory.xsl
Major interface upgrade still going on. But we are approaching the end of the
[helm.git] / helm / on-line / xslt / ls2theory.xsl
index 210ab768bb8fff5d3c4a44265969587bd1014197..5e221bd07f0b8472d18ecb368194f678f556632c 100644 (file)
@@ -9,18 +9,23 @@
   <xsl:output method="html" encoding="iso-8859-1"/>
 
   <xsl:param name="CICURI" select="''" />
+  <xsl:param name="interfaceURL" select="''" />
 
   <xsl:template match="ls">
     <html>
       <head>
        <style>
-         li.section {
+         li.theory {
            list-style-image:
-             url(http://helm.cs.unibo.it/helm/icons/section.png)
+             url(<xsl:value-of select="$interfaceURL"/>/icons/theory.png)
+         }
+         li.folder {
+           list-style-image:
+             url(<xsl:value-of select="$interfaceURL"/>/icons/folder.png)
          }
          li.object {
            list-style-image:
-             url(http://helm.cs.unibo.it/helm/icons/object.png)
+             url(<xsl:value-of select="$interfaceURL"/>/icons/object.png)
          }
        </style>
       </head>
@@ -34,8 +39,8 @@
   </xsl:template>
 
   <xsl:template match="section">
-    <li class="section">
-      <a class="section" href="{concat($CICURI, text(), '/')}"
+    <li class="folder">
+      <a class="folder" href="{concat($CICURI, text(), '/')}"
        helm:helm_link="href">
        <xsl:value-of select="text()" />
       </a>
   </xsl:template>
 
   <xsl:template match="object">
-    <li class="object">
-      <a class="object" href="{concat($CICURI, @name)}" helm:helm_link="href">
-       <xsl:value-of select="@name" />
-      </a>
-    </li>
+    <xsl:choose>
+      <xsl:when test="substring-after(@name, '.')='theory'">
+       <li class="theory">
+         <a class="theory" href="{concat($CICURI, @name)}"
+           helm:helm_link="href">
+           <xsl:value-of select="@name" />
+         </a>
+       </li>
+      </xsl:when>
+      <xsl:otherwise>
+       <li class="object">
+         <a class="object"
+           href="{concat('cic:', substring-after($CICURI, ':'), @name)}"
+           helm:helm_link="href">
+           <xsl:value-of select="@name" />
+         </a>
+       </li>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
 </xsl:stylesheet>