Several enhancements for the handling of the new labels and hints:

- Hints are now shown for ControlLinks
- The standard theme uses an better symbol
- Hints and new style labels now work for DHTMLEditors, and widgets Date, Time and DateTime


git-svn-id: https://svn.libreccm.org/ccm/trunk@2755 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-07-11 18:38:38 +00:00
parent 112910e484
commit c510e1566a
12 changed files with 531 additions and 479 deletions

View File

@ -23,7 +23,6 @@ import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.ContentSection;
/**
*
*
@ -42,26 +41,26 @@ public class CMSDHTMLEditor extends DHTMLEditor {
super(model,
ContentSection.getConfig().getDHTMLEditorConfig());
addPlugins();
hideButtons();
addPlugins();
hideButtons();
}
private void addPlugins() {
String[] plugins = ContentSection.getConfig().getDHTMLEditorPlugins();
if (plugins != null) {
for (int i = 0 ; i < plugins.length ; i++) {
for (int i = 0; i < plugins.length; i++) {
addPlugin(plugins[i]);
}
}
}
private void hideButtons() {
String[] hiddenButtons = ContentSection.getConfig().getDHTMLEditorHiddenButtons();
if (hiddenButtons != null) {
for (int i = 0 ; i < hiddenButtons.length ; i++) {
hideButton(hiddenButtons[i]);
}
}
String[] hiddenButtons = ContentSection.getConfig().getDHTMLEditorHiddenButtons();
if (hiddenButtons != null) {
for (int i = 0; i < hiddenButtons.length; i++) {
hideButton(hiddenButtons[i]);
}
}
}
}

View File

@ -281,6 +281,7 @@ public class DHTMLEditor extends TextArea {
Element editor = parent.newChildElement(getElementTag(), BEBOP_XML_NS);
editor.addAttribute("name", getName());
generateDescriptionXML(state, editor);
// Set the needed config params so they don't have to be hardcoded in the theme
editor.addAttribute("editor_url", Web.getWebappContextPath().concat(getEditorURL()));

View File

@ -324,6 +324,7 @@ public class Date extends Widget implements BebopConstants {
date.addAttribute("label", (String) getLabel().localize(ps.getRequest()));
}
exportAttributes(date);
generateDescriptionXML(ps, date);
generateLocalizedWidget(ps, date);
// If Element could be null insert an extra widget to clear entry

View File

@ -112,6 +112,8 @@ public class DateTime extends Widget implements BebopConstants {
m_date.generateLocalizedWidget(ps, datetime);
m_time.generateLocalizedWidget(ps, datetime);
generateDescriptionXML(ps, datetime);
// If Element could be null insert a extra widget to clear entry
if (!hasValidationListener(new NotNullValidationListener())) {
datetime.newChildElement("NoDateTime");

View File

@ -18,7 +18,6 @@
*/
package com.arsdigita.bebop.form;
import com.arsdigita.xml.Element;
import com.arsdigita.bebop.PageState;
@ -28,22 +27,20 @@ import com.arsdigita.bebop.parameters.ParameterModel;
// in a constant which is used when generating XML
import com.arsdigita.bebop.util.BebopConstants;
/**
* A class representing a textarea field in an HTML form.
* A class representing a textarea field in an HTML form.
*
* @author Karl Goldstein
* @author Uday Mathur
* @author Rory Solomon
* @author Michael Pih
* @version $Id: TextArea.java 287 2005-02-22 00:29:02Z sskracic $
* @author Karl Goldstein
* @author Uday Mathur
* @author Rory Solomon
* @author Michael Pih
* @version $Id: TextArea.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class TextArea extends Widget implements BebopConstants {
/**
* Constant for specifying <tt>OFF</tt> value for the
* <tt>WRAP</tt> attribute of this image input. See <a
* <tt>WRAP</tt> attribute of this image input. See <a
* href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a>
* for a description of what this attribute does.
*/
@ -51,7 +48,7 @@ public class TextArea extends Widget implements BebopConstants {
/**
* Constant for specifying <tt>HARD</tt> value for the
* <tt>WRAP</tt> attribute of this image input. * See <a
* <tt>WRAP</tt> attribute of this image input. * See <a
* //href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a>
* for a description of what this attribute does.
*/
@ -59,7 +56,7 @@ public class TextArea extends Widget implements BebopConstants {
/**
* Constant for specifying <tt>SOFT</tt> value for the
* <tt>WRAP</tt> attribute of this image input. See <a
* <tt>WRAP</tt> attribute of this image input. See <a
* href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a>
* for a description of what this attribute does.
*/
@ -68,13 +65,9 @@ public class TextArea extends Widget implements BebopConstants {
// -------------------------------------
// * * * Fields * * *
// -------------------------------------
// -------------------------------------
// * * * Methods * * *
// -------------------------------------
public TextArea(String name) {
super(name);
}
@ -104,42 +97,42 @@ public class TextArea extends Widget implements BebopConstants {
}
/**
* Returns a string naming the type of this widget.
* Returns a string naming the type of this widget.
*/
public String getType() {
return "textarea";
}
/**
* Sets the <tt>ROWS</tt> attribute for the <tt>TEXTAREA</tt> tag.
* Sets the <tt>ROWS</tt> attribute for the <tt>TEXTAREA</tt> tag.
*/
public void setRows(int rows) {
setAttribute("rows", String.valueOf(rows));
}
/**
* Sets the <tt>COLS</tt> attribute for the <tt>TEXTAREA</tt> tag.
* Sets the <tt>COLS</tt> attribute for the <tt>TEXTAREA</tt> tag.
*/
public void setCols(int cols) {
setAttribute("cols", String.valueOf(cols));
}
/**
* Sets the <tt>WRAP</tt> attribute for the <tt>TEXTAREA</tt> tag.
* Sets the <tt>WRAP</tt> attribute for the <tt>TEXTAREA</tt> tag.
*/
public void setWrap(int wrap) {
String wrapString = null;
switch (wrap) {
case OFF:
wrapString = "off";
break;
case HARD:
wrapString = "hard";
break;
case SOFT:
wrapString = "soft";
break;
case OFF:
wrapString = "off";
break;
case HARD:
wrapString = "hard";
break;
case SOFT:
wrapString = "soft";
break;
}
if (wrapString != null) {
@ -149,45 +142,48 @@ public class TextArea extends Widget implements BebopConstants {
/**
* Set the default value (text)
*
* @deprecated [since 17Aug2001] use {@link Widget#setDefaultValue(Object)}
*/
public void setValue( String text ) {
public void setValue(String text) {
this.setDefaultValue(text);
}
/**
* Is this a compound widget?
*
* @return false
*/
public boolean isCompound() {
return false;
}
/** The XML tag.
* @return The tag to be used for the top level DOM element
* generated for this type of Widget. */
/**
* The XML tag.
*
* @return The tag to be used for the top level DOM element generated for this type of Widget.
*/
protected String getElementTag() {
return BEBOP_TEXTAREA;
}
/**
* Generates the DOM for the textarea widget.
* <p>Generates DOM fragment:
* <p><code>&lt;bebop:textarea name=... value=... [onXXX=...]/>
* </code>
* <p>
* Generates DOM fragment:
* <p>
* <code>&lt;bebop:textarea name=... value=... [onXXX=...]/>
* </code>
*/
public void generateWidget( PageState state, Element parent ) {
public void generateWidget(PageState state, Element parent) {
Element textarea = parent.newChildElement(getElementTag(), BEBOP_XML_NS);
textarea.addAttribute("name", getName());
if (getLabel() != null)
textarea.addAttribute("label",
(String)getLabel().localize(state.getRequest()));
generateDescriptionXML(state, textarea);
ParameterData pData = getParameterData(state);
if( null != pData ) {
if (null != pData) {
String value = pData.marshal();
if ( value == null ) {
if (value == null) {
value = "";
}
textarea.addAttribute("value", value);

View File

@ -21,7 +21,13 @@ package com.arsdigita.bebop.form;
import com.arsdigita.bebop.Form;
import com.arsdigita.bebop.FormData;
import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.parameters.*;
import com.arsdigita.bebop.parameters.DateTimeParameter;
import com.arsdigita.bebop.parameters.NotNullValidationListener;
import com.arsdigita.bebop.parameters.NumberInRangeValidationListener;
import com.arsdigita.bebop.parameters.ParameterData;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.TimeParameter;
import com.arsdigita.bebop.util.BebopConstants;
import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.util.Assert;
@ -258,6 +264,7 @@ public class Time extends Widget implements BebopConstants {
Element time = parent.newChildElement(getElementTag(), BEBOP_XML_NS);
time.addAttribute("name", getParameterModel().getName());
generateDescriptionXML(ps, time);
generateLocalizedWidget(ps, time);
// If Element could be null insert a extra widget to clear entry

View File

@ -52,18 +52,16 @@ import com.arsdigita.xml.Element;
* </p>
*
* <p>
* A widget may correspond to a standard HTML form element, or to a more
* specific element or set of elements, such as a date widget that allows
* input of month, day and year (and possibly time as well).</p>
* A widget may correspond to a standard HTML form element, or to a more specific element or set of
* elements, such as a date widget that allows input of month, day and year (and possibly time as
* well).</p>
*
* <p>
* This class and its subclasses provide methods to set all element attributes
* except for <code>VALUE</code>, which is typically dependent on the request.
* At the time of a request, a widget object merges a dynamically specified
* value or set of values with its own set of persistent attributes to render
* the final HTML for the widget. Other dynamic attributes may be associated
* with the form component via a <code>WidgetPeer</code> associated with the
* widget.</p>
* This class and its subclasses provide methods to set all element attributes except for
* <code>VALUE</code>, which is typically dependent on the request. At the time of a request, a
* widget object merges a dynamically specified value or set of values with its own set of
* persistent attributes to render the final HTML for the widget. Other dynamic attributes may be
* associated with the form component via a <code>WidgetPeer</code> associated with the widget.</p>
*
* @author Karl Goldstein
* @author Uday Mathur
@ -71,7 +69,7 @@ import com.arsdigita.xml.Element;
* @version $Id: Widget.java 1537 2007-03-23 15:33:34Z chrisgilbert23 $
*/
public abstract class Widget extends DescriptiveComponent
implements Cloneable, BebopConstants {
implements Cloneable, BebopConstants {
private static final Logger s_log = Logger.getLogger(Widget.class);
@ -80,7 +78,9 @@ public abstract class Widget extends DescriptiveComponent
private ParameterListener m_forwardParameter = null;
private PrintListener m_printListener;
private Form m_form;
/** The optional (localized) label (or title) of this widget. */
/**
* The optional (localized) label (or title) of this widget.
*/
// Use parent's class' instead
// private GlobalizedMessage m_label;
@ -96,7 +96,6 @@ public abstract class Widget extends DescriptiveComponent
static final String ON_CHANGE = "onChange";
static final String ON_KEY_UP = "onKeyUp";
/**
* Constructor, creates a new widget.
*
@ -110,8 +109,8 @@ public abstract class Widget extends DescriptiveComponent
* Constructor, creates a new widget.
*
* <p>
* Each new widget is associated with a ParameterModel describing the
* data object(s) submitted from the widget.
* Each new widget is associated with a ParameterModel describing the data object(s) submitted
* from the widget.
*
* @param model
*/
@ -121,7 +120,6 @@ public abstract class Widget extends DescriptiveComponent
m_parameterModel = model;
}
/**
* Returns true if the widget consists of multiple HTML elements.
*
@ -130,8 +128,7 @@ public abstract class Widget extends DescriptiveComponent
public abstract boolean isCompound();
/**
* Returns a string naming the type of this widget. Must be implemented by
* subclasses!
* Returns a string naming the type of this widget. Must be implemented by subclasses!
*
* @return
*/
@ -143,11 +140,13 @@ public abstract class Widget extends DescriptiveComponent
*/
protected ParameterListener createParameterListener() {
return new ParameterListener() {
@Override
public void validate(ParameterEvent evt)
throws FormProcessException {
throws FormProcessException {
fireValidation(new ParameterEvent(Widget.this, evt.getParameterData()));
}
};
}
@ -161,18 +160,18 @@ public abstract class Widget extends DescriptiveComponent
}
protected void fireValidation(ParameterEvent evt)
throws FormProcessException {
throws FormProcessException {
Assert.isLocked(this);
PageState ps = evt.getPageState();
if ( (!validateInvisible() && !ps.isVisibleOnPage(this))
|| ((m_guard != null) && m_guard.shouldValidate(ps)) ) {
if ((!validateInvisible() && !ps.isVisibleOnPage(this))
|| ((m_guard != null) && m_guard.shouldValidate(ps))) {
return;
}
for (Iterator it
= m_listeners.getListenerIterator(ParameterListener.class);
= m_listeners.getListenerIterator(ParameterListener.class);
it.hasNext();) {
((ParameterListener) it.next()).validate(evt);
}
@ -198,6 +197,7 @@ public abstract class Widget extends DescriptiveComponent
* Test for existens of a particular type of ValidationListener
*
* @param listener Subtype of ParameterListern which is tested for
*
* @return true if subtype is in the list
*/
public boolean hasValidationListener(ParameterListener listener) {
@ -208,17 +208,18 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Adds a print listener for this widget. Only one print listener can
* be set for a widget, since the <code>PrintListener</code> is expected
* to modify the target of the <code>PrintEvent</code>.
* Adds a print listener for this widget. Only one print listener can be set for a widget, since
* the <code>PrintListener</code> is expected to modify the target of the
* <code>PrintEvent</code>.
*
* @param listener the print listener
* @throws IllegalArgumentException <code>listener</code> is null
*
* @throws IllegalArgumentException <code>listener</code> is null
* @throws TooManyListenersException a print listener has previously been added
* @pre listener != null
*/
public void addPrintListener(PrintListener listener)
throws TooManyListenersException, IllegalArgumentException {
throws TooManyListenersException, IllegalArgumentException {
if (listener == null) {
throw new IllegalArgumentException("Argument listener can not be null");
}
@ -229,17 +230,17 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Set the print listener for this widget. Since there can only be one
* print listener for a widget, this lets you just set it and avoid
* writing a try/catch block for "TooManyListenersException". Any existing
* listener will be overwritten.
* Set the print listener for this widget. Since there can only be one print listener for a
* widget, this lets you just set it and avoid writing a try/catch block for
* "TooManyListenersException". Any existing listener will be overwritten.
*
* @param listener the print listener
*
* @throws IllegalArgumentException <code>listener</code> is null
* @pre listener != null
*/
public void setPrintListener(PrintListener listener)
throws IllegalArgumentException {
throws IllegalArgumentException {
if (listener == null) {
throw new IllegalArgumentException("Argument listener can not be null");
}
@ -247,19 +248,18 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Remove a previously added print listener.
* If <code>listener</code> is not the listener that has been added with
* {@link #addPrintListener addPrintListener}, an IllegalArgumentException
* Remove a previously added print listener. If <code>listener</code> is not the listener that
* has been added with {@link #addPrintListener addPrintListener}, an IllegalArgumentException
* will be thrown.
*
* @param listener the listener that had been added with
* <code>addPrintListener</code>
* @throws IllegalArgumentException <code>listener</code> is not the
* currently registered print listener or is <code>null</code>.
* @param listener the listener that had been added with <code>addPrintListener</code>
*
* @throws IllegalArgumentException <code>listener</code> is not the currently registered print
* listener or is <code>null</code>.
* @pre listener != null
*/
public void removePrintListener(PrintListener listener)
throws IllegalArgumentException {
throws IllegalArgumentException {
if (listener == null) {
throw new IllegalArgumentException("listener can not be null");
}
@ -270,9 +270,8 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Registers the ParameterModel of this Widget with the containing Form.
* This method is used by the Bebop framework and should not be used by
* application developers.
* Registers the ParameterModel of this Widget with the containing Form. This method is used by
* the Bebop framework and should not be used by application developers.
*
* @param form
* @param model
@ -285,43 +284,43 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Sets the Form Object for this Widget.
* This method will throw an exception if the _form pointer is already set.
* To explicity change the m_form pointer the developer must first call
* Sets the Form Object for this Widget. This method will throw an exception if the _form
* pointer is already set. To explicity change the m_form pointer the developer must first call
* setForm(null)
*
* @param form The <code>Form</code> Object for this Widget
*
* @exception IllegalStateException if form already set.
*/
public void setForm(final Form form) {
if (m_form != null && form != null) {
throw new IllegalStateException("Form " + form.getName()
+ " already set for "
+ getName());
+ " already set for "
+ getName());
}
m_form = form;
}
/**
* Gets the Form Object for this Widget.
* Throws an exception if the Widget doesn't belong to a form.
* Gets the Form Object for this Widget. Throws an exception if the Widget doesn't belong to a
* form.
*
* @return the {@link Form} Object for this Widget.
*
* @post return != null
*/
public Form getForm() throws RuntimeException {
if (m_form == null) {
throw new RuntimeException("Widget " + this + " (" + getName() + ") "
+ "isn't associated with any Form");
+ "isn't associated with any Form");
}
return m_form;
}
/**
* Sets the <tt>ONFOCUS</tt> attribute for the HTML tags that compose
* this element.
* Sets the <tt>ONFOCUS</tt> attribute for the HTML tags that compose this element.
*
* @param javascriptCode
*/
@ -330,8 +329,7 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Sets the <tt>ONBLUR</tt> attribute for the HTML tags that compose
* this element.
* Sets the <tt>ONBLUR</tt> attribute for the HTML tags that compose this element.
*
* @param javascriptCode
*/
@ -340,8 +338,7 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Sets the <tt>ONSELECT</tt> attribute for the HTML tags that compose
* this element.
* Sets the <tt>ONSELECT</tt> attribute for the HTML tags that compose this element.
*
* @param javascriptCode
*/
@ -350,8 +347,7 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Sets the <tt>ONCHANGE</tt> attribute for the HTML tags that compose
* this element.
* Sets the <tt>ONCHANGE</tt> attribute for the HTML tags that compose this element.
*
* @param javascriptCode
*/
@ -360,8 +356,7 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Sets the <tt>ON_KEY_UP</tt> attribute for the HTML tags that compose
* this element.
* Sets the <tt>ON_KEY_UP</tt> attribute for the HTML tags that compose this element.
*
* @param javascriptCode
*/
@ -370,9 +365,8 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Sets the default value in the parameter model for this element.
* This is a static property and this method should not be invoked
* at request time (not even in a PrintListener).
* Sets the default value in the parameter model for this element. This is a static property and
* this method should not be invoked at request time (not even in a PrintListener).
*
* @param value
*/
@ -381,9 +375,8 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Marks this widget as readonly, which has the effect of preventing the
* user from modifying the widget's contents.
* This method can only be called on unlocked widgets.
* Marks this widget as readonly, which has the effect of preventing the user from modifying the
* widget's contents. This method can only be called on unlocked widgets.
*/
public void setReadOnly() {
Assert.isUnlocked(this);
@ -391,9 +384,8 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Marks this widget as disabled, which has the effect of preventing the
* widget's value being submitted with the form, and will typically cause
* the widget to be 'grayed out' on the form.
* Marks this widget as disabled, which has the effect of preventing the widget's value being
* submitted with the form, and will typically cause the widget to be 'grayed out' on the form.
* This method can only be called on unlocked widgets.
*/
public void setDisabled() {
@ -405,8 +397,9 @@ public abstract class Widget extends DescriptiveComponent
* Sets a popup hint for the widget.
*
* @param hint
* @deprecated refactor to use a GlobalizedMessage instead and use
* setHint(GlobalizedMessage hint)
*
* @deprecated refactor to use a GlobalizedMessage instead and use setHint(GlobalizedMessage
* hint)
*/
public void setHint(String hint) {
Assert.isUnlocked(this);
@ -424,7 +417,6 @@ public abstract class Widget extends DescriptiveComponent
// Assert.isUnlocked(this);
// setAttribute("hint", (String) hint.localize());
// }
/**
* Sets a Label for the widget.
*
@ -434,7 +426,6 @@ public abstract class Widget extends DescriptiveComponent
// public void setLabel(GlobalizedMessage label) {
// m_label = label;
// }
/**
* Sets a Label for the widget.
*
@ -444,7 +435,6 @@ public abstract class Widget extends DescriptiveComponent
// public GlobalizedMessage getLabel() {
// return m_label;
// }
/**
* Gets the default value in the parameter model for this element.
*
@ -463,30 +453,28 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* The "pass in" property determines whether the value for this parameter
* is generally passed in from the outside.
* If this property is <code>true</code>, the model always tries to get the
* parameter value from the request, no matter whether the request is the
* initial request or a submission of the form to which the widget belongs.
* The "pass in" property determines whether the value for this parameter is generally passed in
* from the outside. If this property is <code>true</code>, the model always tries to get the
* parameter value from the request, no matter whether the request is the initial request or a
* submission of the form to which the widget belongs.
*
* <p>
* If this property is <code>false</code>, the parameter value is only read
* from the request if it is a submission of the form containing the widget.
* If this property is <code>false</code>, the parameter value is only read from the request if
* it is a submission of the form containing the widget.
*
* <p>
* By default, this property is <code>false</code>.
*
* @return <code>true</code> if an attempt should always be made to
* retrieve the parameter value from the request.
* @return <code>true</code> if an attempt should always be made to retrieve the parameter value
* from the request.
*/
public final boolean isPassIn() {
return getParameterModel().isPassIn();
}
/**
* Set whether this parameter should be treated as a "pass in" parameter.
* This is a static property of the ParameterModel and this method should
* not be invoked at request-time.
* Set whether this parameter should be treated as a "pass in" parameter. This is a static
* property of the ParameterModel and this method should not be invoked at request-time.
*
* @see #isPassIn
* @param v <code>true</code> if this parameter is a pass in parameter.
@ -497,10 +485,8 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* The ParameterModel is normally set via the constructors.
* This method is only rarely needed.
* Please note that the previous ParameterModel and all its listeners
* will be lost.
* The ParameterModel is normally set via the constructors. This method is only rarely needed.
* Please note that the previous ParameterModel and all its listeners will be lost.
*
* @param parameterModel
*/
@ -510,11 +496,10 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Allows access to underlying parameterModel. The ParameterModel contains
* static (request-independent) properties of a Widget such as its name,
* default value and its listeners. The ParameterModel can not be modified
* once Page.lock() has been invoked (not even in a PrintListener).
* This is done after the Page has been built, normally at server startup.
* Allows access to underlying parameterModel. The ParameterModel contains static
* (request-independent) properties of a Widget such as its name, default value and its
* listeners. The ParameterModel can not be modified once Page.lock() has been invoked (not even
* in a PrintListener). This is done after the Page has been built, normally at server startup.
*
* @return
*/
@ -524,15 +509,14 @@ public abstract class Widget extends DescriptiveComponent
/**
* <p>
* This method creates the DOM for the widget. The method is called by the
* Bebop framework and should not be invoked by application developers.
* This method creates the DOM for the widget. The method is called by the Bebop framework and
* should not be invoked by application developers.
* </p>
*
* <p>
* The method first fires the print event allowing application developers
* to set certain properties of the Widget at request time in a
* PrintListener. The methods generateWidget and generateErrors will then
* be invoked to generate either of the following
* The method first fires the print event allowing application developers to set certain
* properties of the Widget at request time in a PrintListener. The methods generateWidget and
* generateErrors will then be invoked to generate either of the following
* </p>
*
* <p>
@ -580,8 +564,7 @@ public abstract class Widget extends DescriptiveComponent
/**
* The XML tag.
*
* @return The tag to be used for the top level DOM element generated for
* this type of Widget.
* @return The tag to be used for the top level DOM element generated for this type of Widget.
*/
protected String getElementTag() {
return BEBOP_FORMWIDGET;
@ -605,11 +588,11 @@ public abstract class Widget extends DescriptiveComponent
widget.addAttribute("type", getType());
widget.addAttribute("name", getName());
widget.addAttribute("class", getName().replace(".", " "));
generateDescriptionXML(state,widget);
generateDescriptionXML(state, widget);
// if (m_label != null) {
// widget.addAttribute("label",
// (String) m_label.localize(state.getRequest()));
// }
// widget.addAttribute("label",
// (String) m_label.localize(state.getRequest()));
// }
exportAttributes(widget);
String value = null;
ParameterData p = getParameterData(state);
@ -625,8 +608,7 @@ public abstract class Widget extends DescriptiveComponent
/**
* Generates the XML for the given widget.
* <p>
* Generates XML fragment:
* <code>&lt;bebop:formErrors message=... id=name>
* Generates XML fragment: <code>&lt;bebop:formErrors message=... id=name>
* &lt;/bebop:formErrors></code>
* </p>
*
@ -646,15 +628,15 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Get the value associated with this widget in the request described by
* <code>ps</code>.
* The type of the returned object depends on the <code>ParameterModel</code>
* underlying this widget. This method is typically called in a
* FormProcessListener to access the value that was submitted for a Widget
* in the Form.
* Get the value associated with this widget in the request described by <code>ps</code>. The
* type of the returned object depends on the <code>ParameterModel</code> underlying this
* widget. This method is typically called in a FormProcessListener to access the value that was
* submitted for a Widget in the Form.
*
* @param ps describes the request currently being processed
*
* @return
*
* @pre ps != null
* @post may return null
*/
@ -676,22 +658,22 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Set the value of the parameter associated with this widget to a new value.
* The exact type of <code>value</code> depends on the
* <code>ParameterModel</code> underlying the widget. This method is typically
* called in a FormInitListener to initialize the value of a Widget in the
* Set the value of the parameter associated with this widget to a new value. The exact type of
* <code>value</code> depends on the <code>ParameterModel</code> underlying the widget. This
* method is typically called in a FormInitListener to initialize the value of a Widget in the
* Form at request time.
*
* @param ps
* @param value
*
* @pre ps != null
* @post value == getValue(ps)
*
* @throws IllegalStateException the form to which the widget belongs has
* not been processed yet.
* @throws IllegalStateException the form to which the widget belongs has not been processed
* yet.
*/
public void setValue(PageState ps, Object value)
throws IllegalStateException {
throws IllegalStateException {
Assert.exists(ps, "PageState");
ParameterData p = getParameterData(ps);
// set value in session if it is being held - allows
@ -706,9 +688,9 @@ public abstract class Widget extends DescriptiveComponent
} else {
throw new IllegalStateException("Cannot set value for widget '" + getName()
+ "': corresponding form '"
+ getForm().getName()
+ "' has not been processed yet.");
+ "': corresponding form '"
+ getForm().getName()
+ "' has not been processed yet.");
}
}
@ -724,7 +706,9 @@ public abstract class Widget extends DescriptiveComponent
/**
*
* @param ps
*
* @return the parameter value for this widget
*
* @post returns null if the FormData are missing
*/
protected ParameterData getParameterData(PageState ps) {
@ -737,11 +721,10 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Respond to an incoming request by calling <code>respond</code> on the
* form to which the widget belongs. This method is called by the Bebop
* framework and should not be invoked by application developers. It is
* somewhat questionable that this method should ever be called, rather
* than having {@link Form#respond Form.respond()} called directly.
* Respond to an incoming request by calling <code>respond</code> on the form to which the
* widget belongs. This method is called by the Bebop framework and should not be invoked by
* application developers. It is somewhat questionable that this method should ever be called,
* rather than having {@link Form#respond Form.respond()} called directly.
*
* @throws javax.servlet.ServletException
* @pre state != null
@ -759,8 +742,8 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Specify a Widget. ValidationGuard implementation to use to determine if
* this widget should run its validation listeners.
* Specify a Widget. ValidationGuard implementation to use to determine if this widget should
* run its validation listeners.
*
* @param guard the Widget.ValidationGuard.
*/
@ -770,12 +753,13 @@ public abstract class Widget extends DescriptiveComponent
}
/**
* Inner interface used to determine if the validation listeners should be
* run for this widget or not.
* Inner interface used to determine if the validation listeners should be run for this widget
* or not.
*/
public interface ValidationGuard {
boolean shouldValidate(PageState ps);
}
/**
@ -792,6 +776,7 @@ public abstract class Widget extends DescriptiveComponent
* Adds an error to be displayed with this parameter.
*
* @param error A string showing the error to the user.
*
* @deprecated refactor to use addError(GlobalizedMessage) instead.
*/
public void addError(String error) {
@ -802,4 +787,5 @@ public abstract class Widget extends DescriptiveComponent
public String toString() {
return super.toString() + " [" + getName() + "]";
}
}

View File

@ -443,7 +443,7 @@ div#left {
width: 25%;
}
div#left, div#right{
div#left, div#right {
top: 0 !important;
bottom: 0;
}
@ -1482,9 +1482,11 @@ input#draft_search:active {
#content form fieldset {
border: none;
margin: 0.5em 0em 1em 0.3em;
border-top: 1px dotted #0776A0;
border-bottom: 1px dotted #0776A0;
padding: 0.3em 0em;
/*border-top: 1px dotted #0776A0; */
/*border-bottom: 1px dotted #0776A0; */
border: 1px dotted #0776A0;
/*padding: 0.3em 0em;*/
padding: 1em;
color: #0776A0;
font-weight: bold;
}
@ -1570,6 +1572,10 @@ div.bebopGridPanel{
margin-top: 15px;
}
.hint {
font-size: 1.6em;
}
.hint:hover:after {
position: absolute;
box-shadow: 0 0 5px #4a4a4a;
@ -1579,7 +1585,9 @@ div.bebopGridPanel{
top: auto;
right: auto;
width: 30%;
background-image: inear-gradient(top, #eeeeee, #cccccc);
font-size: 0.63em;
z-index: 65535;
background-image: linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);

View File

@ -31,282 +31,291 @@
<!-- Autor: Sören Bernstein -->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:mandalay="http://mandalay.quasiweb.de"
exclude-result-prefixes="xsl bebop cms nav mandalay"
version="1.0">
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:mandalay="http://mandalay.quasiweb.de"
exclude-result-prefixes="xsl bebop cms nav mandalay"
version="1.0">
<!-- DE Benutze DHTML-Editor (HTMLArea) -->
<!-- EN Use DHTML-Editor (HTMLArea) -->
<xsl:template match="bebop:dhtmleditor">
<!-- DE Benutze DHTML-Editor (HTMLArea) -->
<!-- EN Use DHTML-Editor (HTMLArea) -->
<xsl:template match="bebop:dhtmleditor">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:dhtmleditor/@name"/>
</xsl:variable>
<xsl:if test="@name=$firstMatch">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:dhtmleditor/@name"/>
</xsl:variable>
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "/assets/htmlarea/";
_editor_lang = "en";
var numEd = 0;
</script>
<script type="text/javascript">
_editor_url = "/assets/htmlarea/";
_editor_lang = "en";
var numEd = 0;
</script>
<script type="text/javascript" src="/assets/htmlarea/htmlarea.js"/>
<script type="text/javascript" src="/assets/htmlarea/htmlarea.js"/>
<script type="text/javascript">
<xsl:for-each select="bebop:plugin">
HTMLArea.loadPlugin("<xsl:value-of select="@name"/>");
</xsl:for-each>
<script type="text/javascript">
<xsl:for-each select="bebop:plugin">
HTMLArea.loadPlugin("<xsl:value-of select="@name"/>");
</xsl:for-each>
// Using Styled.js didn't seem to work anymore with htmlarea 3.0rc3,
// so instead we configure the editor here
// Using Styled.js didn't seem to work anymore with htmlarea 3.0rc3,
// so instead we configure the editor here
var css_plugin_args = {
combos : [
{ label: "Style",
options: { "None" : "",
"Main" : "main",
"Dark" : "dark",
"Medium" : "medium",
"Light" : "light"
}
}
]
};
<xsl:for-each select="//bebop:dhtmleditor">
var config_<xsl:value-of select="@name"/> = null;
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
function initDocument() {
<xsl:for-each select="//bebop:dhtmleditor">
config_<xsl:value-of select="@name"/> = new HTMLArea.Config();
editor_<xsl:value-of select="@name"/> = new HTMLArea("ta_<xsl:value-of select="@name"/>", config_<xsl:value-of select="@name"/>);
config_<xsl:value-of select="@name"/>.registerButton("insertlink", "Insert link", _editor_url + "images/ed_link.gif", false, function(editor) {
<!-- Modified to add the open in new window button NJ-20062403-->
<!-- editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
var css_plugin_args = {
combos : [
{ label: "Style",
options: { "None" : "",
"Main" : "main",
"Dark" : "dark",
"Medium" : "medium",
"Light" : "light"
}
var furl = param["f_url"];
var sel = editor._getSelection();
var range = editor._createRange(sel);
editor._doc.execCommand("createlink", false, furl);
}, null); -->
var sel = editor._getSelection();
var range = editor._createRange(sel);
var compare = 0;
if (HTMLArea.is_ie) {
compare = range.compareEndPoints("StartToEnd", range);
} else {
compare = range.compareBoundaryPoints(range.START_TO_END, range);
}
if (compare == 0) {
alert("You need to select some text before creating a link");
return;
}
editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
}
var sel = editor._getSelection();
var range = editor._createRange(sel);
if (range.insertNode) { // Standards compliant version
var link = document.createElement("a");
var linkText = range.extractContents();
link.href=param["f_url"];
if (param["f_external"]) link.target="_blank";
link.appendChild(linkText);
range.insertNode(link);
} else if (range.pasteHTML) { // Alternative non standards version
var target = "";
if (param["f_external"]) {
]
};
<xsl:for-each select="//bebop:dhtmleditor">
var config_<xsl:value-of select="@name"/> = null;
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
function initDocument() {
<xsl:for-each select="//bebop:dhtmleditor">
config_<xsl:value-of select="@name"/> = new HTMLArea.Config();
editor_<xsl:value-of select="@name"/> = new HTMLArea("ta_<xsl:value-of select="@name"/>", config_<xsl:value-of select="@name"/>);
config_<xsl:value-of select="@name"/>.registerButton("insertlink", "Insert link", _editor_url + "images/ed_link.gif", false, function(editor) {
<!-- Modified to add the open in new window button NJ-20062403-->
<!-- editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
}
var furl = param["f_url"];
var sel = editor._getSelection();
var range = editor._createRange(sel);
editor._doc.execCommand("createlink", false, furl);
}, null); -->
var sel = editor._getSelection();
var range = editor._createRange(sel);
var compare = 0;
if (HTMLArea.is_ie) {
compare = range.compareEndPoints("StartToEnd", range);
} else {
compare = range.compareBoundaryPoints(range.START_TO_END, range);
}
if (compare == 0) {
alert("You need to select some text before creating a link");
return;
}
editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
}
var sel = editor._getSelection();
var range = editor._createRange(sel);
if (range.insertNode) { // Standards compliant version
var link = document.createElement("a");
var linkText = range.extractContents();
link.href=param["f_url"];
if (param["f_external"]) link.target="_blank";
link.appendChild(linkText);
range.insertNode(link);
} else if (range.pasteHTML) { // Alternative non standards version
var target = "";
if (param["f_external"]) {
target='target="_blank"';
}
range.pasteHTML('&lt;a href="' + param["f_url"] + '"' + target + '&gt;' + range.text + '&lt;/a&gt;');
}
range.pasteHTML('&lt;a href="' + param["f_url"] + '"' + target + '&gt;' + range.text + '&lt;/a&gt;');
}
}, null);
});
config_<xsl:value-of select="@name"/>.sizeIncludesToolbar = false;
config_<xsl:value-of select="@name"/>.statusBar = false;
config_<xsl:value-of select="@name"/>.toolbar = [[ "formatblock", "space", "bold", "italic", "underline", "strikethrough", "separator", "subscript", "superscript", "separator", "copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword" ], [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "lefttoright", "righttoleft", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator", "textindicator", "separator", "inserthorizontalrule", "insertlink", "insertimage", "inserttable", "htmlmode", "separator", "popupeditor", "separator" ]];
<xsl:if test="bebop:config/@hidden-buttons">
config_<xsl:value-of select="@name"/>.hideSomeButtons("<xsl:value-of select="bebop:config/@hidden-buttons"/>");
</xsl:if>
editor_<xsl:value-of select="@name"/>.config.pageStyle = "@import url(/assets/htmlarea/htmlarea.css);";
<xsl:for-each select="bebop:plugin">
<xsl:choose>
<xsl:when test="@name = 'CSS'">
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>, css_plugin_args);
</xsl:when>
<xsl:otherwise>
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>);
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
setTimeout(function() {editor_<xsl:value-of select="@name"/>.generate();}, 500*numEd);
numEd++;
</xsl:for-each>
}
}, null);
});
config_<xsl:value-of select="@name"/>.sizeIncludesToolbar = false;
config_<xsl:value-of select="@name"/>.statusBar = false;
config_<xsl:value-of select="@name"/>.toolbar = [[ "formatblock", "space", "bold", "italic", "underline", "strikethrough", "separator", "subscript", "superscript", "separator", "copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword" ], [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "lefttoright", "righttoleft", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator", "textindicator", "separator", "inserthorizontalrule", "insertlink", "insertimage", "inserttable", "htmlmode", "separator", "popupeditor", "separator" ]];
<xsl:if test="bebop:config/@hidden-buttons">
config_<xsl:value-of select="@name"/>.hideSomeButtons("<xsl:value-of select="bebop:config/@hidden-buttons"/>");
</xsl:if>
editor_<xsl:value-of select="@name"/>.config.pageStyle = "@import url(/assets/htmlarea/htmlarea.css);";
HTMLArea.init();
HTMLArea.onload = initDocument;
<xsl:for-each select="bebop:plugin">
<xsl:choose>
<xsl:when test="@name = 'CSS'">
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>, css_plugin_args);
</xsl:when>
<xsl:otherwise>
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>);
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
setTimeout(function() {editor_<xsl:value-of select="@name"/>.generate();}, 500*numEd);
numEd++;
</xsl:for-each>
}
HTMLArea.init();
HTMLArea.onload = initDocument;
function wordClean_<xsl:value-of select="@name"/>() {
editor_<xsl:value-of select="@name"/>._wordClean();
}
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
<div style="width:560px; border:1px outset #666;">
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</div>
</xsl:template>
<!-- DE Benutze FCKEditor -->
<!-- EN Use FCKEditor -->
<xsl:template match="bebop:fckeditor">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:fckeditor/@name"/>
</xsl:variable>
<!-- EN Start of the FCKeditor component code -->
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "/assets/fckeditor/";
_editor_lang = "en";
var numEd = 0;
</script>
<script type="text/javascript" src="/assets/fckeditor/fckeditor.js"/>
<script type="text/javascript">
<xsl:for-each select="//bebop:fckeditor">
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
window.onload = function() {
<xsl:for-each select="//bebop:fckeditor">
editor_<xsl:value-of select="@name"/> = new FCKeditor("ta_<xsl:value-of select="@name"/>") ;
editor_<xsl:value-of select="@name"/>.Width =
<xsl:choose>
<xsl:when test="@metadata.width">
'<xsl:value-of select="@metadata.width"/>';
</xsl:when>
<xsl:otherwise>
'100%';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.Height =
<xsl:choose>
<xsl:when test="@metadata.height">
'<xsl:value-of select="@metadata.height"/>';
</xsl:when>
<xsl:otherwise>
'400';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.BasePath = "/assets/fckeditor/" ;
editor_<xsl:value-of select="@name"/>.PluginsPath = editor_<xsl:value-of select="@name"/>.BasePath + "editor/plugins/" ;
<xsl:if test="bebop:config/@path">
editor_<xsl:value-of select="//bebop:fckeditor/@name"/>.Config['CustomConfigurationsPath'] = "<xsl:value-of select="//bebop:fckeditor/bebop:config/@path"/>";
</xsl:if>
editor_<xsl:value-of select="@name"/>.ToolbarSet = "Basic";
editor_<xsl:value-of select="@name"/>.ReplaceTextarea();
}
</xsl:for-each>
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
<!-- EN End of FCKeditor setup -->
<textarea id="ta_{@name}" name="{@name}" style="width:100%" rows="{@rows}" cols="{@cols}" wrap="{@wrap}">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</xsl:template>
<!-- DE Benutze Xinha -->
<!-- EN Use Xinha -->
<xsl:template match="bebop:xinha">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:xinha/@name"/>
</xsl:variable>
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "<xsl:value-of select="@editor_url"/>";
_editor_lang ="<xsl:value-of select="$lang"/>";
<!-- _editor_skin = "silva";-->
<!-- DE Definiere, welche Textareas zu Xinha-Editoren werden sollen -->
<!-- EN Define all textares which should become xinha editors -->
xinha_editors = [
<xsl:for-each select="//bebop:xinha">
'ta_<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
<!-- DE Lade die angegebenen Plugins falls angegeben -->
<!-- EN Load the mentioned plugins if any-->
xinha_plugins = null;
<xsl:if test="bebop:plugin">
xinha_plugins = [
<xsl:for-each select="bebop:plugin">
'<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
function wordClean_<xsl:value-of select="@name"/>() {
editor_<xsl:value-of select="@name"/>._wordClean();
}
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
</script>
<!-- DE Lade die externe JavaScript-Datei für Xinha -->
<script type="text/javascript" src="{@editor_src}"/>
<xsl:call-template name="processLabel">
<xsl:with-param name="widget" select="."/>
</xsl:call-template>
<div style="width:560px; border:1px outset #666;">
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</div>
<!-- DE Lade die angegebene Konfiguration -->
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="bebop:config[@name='XinhaConfig']">
<xsl:value-of select="bebop:config[@name='XinhaConfig']/@path"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="bebop:config[@name='Xinha.Config']/@path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</script>
</xsl:template>
</xsl:if>
<!-- DE Benutze FCKEditor -->
<!-- EN Use FCKEditor -->
<xsl:template match="bebop:fckeditor">
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</xsl:template>
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:fckeditor/@name"/>
</xsl:variable>
<!-- EN Start of the FCKeditor component code -->
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "/assets/fckeditor/";
_editor_lang = "en";
var numEd = 0;
</script>
<script type="text/javascript" src="/assets/fckeditor/fckeditor.js"/>
<script type="text/javascript">
<xsl:for-each select="//bebop:fckeditor">
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
window.onload = function() {
<xsl:for-each select="//bebop:fckeditor">
editor_<xsl:value-of select="@name"/> = new FCKeditor("ta_<xsl:value-of select="@name"/>") ;
editor_<xsl:value-of select="@name"/>.Width =
<xsl:choose>
<xsl:when test="@metadata.width">
'<xsl:value-of select="@metadata.width"/>';
</xsl:when>
<xsl:otherwise>
'100%';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.Height =
<xsl:choose>
<xsl:when test="@metadata.height">
'<xsl:value-of select="@metadata.height"/>';
</xsl:when>
<xsl:otherwise>
'400';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.BasePath = "/assets/fckeditor/" ;
editor_<xsl:value-of select="@name"/>.PluginsPath = editor_<xsl:value-of select="@name"/>.BasePath + "editor/plugins/" ;
<xsl:if test="bebop:config/@path">
editor_<xsl:value-of select="//bebop:fckeditor/@name"/>.Config['CustomConfigurationsPath'] = "<xsl:value-of select="//bebop:fckeditor/bebop:config/@path"/>";
</xsl:if>
editor_<xsl:value-of select="@name"/>.ToolbarSet = "Basic";
editor_<xsl:value-of select="@name"/>.ReplaceTextarea();
}
</xsl:for-each>
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
<!-- EN End of FCKeditor setup -->
<xsl:call-template name="processLabel">
<xsl:with-param name="widget" select="."/>
</xsl:call-template>
<textarea id="ta_{@name}" name="{@name}" style="width:100%" rows="{@rows}" cols="{@cols}" wrap="{@wrap}">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</xsl:template>
<!-- DE Benutze Xinha -->
<!-- EN Use Xinha -->
<xsl:template match="bebop:xinha">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:xinha/@name"/>
</xsl:variable>
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "<xsl:value-of select="@editor_url"/>";
_editor_lang ="<xsl:value-of select="$lang"/>";
<!-- _editor_skin = "silva";-->
<!-- DE Definiere, welche Textareas zu Xinha-Editoren werden sollen -->
<!-- EN Define all textares which should become xinha editors -->
xinha_editors = [
<xsl:for-each select="//bebop:xinha">
'ta_<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
<!-- DE Lade die angegebenen Plugins falls angegeben -->
<!-- EN Load the mentioned plugins if any-->
xinha_plugins = null;
<xsl:if test="bebop:plugin">
xinha_plugins = [
<xsl:for-each select="bebop:plugin">
'<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
</xsl:if>
</script>
<!-- DE Lade die externe JavaScript-Datei für Xinha -->
<script type="text/javascript" src="{@editor_src}"/>
<!-- DE Lade die angegebene Konfiguration -->
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="bebop:config[@name='XinhaConfig']">
<xsl:value-of select="bebop:config[@name='XinhaConfig']/@path"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="bebop:config[@name='Xinha.Config']/@path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</script>
</xsl:if>
<xsl:call-template name="processLabel">
<xsl:with-param name="widget" select="."/>
</xsl:call-template>
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</xsl:template>
</xsl:stylesheet>

View File

@ -112,6 +112,18 @@
<img alt="{$alt}" title="{$title}" src="{$src}"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:if test="string-length(./@hint) &gt; 0">
<span class="hint">
<xsl:attribute name="content">
<xsl:value-of select="@hint"/>
</xsl:attribute>
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'bebop'"/>
<xsl:with-param name="setting" select="'hintSymbol'"/>
<xsl:with-param name="default" select="'(?)'"/>
</xsl:call-template>
</span>
</xsl:if>
</a>
</xsl:template>

View File

@ -208,15 +208,45 @@
<fieldset class="date">
<legend>
<xsl:value-of select="@label"/>
<xsl:if test="string-length(./@hint) &gt; 0">
<span class="hint">
<xsl:attribute name="content">
<xsl:value-of select="@hint"/>
</xsl:attribute>
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'bebop'"/>
<xsl:with-param name="setting" select="'hintSymbol'"/>
<xsl:with-param name="default" select="'(?)'"/>
</xsl:call-template>
</span>
</xsl:if>
</legend>
<xsl:apply-templates/>
</fieldset>
</xsl:template>
<xsl:template match="bebop:time">
<span class="time">
<!--<span class="time">
<xsl:apply-templates/>
</span>
</span>-->
<fieldset>
<legend>
<xsl:value-of select="@label"/>
<xsl:if test="string-length(./@hint) &gt; 0">
<span class="hint">
<xsl:attribute name="content">
<xsl:value-of select="@hint"/>
</xsl:attribute>
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'bebop'"/>
<xsl:with-param name="setting" select="'hintSymbol'"/>
<xsl:with-param name="default" select="'(?)'"/>
</xsl:call-template>
</span>
</xsl:if>
</legend>
<xsl:apply-templates/>
</fieldset>
</xsl:template>
<xsl:template match="bebop:fieldset">

View File

@ -24,8 +24,9 @@
<setting id="padding/showPadding">false</setting>
<setting id="padding/borderColor">cccccc</setting>
<!--<setting id="hintSymbol">(?)</setting>-->
<!--<setting id="hintSymbol">&#x2753;</setting>-->
<setting id="hintSymbol">(?)</setting>
<setting id="hintSymbol">&#x24d8;</setting>
<setting id="table/setImage/checkboxChecked">/images/bebop/checkBoxChecked.gif</setting>
<setting id="table/setImage/checkboxUnchecked">/images/bebop/checkBoxUnchecked.gif</setting>