View File | Revision Log | Show Annotations | Download File | View Changeset
/hippo/hippo-cms6/hippo-cms/trunk/editor/src/site/workbench/transformers/top.xsl
Revision: 36987
Committed: Mon Nov 19 14:22:18 2012 UTC (7 years, 2 months ago) by abogaart
Content type: application/xml
File size: 13378 byte(s)
Log Message:
CMSSIX-296:  onUnLoad all locks for the current user will be removed

File Contents

# Content
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!--
3 Copyright 2001-2008 Hippo (www.onehippo.com)
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 -->
17 <!--
18 Top frame
19 Loads the CMS framework javascript classes and startup script
20 Draws tab headers
21 -->
22
23 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
24 xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
25
26 <xsl:param name="username"/>
27 <xsl:param name="fullname"/>
28 <xsl:param name="editUri"/>
29 <xsl:param name="editType"/>
30 <xsl:param name="previewURL"/>
31 <xsl:param name="randomNr"/>
32
33 <xsl:template match="/">
34 <html>
35 <head>
36 <title>Hippo CMS Tab Menu</title>
37 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
38 <link href="/workbench/css/top_layout_browser_generic.css" rel="stylesheet" type="text/css" media="all" />
39 <link href="/workbench/css/top_style_browser_generic.css" rel="stylesheet" type="text/css" media="all" />
40 <link href="/workbench/css/topstyle.css" rel="stylesheet" type="text/css" media="all" />
41
42 <!-- Class framework's -->
43 <scriptpackage id="external" inline="true">
44 <script type="text/javascript" src="/workbench/js/cfx/Cfx.js">&#160;</script>
45 </scriptpackage>
46 <script type="text/javascript" src="/js/scriptaculous/lib/prototype-min.js">&#160;</script>
47 <script type="text/javascript" src="/js/scriptaculous/src/scriptaculous.js">&#160;</script>
48
49 <scriptpackage id="hippoFramework">
50 <!-- Load helper functions and classes -->
51 <script type="text/javascript" src="/workbench/js/hippo/util.js">&#160;</script>
52
53 <!-- Framework classes -->
54 <script type="text/javascript" src="/workbench/js/hippo/framework/logger.js">&#160;</script>
55 <script type="text/javascript" src="/workbench/js/hippo/framework/loggertranslations.js">&#160;</script>
56 <script type="text/javascript" src="/workbench/js/hippo/framework/start.js">&#160;</script>
57 <script type="text/javascript" src="/workbench/js/hippo/framework/context.js">&#160;</script>
58 <script type="text/javascript" src="/workbench/js/hippo/framework/services.js">&#160;</script>
59 <script type="text/javascript" src="/workbench/js/hippo/framework/components.js">&#160;</script>
60 <script type="text/javascript" src="/workbench/js/hippo/framework/events.js">&#160;</script>
61 <script type="text/javascript" src="/workbench/js/hippo/framework/event_util.js">&#160;</script>
62 <script type="text/javascript" src="/workbench/js/hippo/framework/remotecall.js">&#160;</script>
63 <script type="text/javascript" src="/workbench/js/hippo/framework/remotecall-ajax.js">&#160;</script>
64 <script type="text/javascript" src="/workbench/js/hippo/framework/authentication.js">&#160;</script>
65
66 <!-- non-standard framework source files from xml-configuration -->
67 <xsl:apply-templates select="/root/sources[@context='Framework']/*"/>
68 </scriptpackage>
69
70 <!-- Load framework configuration -->
71 <script type="text/javascript" src="/workbench/js/FrameworkConfiguration.js?{$randomNr}=">&#160;</script>
72
73 <!-- Application classes -->
74 <scriptpackage id="hippoApplication">
75 <script type="text/javascript" src="/workbench/js/hippo/cms.js">&#160;</script>
76 <script type="text/javascript" src="/workbench/js/hippo/workbench.js">&#160;</script>
77 <script type="text/javascript" src="/workbench/js/hippo/container.js">&#160;</script>
78 <script type="text/javascript" src="/workbench/js/hippo/perspectives.js">&#160;</script>
79 <script type="text/javascript" src="/workbench/js/hippo/views.js">&#160;</script>
80 <script type="text/javascript" src="/workbench/js/hippo/keyboard.js">&#160;</script>
81
82 <!-- non-standard application source files from xml-configuration -->
83 <xsl:apply-templates select="/root/sources[@context='Application']/*"/>
84 </scriptpackage>
85
86 <!-- Load application configuration -->
87 <script type="text/javascript" src="/workbench/js/ApplicationConfiguration.js?{$randomNr}=">&#160;</script>
88
89 <script language="javascript" type="text/javascript">
90 var documentIsOpen = "false";
91 function openDocument(state)
92 {
93 documentIsOpen = state;
94 }
95 var scheduledTasks = new Array();
96
97 <xsl:choose>
98 <xsl:when test="string-length($editUri) &gt; 0 and ($editType='binary-resource' or $editType='asset')">
99 scheduledTasks[scheduledTasks.length] = {'event':'assetselectSource','arguments':[{key:'url',val:'<xsl:value-of select="$editUri"/>'}]};
100 </xsl:when>
101 <xsl:when test="string-length($editUri) &gt; 0 and string-length($editType) &gt; 0">
102 scheduledTasks[scheduledTasks.length] = {'event':'editDocument','arguments':[{key:'url',val:'<xsl:value-of select="$editUri"/>'},{key:'type',val:'<xsl:value-of select="$editType"/>'}]};
103 </xsl:when>
104 <xsl:when test="string-length($editUri) &gt; 0 and string-length($editType) = 0">
105 scheduledTasks[scheduledTasks.length] = {'event':'selectSource','arguments':[{key:'url',val:'<xsl:value-of select="$editUri"/>'}]};
106 </xsl:when>
107 </xsl:choose>
108
109 //temporary workaround for 6.0.3.1 ONLY!
110 var CMS_PREVIEW_URL = '<xsl:value-of select="$previewURL"/>';
111
112 function removeLocks() {
113 window.top.window.frames['topframe'].fireCMSEvent('beforeUnloadCMS');
114 return true;
115 }
116 </script>
117 </head>
118
119 <body onbeforeunload="return removeLocks();">
120 <!-- start body-->
121 <div id="container_main">
122 <!-- start top-->
123 <div id="top">
124 <!-- start top left: logo & navigation-->
125 <div id="top_left_container" >
126 <xsl:if test="count(/root/application//perspectives/perspective) &gt; 5">
127 <!-- default width in css is to small to align all icons when > 5 -->
128 <xsl:attribute name="style">width:<xsl:value-of select="count(/root/application//perspectives/perspective) * 116"/>px;</xsl:attribute>
129 </xsl:if>
130 <div id="logo">
131 <img class="unselectable" unselectable="on" src="/skins/images/logo_top.gif" alt="Hippo CMS" width="170" height="27"/>
132 </div>
133 <!-- start top navigation-->
134 <div id="nav">
135 <xsl:apply-templates select="/root/application//perspectives/*"/>
136 </div>
137 <!-- end top navigation-->
138 </div>
139 <!-- end top left-->
140 <!-- start top right: user data & search field-->
141 <div id="top_right_container_top">
142 <table cellspacing="0" cellpadding="3" class="user_data" border="0">
143 <tr>
144 <td class="unselectable username" unselectable="on">
145 <!--div id="usernameBox"-->
146 <xsl:choose>
147 <xsl:when test="string-length($fullname)&gt;0">
148 <xsl:value-of select="$fullname"/>
149 </xsl:when>
150 <xsl:otherwise>
151 <xsl:value-of select="$username"/>
152 </xsl:otherwise>
153 </xsl:choose>
154 <!--/div-->
155 </td>
156 <td class="unselectable" unselectable="on">
157 <img src="/skins/images/user_top.gif" alt="" width="10" height="8"/>
158 </td>
159 <td class="unselectable" unselectable="on">
160 <a href="/login/logout" target="_top">
161 <i18n:text>topmenu.logoffmessage</i18n:text>
162 </a>
163 </td>
164 <td class="unselectable" unselectable="on">
165 <a href="/login/logout" target="_top" class="unselectable" unselectable="on"
166 onfocus="document.getElementById('logoffIcon').style.border='1px solid #666';"
167 onblur="document.getElementById('logoffIcon').style.border='0px';">
168 <img src="/skins/images/logout.gif" alt="log out" width="14" height="9"/>
169 </a>
170 </td>
171 </tr>
172 </table>
173 <form style="padding:0px; margin:0px;">
174 <xsl:attribute name="onsubmit">
175 <xsl:text>fireCMSEvent('doSearch',[{key:'reportID',val:'adv'},{key:'simpleSearch',val:document.getElementById('topSimpleSearch').value}]); return false;</xsl:text>
176 </xsl:attribute>
177 <table cellspacing="0" cellpadding="0" class="search_top" border="0">
178 <tr>
179 <td id="waitImage" style="visibility:hidden; vertical-align: bottom;">
180 <img class="unselectable" unselectable="on" src="/skin/images/clock_05.gif" alt="" width="26" height="24"/>
181 </td>
182 <td>&#160;</td>
183 <td class="search_top_divider_L"/>
184 <td class="form"><a href="#" onclick="window.open('/workbench/clipboard/external-shelf.html','shelfitems','width=600,height=400,resizable=yes,scrollbars=yes,status=no,toolbar=no');return false;" target="_blank"><img src="/skins/images/icons/16x16/folder_window.gif" border="0"/></a>&#160;</td>
185 <td class="form">
186 <input type="text" name="topSimpleSearch" id="topSimpleSearch"/>
187 </td>
188 <td class="form">&#160;</td>
189 <td class="form">
190 <button type="button" name="search" value="search" id="topSearchBtn">
191 <xsl:attribute name="onclick">
192 <xsl:text>fireCMSEvent('doSearch',[{key:'reportID',val:'adv'},{key:'simpleSearch',val:document.getElementById('topSimpleSearch').value}])</xsl:text>
193 </xsl:attribute>
194 <i18n:text>topmenu.toolbar.search</i18n:text>
195 </button>
196 </td>
197 <td class="search_top_divider_R"/>
198 </tr>
199 </table>
200 </form>
201 </div>
202 </div>
203 <!-- end top -->
204 <!-- start horizontal gray divider & breadcrumb bar-->
205 <div id="top_divider">&#160;</div>
206 <div unselectable="on" id="top_path_bar" class="unselectable">
207 <i18n:text>topmenu.toolbar.home</i18n:text>
208 <span id="top_breadcrumb" unselectable="on" class="unselectable">&#160;</span>
209 <span id="search_result_summary" unselectable="on" class="unselectable"></span>
210 <span id="search_result_extended_summary" unselectable="on" class="unselectable"></span>
211 </div>
212 <!-- end horizontal gray divider -->
213 </div>
214 </body>
215 </html>
216 </xsl:template>
217
218 <xsl:template match="perspective">
219 <table unselectable="on" cellspacing="0" cellpadding="0" class="nav_tbl unselectable">
220 <xsl:attribute name="onclick">fireCMSEvent('setFocus',[{key:'perspectiveID',val:'<xsl:value-of select="@id"/>'}])</xsl:attribute>
221 <xsl:attribute name="onfocus">this.blur();</xsl:attribute>
222 <xsl:attribute name="ondblclick">fireCMSEvent('reloadActivePerspective',[]);</xsl:attribute>
223 <tr>
224 <td unselectable="on" id="{@id}_tab_top" class="tab_top_empty unselectable"></td>
225 </tr>
226 <tr>
227 <td class="unselectable" id="{@id}" unselectable="on">
228 <div class="perspectiveTab unselectable" unselectable="on">
229 <xsl:attribute name="style">
230 <xsl:text>background: url(/skins/images/icons/24x24/</xsl:text>
231 <xsl:value-of select="@icon"/>
232 <xsl:text>.gif) 4px 2px no-repeat;</xsl:text>
233 </xsl:attribute>
234 <a href="#" unselectable="on" class="unselectable">
235 <xsl:value-of select="@label"/>
236 </a>
237 </div>
238 </td>
239 </tr>
240 </table>
241 </xsl:template>
242
243 <xsl:template match="perspective" mode="top-path-bar">
244 </xsl:template>
245
246 <xsl:template match="source">
247 <xsl:if test="string-length(.)&gt;0">
248 <script type="text/javascript" src="{.}">&#160;</script>
249 </xsl:if>
250 </xsl:template>
251
252 <xsl:template match="*" />
253
254 </xsl:stylesheet>