Ignore:
Timestamp:
2016-05-16T14:24:50+12:00 (8 years ago)
Author:
Georgiy Litvinov
Message:

Added collection groups. Config file in web/sites/localsite/groupConfig.xml
PageAction now send request to CollectionGroups service to retrieve information about collections and groups.

Location:
main/trunk/greenstone3/web/interfaces/default/transform
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl

    r30478 r30540  
    199199      </input>
    200200    </form>
     201  </xsl:template>
     202 
     203  <xsl:template name="groupLinkWithImage">
     204    <xsl:variable name="desc"><xsl:value-of select="description"/></xsl:variable>
     205    <xsl:variable name="group_href"><xsl:value-of select="$library_name"/>?a=p&amp;sa=home&amp;group=<xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/<xsl:value-of select="@name"/></xsl:variable>
     206    <xsl:choose>
     207      <xsl:when test="backgroundImage">
     208        <a href="{$group_href}" title="{$desc}">
     209          <img class="groupLinkImage">
     210            <xsl:attribute name="alt"><xsl:value-of select="displayItem[@name='name']"/></xsl:attribute>
     211            <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/images/<xsl:value-of select="backgroundImage"/></xsl:attribute>
     212          </img>
     213        </a>
     214      </xsl:when>
     215      <xsl:otherwise>
     216        <a href="{$group_href}" title="{$desc}">
     217          <div class="groupLink ui-corner-all">
     218            <div class="groupLinkText ui-widget-content ui-corner-top">
     219                <xsl:value-of select="title"/>
     220            </div>
     221            <div style="height:15px;" class="ui-state-default ui-corner-bottom"><xsl:text> </xsl:text></div>
     222          </div>
     223        </a>
     224      </xsl:otherwise>
     225    </xsl:choose>
    201226  </xsl:template>
    202227 
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/home.xsl

    r30478 r30540  
    1515
    1616    <!-- set page breadcrumbs -->
    17     <xsl:template name="breadcrumbs"></xsl:template>
     17    <xsl:template name="breadcrumbs">
     18        <xsl:if test="/page/pageRequest/paramList/param[@name='group']">
     19            <gslib:siteLink/>
     20        </xsl:if>
     21    </xsl:template>
    1822
    1923    <!-- the page content -->
     
    2630        <h2><gslib:selectACollectionTextBar/></h2>
    2731
    28         <xsl:call-template name="collectionLinks"/>
    29 
     32        <xsl:for-each select="collectionList/collection|groupList/group">
     33                    <xsl:sort select="@position"/>
     34            <xsl:if test="name() = 'collection'">
     35                                <gslib:collectionLinkWithImage/>
     36            </xsl:if>
     37            <xsl:if test="name() = 'group'">
     38                                <gslib:groupLinkWithImage/>
     39            </xsl:if>           
     40                </xsl:for-each>
     41   
    3042            <div style="clear: both; padding-top: 4px; padding-bottom: 4px;"><hr/></div>
    3143
     
    4355    </xsl:template>
    4456
     57    <xsl:template name="groupLinks">
     58        <div id="groupLinks">
     59            <!-- <xsl:if test="count(groupList/group) = 0">
     60                <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections')"/>
     61                <br/>
     62            </xsl:if>
     63            -->
     64            <xsl:for-each select="groupList/group">
     65                <gslib:groupLinkWithImage/>
     66            </xsl:for-each>
     67            <br class="clear"/>
     68        </div>
     69    </xsl:template>
     70   
    4571    <xsl:template name="collectionLinks">
    4672        <div id="collectionLinks">
Note: See TracChangeset for help on using the changeset viewer.