Ignore:
Timestamp:
2009-07-14T09:09:40+12:00 (15 years ago)
Author:
oranfry
Message:

checking in a batch of changes to the oran skin. more work yet to do.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/interfaces/oran/transform/util.xsl

    r19856 r19988  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <xsl:stylesheet version="1.0" 
    3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     2<xsl:stylesheet version="1.0"
     3    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    44    xmlns:gslib="http://www.greenstone.org/XSL/Library"
    55    xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
     
    99  <xsl:param name="interface_name"/>
    1010  <xsl:param name="library_name"/>
    11  
     11
    1212  <!-- every pages ....................................................................... -->
    13  
     13    <xsl:template name="siteName"><xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteName']"/></xsl:template>
     14    <xsl:template name="siteLink"><a href="./"><xsl:call-template name="siteName"/></a></xsl:template>
     15
    1416    <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/>     </xsl:variable>
    1517    <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
     
    1820    <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
    1921
    20    
     22    <!-- template to get the name of the current collection -->
     23    <xsl:template name="collectionName">
     24        <xsl:choose>
     25            <xsl:when test="/page/pageResponse/collection"><xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/></xsl:when>
     26            <xsl:otherwise>All Collections</xsl:otherwise>
     27        </xsl:choose>
     28    </xsl:template>
     29
     30    <xsl:template name="collectionNameShort">
     31        <xsl:value-of select="/page/pageResponse/collection/@name"/>
     32    </xsl:template>
     33
     34    <xsl:template name="collectionNameLinked">
     35        <xsl:choose>
     36            <xsl:when test="/page/pageResponse/collection">
     37                <a>
     38                    <xsl:attribute name="href"><xsl:call-template name="siteURL"/><xsl:value-of select="$library_name"/>?a=p&amp;sa=about&amp;c=<xsl:call-template name="collectionNameShort"/></xsl:attribute>
     39                    <xsl:call-template name="collectionName"/>
     40                </a>
     41            </xsl:when>
     42            <xsl:otherwise>
     43                <a>
     44                    <xsl:attribute name="href"><xsl:call-template name="siteURL"/></xsl:attribute>
     45                    All Collections
     46                </a>
     47            </xsl:otherwise>
     48        </xsl:choose>
     49    </xsl:template>
     50
     51    <!-- text to get the name of the current service ("Browse","Search" etc) -->
     52    <xsl:template name="serviceName">
     53        <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
     54    </xsl:template>
     55
    2156    <xsl:template name="textDirectionAttribute">
    2257        <xsl:attribute name="dir">
     
    2459                <xsl:when test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:when>
    2560                <xsl:otherwise>ltr</xsl:otherwise>
    26             </xsl:choose> 
     61            </xsl:choose>
    2762        </xsl:attribute>
    28     </xsl:template> 
    29  
     63    </xsl:template>
     64
     65    <xsl:template name="actionClass">
     66        <xsl:attribute name="class"><xsl:value-of select="/page/pageRequest/@action"/>Action <xsl:if test="/page/pageRequest/@subaction"><xsl:value-of select="/page/pageRequest/@subaction"/>Subaction</xsl:if></xsl:attribute>
     67    </xsl:template>
     68
     69    <!-- username, if logged in -->
     70    <!--
     71    <xsl:template name="username">
     72        <xsl:if test="$un_s!=''">
     73            <xsl:if test="$asn!='' and $asn!='0'">
     74            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/>  :  <xsl:value-of select="$un_s"/>
     75            </xsl:if>
     76        </xsl:if>
     77    </xsl:template>
     78    -->
     79
    3080    <xsl:template name="defaultDividerBar">
    3181   <xsl:param name='text'/>
     
    3787     <div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
    3888      </xsl:otherwise>
    39     </xsl:choose> 
     89    </xsl:choose>
    4090  </xsl:template>
    41  
    42  
     91
     92
    4393    <xsl:template match="error">
    4494    Error: <xsl:value-of select="."/>
    4595  </xsl:template>
    46  
    47  
     96
     97
    4898<xsl:template name="displayErrorsIfAny">
    4999      <xsl:if test="descendant::error">
     
    67117          removeAllChildren(hide_link);
    68118          hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">"));
    69         } 
     119        }
    70120      }
    71121    </xsl:text>
     
    85135   
    86136    <xsl:template name="poweredByGS3TextBar">
    87         <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
    88     </xsl:template>
    89  
    90  
     137        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
     138    </xsl:template>
     139
     140    <xsl:template name="rightArrow"><xsl:text disable-output-escaping="yes"> &amp;raquo; </xsl:text></xsl:template>
     141
     142
     143
    91144    <!-- site home ....................................................................... -->
    92145
     
    100153     <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
    101154  </xsl:template>
    102  
    103  
    104155    <xsl:template name="crossCollectionQuickSearchForm">
    105156        <xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
    106     </xsl:template> 
     157    </xsl:template>
    107158   
    108159    <xsl:template match="service[@name='TextQuery']">
     
    127178            </xsl:when>
    128179            <xsl:otherwise>
    129                 <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"> 
     180                <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
    130181                    <xsl:value-of select="displayItem[@name='name']"/>
    131182                </a>
    132183            </xsl:otherwise>
    133         </xsl:choose> 
     184        </xsl:choose>
    134185    </xsl:template>
    135186
     
    137188    <xsl:template name="serviceClusterList">
    138189        <xsl:apply-templates select="serviceClusterList"/>
    139     </xsl:template> 
     190    </xsl:template>
    140191   
    141192      <xsl:template match="serviceClusterList">
    142         <xsl:for-each select="serviceCluster"> 
     193        <xsl:for-each select="serviceCluster">
    143194          <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
    144195        </xsl:for-each>
    145196      </xsl:template>
    146197
    147      
    148       <xsl:template name="serviceLink">
    149       <a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/>
    150       </xsl:template>
    151 
    152      
     198   
     199    <xsl:template name="serviceLink">
     200        <div class="paramLabel"><a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></div>
     201        <div class="paramValue"><xsl:value-of select="displayItem[@name='description']"/></div>
     202        <br class="clear"/>
     203    </xsl:template>
     204
     205
    153206   <xsl:template name="authenticationLink">
    154207   <xsl:for-each select="serviceList/service[@type='authen']">
    155208      <li><a href="{$library_name}?a=g&amp;rt=r&amp;sa=authen&amp;s={@name}&amp;s1.aup=Login&amp;s1.un=&amp;s1.asn="><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li></xsl:for-each>
    156   </xsl:template>
    157  
    158  
     209  </xsl:template>
    159210   <xsl:template name="libraryInterfaceLink">
    160211   <li><a href="{$library_name}?a=p&amp;sa=gli4gs3"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/></a></li>
    161   </xsl:template>
    162  
    163  
     212  </xsl:template>
    164213<xsl:template name="greenstoneLogoAlternateText">
    165214<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
     
    224273
    225274
    226 <xsl:template name="preferencesButtonTop">
    227     <xsl:choose>
    228       <xsl:when test="$pageType='pref'">
    229     <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
    230       </xsl:when>
    231       <xsl:otherwise>
    232     <li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
    233         <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
    234       </a></li>
    235       </xsl:otherwise>
    236     </xsl:choose>
    237 </xsl:template>
    238 
    239 <xsl:template name="servicesNavigationBar">
    240         <xsl:for-each select="$this-element/serviceList/service">
    241           <xsl:variable name="action"><xsl:choose>
    242           <xsl:when test="@name=$this-service">CURRENT</xsl:when>
    243           <xsl:when test="@type='query'">q</xsl:when>
    244           <xsl:when test="@type='browse'">b</xsl:when>
    245           <xsl:when test="@type='process'">pr</xsl:when>
    246           <xsl:when test="@type='applet'">a</xsl:when>
    247           <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
    248         </xsl:choose></xsl:variable>
    249           <xsl:choose>
    250         <xsl:when test="$action='CURRENT'">
    251           <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li>
    252         </xsl:when>
    253         <xsl:when test="$action !='DO_NOT_DISPLAY'">
    254           <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a></li>
    255         </xsl:when>
    256           </xsl:choose>
    257         </xsl:for-each>
    258 </xsl:template>
    259 
    260 
    261 <xsl:template name="collectionDescriptionTextAndServicesLinks">
    262     <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
    263 </xsl:template>
    264 
    265 <xsl:template match="collection|serviceCluster">
    266       <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
    267      
    268       <xsl:apply-templates select="serviceList">
    269     <xsl:with-param name="collName" select="$collName"/>
    270       </xsl:apply-templates>
    271 </xsl:template>
    272 
    273 
    274  <xsl:template match="serviceList">
    275     <xsl:param name="collName"/>
    276     <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3>
    277     <xsl:choose>
    278       <xsl:when test="service">
    279     <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
    280       </xsl:when>
    281       <xsl:otherwise>
    282     <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
    283       </xsl:otherwise>
    284     </xsl:choose>
    285    
    286    
    287     <xsl:if test="service">
    288       <ul id="servicelist">     
    289     <xsl:for-each select="service">
    290       <xsl:variable name="action"><xsl:choose>
    291           <xsl:when test="@type='query'">q</xsl:when>
    292           <xsl:when test="@type='browse'">b</xsl:when>
    293           <xsl:when test="@type='process'">pr</xsl:when>
    294           <xsl:when test="@type='applet'">a</xsl:when>
    295           <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
    296         </xsl:choose></xsl:variable>
    297       <xsl:if test="$action !='DO_NOT_DISPLAY'">
    298         <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li>
    299       </xsl:if>
    300     </xsl:for-each>
    301       </ul>
    302     </xsl:if>
    303   </xsl:template>
     275    <xsl:template name="preferencesButtonTop">
     276        <xsl:choose>
     277            <xsl:when test="$pageType='pref'">
     278                <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
     279            </xsl:when>
     280            <xsl:otherwise>
     281                <li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
     282                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
     283                </a></li>
     284            </xsl:otherwise>
     285        </xsl:choose>
     286    </xsl:template>
     287
     288    <xsl:template name="servicesNavigationBar">
     289        <xsl:for-each select="$this-element/serviceList/service">
     290            <xsl:variable name="action"><xsl:choose>
     291                <xsl:when test="@name=$this-service">CURRENT</xsl:when>
     292                <xsl:when test="@type='query'">q</xsl:when>
     293                <xsl:when test="@type='browse'">b</xsl:when>
     294                <xsl:when test="@type='process'">pr</xsl:when>
     295                <xsl:when test="@type='applet'">a</xsl:when>
     296                <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
     297            </xsl:choose></xsl:variable>
     298            <xsl:choose>
     299                <xsl:when test="$action='CURRENT'">
     300                    <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li>
     301                </xsl:when>
     302                <xsl:when test="$action !='DO_NOT_DISPLAY'">
     303                    <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a></li>
     304                </xsl:when>
     305            </xsl:choose>
     306        </xsl:for-each>
     307    </xsl:template>
     308
     309
     310    <xsl:template name="collectionDescriptionTextAndServicesLinks">
     311        <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
     312    </xsl:template>
     313
     314    <xsl:template match="collection|serviceCluster">
     315        <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
     316        <xsl:apply-templates select="serviceList">
     317            <xsl:with-param name="collName" select="$collName"/>
     318        </xsl:apply-templates>
     319    </xsl:template>
     320
     321
     322    <xsl:template match="serviceList">
     323        <xsl:param name="collName"/>
     324        <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3>
     325        <p>
     326            <xsl:choose>
     327                <xsl:when test="service">
     328                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
     329                </xsl:when>
     330                <xsl:otherwise>
     331                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
     332                </xsl:otherwise>
     333            </xsl:choose>
     334        </p>
     335
     336        <xsl:if test="service">
     337            <div id="servicelist">
     338                <xsl:for-each select="service">
     339                    <xsl:sort select="position()" order="descending" data-type="number"/>
     340
     341                    <xsl:variable name="action"><xsl:choose>
     342                        <xsl:when test="@type='query'">q</xsl:when>
     343                        <xsl:when test="@type='browse'">b</xsl:when>
     344                        <xsl:when test="@type='process'">pr</xsl:when>
     345                        <xsl:when test="@type='applet'">a</xsl:when>
     346                        <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
     347                    </xsl:choose></xsl:variable>
     348                    <xsl:if test="$action != 'DO_NOT_DISPLAY'">
     349                        <div class="paramLabel"><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="displayItem[@name='name']"/></a></div>
     350                        <div class="paramLabel"><xsl:value-of select="displayItem[@name='description']"/></div>
     351                        <br class="clear"/>
     352                    </xsl:if>
     353                </xsl:for-each>
     354            </div>
     355        </xsl:if>
     356    </xsl:template>
    304357
    305358
    306359
    307360<!-- classifier page ............................................................................ -->
    308 <xsl:template name="collectionName">
    309     <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>
    310 </xsl:template>
    311 
    312 <xsl:template name="collectionShortName">
    313     <xsl:value-of select="/page/pageResponse/collection/@name"/>
    314 </xsl:template>
     361
    315362
    316363<xsl:template name="navigationTab">
     
    351398</xsl:template>
    352399
     400<!-- query page ............................................................................ -->
     401
     402    <xsl:template name="indexName">
     403        <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
     404    </xsl:template>
     405
     406<xsl:template name="queryPageCollectionName">
     407    <xsl:choose><xsl:when test="/page/pageResponse/collection"><gslib:aboutCollectionPageTitle/></xsl:when><xsl:otherwise>Cross-Collection</xsl:otherwise></xsl:choose>
     408</xsl:template>
     409
     410
     411
     412
     413
    353414<!--
    354415BERRY BASKET TEMPLATES
     
    382443    <script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDOnTop.js"><xsl:text> </xsl:text></script>
    383444    <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket.js"><xsl:text> </xsl:text></script>
    384     <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/> 
     445    <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/>
    385446</xsl:template>
    386447
     
    445506
    446507
    447 
    448508</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.