<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn">
  <xsl:output method="html" indent="no" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN" encoding="utf-8" />

  <xsl:include href="/app/tools/admin/templates/global.xsl" />

  <xsl:include href="show.xsl" />
  <xsl:include href="edit.xsl" />

  <xsl:template name="pickLayout">
    <xsl:choose>
      <xsl:when test="$cmd = 'add'">
        <xsl:call-template name="permissionEditLayout" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="permissionShowLayout" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="submitButton">
    <xsl:choose>
      <xsl:when test="$cmd = 'show' and Form/PermissionList/Permission">
        <input type="submit" value="Update" id="submitButton" />
      </xsl:when>
      <xsl:when test="$cmd = 'add'">
        <input type="submit" value="Create" id="submitButton" />
      </xsl:when>
      <xsl:otherwise>
      	<xsl:attribute name="class" select="''" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="cancelButton">
    <xsl:choose>
      <xsl:when test="$cmd = 'add'">
        <input type="button" value="Back to Permissions" onClick="location.href='/admin/permission'" />
      </xsl:when>
  	  <xsl:when test="$cmd = 'show'">
    	  <input type="button" name="Back" value="Back to Admin" onClick="location.href='/rps/display?d=config'" />
 	   </xsl:when>
		</xsl:choose>
  </xsl:template>

</xsl:stylesheet>
