Address Book allows you to set two IM nicknames. The list of IM services that is supported by Address Book are listed in the drop-down menus. These two IM options are defined in 'phoneEmailAndIM' template which calls the 'im' template passing the relevant information.
You may change the order of IMs by changing their priorities as illustrated in previous examples.
You may also change the default selected services. The default services available in the drop down list are 'SunONE' and 'AIM'. The code checks for the passed priority and marks the appropriate option in the drop down as selected. You may shuffle the priority value in the code to select a different service. This code exists in the 'im' template.
Example 7–18 shows the default code that displays SunONE as the default selected service
<option value="SunONE"> <xsl:choose> <xsl:when test= "$abperson and $abperson/im[@priority=$priority]"> <xsl:if test= "$abperson/im[@priority=$priority]/@service = 'SunONE'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority= '1'"> ---- This value is passed by 'phoneEmailAndIM' ---template to have this option default selected <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>iPlanet</xsl:text> </option> ..... <option value="Yahoo"> <xsl:choose> <xsl:when test="$abperson and $abperson/im[@priority=$priority]"> <xsl:if test="$abperson/im[@priority=$priority]/@service = 'Yahoo'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '3'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>Yahoo</xsl:text> </option> |
Example 7–19 shows the modified code that displays Yahoo as the default Service
<option value="SunONE"> <xsl:choose> <xsl:when test="$abperson and $abperson/im[@priority=$priority]"> <xsl:if test="$abperson/im[@priority=$priority]/@service = 'SunONE'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority= '3'"> ---- This value is passed by 'phoneEmailAndIM' ----template to have this option default selected <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>iPlanet</xsl:text> </option> ..... <option value="Yahoo"> <xsl:choose> <xsl:when test="$abperson and $abperson/im[@priority=$priority]"> <xsl:if test="$abperson/im[@priority=$priority]/@service = 'Yahoo'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="$priority = '1'"> <xsl:attribute name="selected"/> </xsl:if> </xsl:otherwise> </xsl:choose> <xsl:text>Yahoo</xsl:text> </option> |