[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kupu-checkins
Subject:    [epoz-checkins] r3548 - epoz/branch/plone-drawers/common/drawers
From:       philikon () codespeak ! net
Date:       2004-03-31 10:28:37
Message-ID: 20040331102837.A45B45A142 () thoth ! codespeak ! net
[Download RAW message or body]

Author: philikon
Date: Wed Mar 31 12:28:37 2004
New Revision: 3548

Added:
   epoz/branch/plone-drawers/common/drawers/librarydrawer.xsl   (contents, props \
changed) Modified:
   epoz/branch/plone-drawers/common/drawers/imagedrawer.xsl
Log:
Factored general library drawer XSL templates out to librarydrawer.xsl
and imported it in imagedrawer.xsl. New library drawers simply have to
override specific templates.


Modified: epoz/branch/plone-drawers/common/drawers/imagedrawer.xsl
==============================================================================
--- epoz/branch/plone-drawers/common/drawers/imagedrawer.xsl	(original)
+++ epoz/branch/plone-drawers/common/drawers/imagedrawer.xsl	Wed Mar 31 12:28:37 2004
@@ -19,100 +19,9 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   version="1.0">
 
-  <xsl:template match="/">
-    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
-      <head>
-        <title>Imagedrawer</title>
-      </head>
-      <body id="lt-sourceid">
-        <div id="epd-drawer">
-          <div id="epd-header">
-            <xsl:apply-templates
-              select="/libraries/*[@selected]"
-              mode="header"
-              />
-            <input id="epd-searchbox" name="searchbox" value="" />
-          </div>
-          <div id="epd-panels">
-            <table>
-              <tr class="epd-panelsrow">
-                <td id="epd-librariespanel">
-                  <div id="epd-librariesitems" class="overflow">
-                    <xsl:apply-templates select="/libraries/library"/>
-                  </div>
-                </td>
-                <td id="epd-librarypanel">
-                  <div id="epd-libraryitems" class="overflow">
-                    <xsl:apply-templates
-                      select="/libraries/*[@selected]"
-                      mode="currentpanel"
-                      />
-                  </div>
-                </td>
-                <td id="epd-propertiespanel">
-                  <div id="kupu-properties" class="overflow">
-                    <xsl:apply-templates
-                      select="//resource[@selected]"
-                      mode="properties"
-                      />
-                  </div>
-                </td>
-              </tr>
-            </table>
-          </div>
-          <div id="epd-dialogbuttons">
-            <button type="button" \
                onclick="parent.drawertool.closeDrawer();">Cancel</button>
-            <button type="button" \
                onclick="parent.drawertool.current_drawer.save();">Ok</button>
-          </div>
-        </div>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="library">
-    <div onclick="parent.drawertool.current_drawer.selectLibrary('{@id}');" \
                class="epd-libsource">
-      <xsl:attribute name="id">
-        <xsl:value-of select="@id" />
-      </xsl:attribute>
-      <!-- 
-      We handle selection directly in the HTML now to speed up things a bit
-           <xsl:if test="@selected">
-             <xsl:attribute name="style">background-color: #C0C0C0</xsl:attribute>
-           </xsl:if>
-           -->
-      <xsl:if test="icon">
-        <img src="{icon}" title="{title}" alt="{title}" />
-      </xsl:if>
-      <xsl:value-of select="title"/>
-    </div>
-  </xsl:template>
-
-  <xsl:template match="library|collection" mode="currentpanel">
-    <xsl:apply-templates select="items/collection|items/resource" />
-  </xsl:template>
-
-  <xsl:template match="library|collection|resource" mode="header">
-    <xsl:text>Current location: </xsl:text>
-    <xsl:value-of select="uri/text()" />
-  </xsl:template>
-
-  <xsl:template match="resource|collection">
-    <div id="{@id}" class="epd-libsource">
-      <xsl:attribute name="onclick">
-        <xsl:choose>
-          <xsl:when \
test="local-name()='collection'">parent.drawertool.current_drawer.selectCollection('<xsl:value-of \
                select="@id" />');</xsl:when>
-          <xsl:otherwise>parent.drawertool.current_drawer.selectItem('<xsl:value-of \
                select="@id" />')</xsl:otherwise>
-        </xsl:choose>
-      </xsl:attribute>
-      <xsl:if test="@selected">
-        <xsl:attribute name="style">background-color: #C0C0C0</xsl:attribute>
-      </xsl:if>
-      <xsl:if test="icon">
-        <img src="{icon}" title="{title}" alt="{title}" />
-      </xsl:if>
-      <xsl:value-of select="title"/>
-    </div>
-  </xsl:template>
+  <xsl:import
+    href="librarydrawer.xsl"
+    />
 
   <xsl:template match="resource|collection" mode="properties">
     <xsl:if test="preview">      

Added: epoz/branch/plone-drawers/common/drawers/librarydrawer.xsl
==============================================================================
--- (empty file)
+++ epoz/branch/plone-drawers/common/drawers/librarydrawer.xsl	Wed Mar 31 12:28:37 \
2004 @@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+##############################################################################
+#
+# Copyright (c) 2003-2004 Kupu Contributors. All rights reserved.
+#
+# This software is distributed under the terms of the Kupu
+# License. See LICENSE.txt for license text. For a list of Kupu
+# Contributors see CREDITS.txt.
+#
+##############################################################################
+
+XSL transformation from image library XML to HTML for the image
+library drawer.
+
+$Id$
+-->
+<xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0">
+
+  <xsl:template match="/">
+    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
+      <head>
+        <title>Imagedrawer</title>
+      </head>
+      <body id="lt-sourceid">
+        <div id="epd-drawer">
+          <div id="epd-header">
+            <xsl:apply-templates
+              select="/libraries/*[@selected]"
+              mode="header"
+              />
+            <input id="epd-searchbox" name="searchbox" value="" />
+          </div>
+          <div id="epd-panels">
+            <table>
+              <tr class="epd-panelsrow">
+                <td id="epd-librariespanel">
+                  <div id="epd-librariesitems" class="overflow">
+                    <xsl:apply-templates select="/libraries/library"/>
+                  </div>
+                </td>
+                <td id="epd-librarypanel">
+                  <div id="epd-libraryitems" class="overflow">
+                    <xsl:apply-templates
+                      select="/libraries/*[@selected]"
+                      mode="currentpanel"
+                      />
+                  </div>
+                </td>
+                <td id="epd-propertiespanel">
+                  <div id="kupu-properties" class="overflow">
+                    <xsl:apply-templates
+                      select="//resource[@selected]"
+                      mode="properties"
+                      />
+                  </div>
+                </td>
+              </tr>
+            </table>
+          </div>
+          <div id="epd-dialogbuttons">
+            <button type="button" \
onclick="parent.drawertool.closeDrawer();">Cancel</button> +            <button \
type="button" onclick="parent.drawertool.current_drawer.save();">Ok</button> +        \
</div> +        </div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="library">
+    <div onclick="parent.drawertool.current_drawer.selectLibrary('{@id}');" \
class="epd-libsource"> +      <xsl:attribute name="id">
+        <xsl:value-of select="@id" />
+      </xsl:attribute>
+      <!-- 
+      We handle selection directly in the HTML now to speed up things a bit
+           <xsl:if test="@selected">
+             <xsl:attribute name="style">background-color: #C0C0C0</xsl:attribute>
+           </xsl:if>
+           -->
+      <xsl:if test="icon">
+        <img src="{icon}" title="{title}" alt="{title}" />
+      </xsl:if>
+      <xsl:value-of select="title"/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="library|collection" mode="currentpanel">
+    <xsl:apply-templates select="items/collection|items/resource" />
+  </xsl:template>
+
+  <xsl:template match="library|collection|resource" mode="header">
+    <xsl:text>Current location: </xsl:text>
+    <xsl:value-of select="uri/text()" />
+  </xsl:template>
+
+  <xsl:template match="resource|collection">
+    <div id="{@id}" class="epd-libsource">
+      <xsl:attribute name="onclick">
+        <xsl:choose>
+          <xsl:when \
test="local-name()='collection'">parent.drawertool.current_drawer.selectCollection('<xsl:value-of \
select="@id" />');</xsl:when> +          \
<xsl:otherwise>parent.drawertool.current_drawer.selectItem('<xsl:value-of \
select="@id" />')</xsl:otherwise> +        </xsl:choose>
+      </xsl:attribute>
+      <xsl:if test="@selected">
+        <xsl:attribute name="style">background-color: #C0C0C0</xsl:attribute>
+      </xsl:if>
+      <xsl:if test="icon">
+        <img src="{icon}" title="{title}" alt="{title}" />
+      </xsl:if>
+      <xsl:value-of select="title"/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="resource|collection" mode="properties">
+    <!-- Override this template for your custom library drawer -->
+  </xsl:template>
+</xsl:stylesheet>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic