| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| | |
| | Lenya menu.xsp |
| | |
| --> |
| |
| |
| <xsp:page |
| xmlns:i18n="http://apache.org/cocoon/i18n/2.1" |
| xmlns:input="http://apache.org/cocoon/xsp/input/1.0" |
| xmlns:xsp="http://apache.org/xsp" |
| xmlns="http://apache.org/cocoon/lenya/menubar/1.0" |
| language="java" |
| > |
| <menu> |
| <menus> |
| <menu i18n:attr="name" name="Development"> |
| <block> |
| <!-- |
| This is a nasty kind of hack. The goal is to open |
| the profiler output in a separate window with Javascript. |
| The UsecaseMenuTransformer will only accept a href="" |
| attribute, i.e. we can't use onclick="" or target="" here. |
| To make sure the window always pops up in front, |
| we focus() it. |
| At the same time, we want the original window to remain |
| unchanged, so we use the "void" operator to suppress the |
| return value of the whole expression. |
| Unfortunately, we need to take care of the webapp context |
| prefix manually, because Lenya's ProxyTransformer can't |
| reach into this javascript: link. |
| --> |
| <item> |
| <xsp:attribute> |
| <xsp:param name="name">href</xsp:param> |
| <xsp:expr>"javascript:void window.open('" |
| + <input:get-attribute |
| module="proxy" |
| as="string" |
| name="/modules/profiling/profile.html" |
| /> |
| + "'," |
| + "'Cocoon Profiler'," |
| + "'location=yes,scrollbars=yes,menubar=no," |
| + "toolbar=no,status=yes,top=100,left=100," |
| + "height=500,width=700'" |
| + ").focus()" |
| </xsp:expr> |
| </xsp:attribute> |
| <i18n:text>Profiling</i18n:text> |
| </item> |
| </block> |
| </menu> |
| </menus> |
| </menu> |
| </xsp:page> |