Merged BRANCHES/V3.4 to HEAD:

24209: Fixes for screenshot 5 in ALF-5590: Translation errors in Explorer

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@24211 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2010-12-03 14:52:07 +00:00
parent cb4b55347f
commit b4ffc16746
5 changed files with 66 additions and 42 deletions

View File

@@ -64,6 +64,7 @@ public class PickerBean implements Serializable
private static final long serialVersionUID = 8950457520023294902L;
private static final String MSG_CATEGORIES = "categories";
private static final String MSG_TAGS = "tags";
private static final String ID_URL = "url";
private static final String ID_ICON = "icon";
private static final String ID_CHILDREN = "children";
@@ -295,7 +296,7 @@ public class PickerBean implements Serializable
if (parentRef == null)
{
out.writeNullValue(ID_ID);
out.writeValue(ID_NAME, "Tags");
out.writeValue(ID_NAME, Application.getMessage(fc, MSG_TAGS));
out.writeValue(ID_ISROOT, true);
out.writeValue(ID_SELECTABLE, false);
}

View File

@@ -19,7 +19,6 @@
package org.alfresco.web.ui.repo.component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@@ -43,6 +42,9 @@ import org.springframework.web.jsf.FacesContextUtils;
public class UIAjaxTagPicker extends BaseAjaxItemPicker
{
private static final String MSG_CLICK_TO_SELECT_TAG = "click_to_select_tag";
private static final String MSG_ADD = "add";
private static final String MSG_ADD_A_TAG = "add_a_tag";
private static final String MSG_REMOVE = "remove";
@Override
public String getFamily()
@@ -80,6 +82,7 @@ public class UIAjaxTagPicker extends BaseAjaxItemPicker
return this.label;
}
@SuppressWarnings("unchecked")
@Override
/**
* @see javax.faces.component.UIComponentBase#encodeBegin(javax.faces.context.FacesContext)
@@ -168,8 +171,8 @@ public class UIAjaxTagPicker extends BaseAjaxItemPicker
out.write("<script type='text/javascript'>");
out.write("function init" + divId + "() {");
out.write(" window." + objId + " = new AlfTagger('" + divId + "','" + objId + "','" + getServiceCall() +
"','" + formClientId + "');");
out.write(" window." + objId + ".setChildNavigation(false);");
"','" + formClientId + "','" + msg.getString(MSG_ADD) + "','" + msg.getString(MSG_REMOVE) + "');");
out.write(" window." + objId + ".setChildNavigation(false);");
if (getDefaultIcon() != null)
{
out.write(" window." + objId + ".setDefaultIcon('" + getDefaultIcon() + "');");
@@ -204,32 +207,32 @@ public class UIAjaxTagPicker extends BaseAjaxItemPicker
out.write((String)attrs.get("styleClass"));
}
out.write(">");
if (isDisabled())
{
out.write(" <span>");
if (isDisabled())
{
out.write(" <span>");
if (selectedNames != null)
{
out.write(selectedNames);
}
out.write(" </span>");
}
else
{
out.write(" <span class='pickerActionButton'><a href='javascript:" + objId + ".showSelector();'>");
if (selectedNames == null)
{
if ("".equals(getLabel()))
{
setLabel(msg.getString(MSG_CLICK_TO_SELECT_TAG));
}
out.write(getLabel());
}
else
{
out.write(selectedNames);
}
}
else
{
out.write(" <span class='pickerActionButton'><a href='javascript:" + objId + ".showSelector();'>");
if (selectedNames == null)
{
if ("".equals(getLabel()))
{
setLabel(msg.getString(MSG_CLICK_TO_SELECT_TAG));
}
out.write(getLabel());
}
else
{
out.write(selectedNames);
}
out.write(" </a></span>");
}
}
out.write(" </div>");
// container for item navigation
out.write(" <div id='" + divId + "-selector' class='pickerSelector'>");
@@ -248,21 +251,31 @@ public class UIAjaxTagPicker extends BaseAjaxItemPicker
out.write(" <span class='pickerNavBreadcrumb'>");
out.write(" <span id='" + divId + "-nav-txt' class='pickerNavBreadcrumbText'></span></a>");
out.write(" </span>");
out.write(" <span class='pickerNavAddTag'>");
out.write(" <span class='pickerAddTagIcon'></span>");
out.write(" <span id='" + divId + "-addTag-linkContainer' class='pickerAddTagLinkContainer'>");
out.write(" <a href='#' onclick='window." + objId + ".showAddTagForm(); return false;'>Add a tag</a>");
out.write(" </span>");
out.write(" <span id='" + divId + "-addTag-formContainer' class='pickerAddTagFormContainer'>");
out.write(" <input id='" + divId + "-addTag-box' class='pickerAddTagBox' name='" + divId + "-addTag-box' type='text'>");
out.write(" <img id='" + divId + "-addTag-ok' class='pickerAddTagImage' alt='Add' src='");
out.write(" <span class='pickerNavAddTag'>");
out.write(" <span class='pickerAddTagIcon'></span>");
out.write(" <span id='" + divId + "-addTag-linkContainer' class='pickerAddTagLinkContainer'>");
out.write(" <a href='#' onclick='window." + objId + ".showAddTagForm(); return false;'>");
out.write(msg.getString(MSG_ADD_A_TAG));
out.write("</a>");
out.write(" </span>");
out.write(" <span id='" + divId + "-addTag-formContainer' class='pickerAddTagFormContainer'>");
out.write(" <input id='" + divId + "-addTag-box' class='pickerAddTagBox' name='" + divId + "-addTag-box' type='text'>");
out.write(" <img id='" + divId + "-addTag-ok' class='pickerAddTagImage' src='");
out.write(contextPath);
out.write("/images/office/action_successful.gif'>");
out.write(" <img id='" + divId + "-addTag-cancel' class='pickerAddTagImage' alt='Cancel' src='");
out.write("/images/office/action_successful.gif' alt='");
out.write(msg.getString(MSG_ADD));
out.write("' title='");
out.write(msg.getString(MSG_ADD));
out.write("'>");
out.write(" <img id='" + divId + "-addTag-cancel' class='pickerAddTagImage' src='");
out.write(contextPath);
out.write("/images/office/action_failed.gif'>");
out.write(" </span>");
out.write(" </span>");
out.write("/images/office/action_failed.gif' alt='");
out.write(msg.getString(MSG_CANCEL));
out.write("' title='");
out.write(msg.getString(MSG_CANCEL));
out.write("'>");
out.write(" </span>");
out.write(" </span>");
out.write(" <span id='" + divId + "-nav-add'></span>");
out.write(" </div>");
out.write(" </div>");