📄 cmstooldialog.java
字号:
* @return block area start / end segment
*
* @see CmsDialog#dialogBlock(int, String, boolean)
*/
public String iconsBlockArea(int segment, String headline) {
StringBuffer result = new StringBuffer(512);
if (segment == HTML_START) {
result.append("<!-- icons block area start -->\n");
result.append("<div class=\"dialogcontent\" unselectable=\"on\">");
result.append("<fieldset class=\"dialogblock\">\n");
result.append("<legend>");
result.append("<span class=\"textbold");
result.append("\" unselectable=\"on\">");
result.append(headline);
result.append("</span></legend>\n");
result.append("\t\t<table class='toolsArea' width='100%' cellspacing='0' cellpadding='0' border='0'>\n");
result.append("\t\t\t<tr><td>\n");
} else {
result.append("\t\t\t</td></tr>\n");
result.append("\t\t</table>\n");
result.append("</fieldset></div>\n");
result.append("<p> </p>\n");
result.append("<!-- icons block area end -->\n");
}
return result.toString();
}
/**
* Builds the end HTML for a block area with border in the dialog content area.<p>
*
* @return block area end segment
*
* @see CmsDialog#dialogBlockEnd()
*/
public String iconsBlockAreaEnd() {
return iconsBlockArea(HTML_END, null);
}
/**
* Builds the start HTML for a block area with border and optional subheadline in the dialog content area.<p>
*
* @param headline the headline String for the block
*
* @return block area start segment
*
* @see CmsDialog#dialogBlockStart(String)
*/
public String iconsBlockAreaStart(String headline) {
return iconsBlockArea(HTML_START, headline);
}
/**
* Initializes the admin tool main view.<p>
*
* @return the new modified params array
* @throws CmsRoleViolationException in case the dialog is opened by a user without the necessary privileges
*/
public Map initAdminTool() throws CmsRoleViolationException {
Map params = new HashMap(getParameterMap());
// initialize
getToolManager().initParams(this);
// adjust params if called as default
if (!useNewStyle()) {
params.put(PARAM_STYLE, new String[] {CmsToolDialog.STYLE_NEW});
setParamStyle(CmsToolDialog.STYLE_NEW);
}
try {
// a dialog just for the close link param accessors
CmsDialog wp = (CmsDialog)this;
// set close link
if (CmsStringUtil.isEmptyOrWhitespaceOnly(wp.getParamCloseLink())) {
if (!getToolManager().getBaseToolPath(this).equals(getToolManager().getCurrentToolPath(this))) {
Map args = getToolManager().resolveAdminTool(getParamRoot(), getParentPath()).getHandler().getParameters(
wp);
wp.setParamCloseLink(CmsToolManager.linkForToolPath(getJsp(), getParentPath(), args));
params.put(CmsDialog.PARAM_CLOSELINK, new String[] {wp.getParamCloseLink()});
}
}
} catch (Exception e) {
// ignore
}
if (!getToolManager().getCurrentTool(this).getHandler().isEnabled(getCms())) {
throw new CmsRoleViolationException(Messages.get().container(Messages.ERR_ADMIN_INSUFFICIENT_RIGHTS_0));
}
return params;
}
/**
* @see org.opencms.workplace.CmsWorkplace#pageBody(int, java.lang.String, java.lang.String)
*/
public String pageBody(int segment, String className, String parameters) {
if (!useNewStyle()) {
return super.pageBody(segment, className, parameters);
} else {
Map data = CmsStringUtil.extendAttribute(parameters, "onLoad", "bodyLoad();");
String onLoad = (String)data.get("value");
String myPars = (String)data.get("text");
data = CmsStringUtil.extendAttribute(myPars, "onUnload", "bodyUnload();");
String onUnload = (String)data.get("value");
myPars = (String)data.get("text");
if (segment == HTML_START) {
StringBuffer html = new StringBuffer(512);
html.append("</head>\n");
html.append("<body onLoad=");
html.append(onLoad);
html.append(" onUnload=");
html.append(onUnload);
html.append(CmsStringUtil.isNotEmpty(className) ? " class='" + className + "'" : "");
html.append(CmsStringUtil.isNotEmpty(myPars) ? " " + myPars : "");
html.append(">\n");
html.append("\t<table border='0' cellspacing='0' cellpadding='0' id='loaderContainer' onClick='return false;'>\n");
html.append("\t\t<tr><td id='loaderContainerH'><div id='loader'>\n");
html.append("\t\t\t<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>\n");
html.append("\t\t\t\t<p><img src='");
html.append(getSkinUri());
html.append("commons/wait.gif");
html.append("' height='32' width='32' alt=''/>\n");
html.append("\t\t\t\t<strong>");
html.append(Messages.get().getBundle(getLocale()).key(Messages.GUI_ADMIN_VIEW_LOADING_0));
html.append("</strong></p>\n");
html.append("\t\t\t</td></tr></table>\n");
html.append("\t\t</div></td></tr>\n");
html.append("\t</table>\n");
html.append("\t<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td id='screenH'>\n");
return html.toString();
} else {
StringBuffer html = new StringBuffer(128);
html.append("\t</td></tr></table>\n");
html.append("</body>");
return html.toString();
}
}
}
/**
* @see org.opencms.workplace.CmsWorkplace#pageHtmlStyle(int, java.lang.String, java.lang.String)
*/
public String pageHtmlStyle(int segment, String title, String stylesheet) {
if (!useNewStyle() || segment != HTML_START) {
return super.pageHtmlStyle(segment, title, stylesheet);
}
StringBuffer html = new StringBuffer(512);
html.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
html.append("<html>\n");
html.append("<head>\n");
html.append("<meta http-equiv='Content-Type' content='text/html; charset=");
html.append(getEncoding());
html.append("' >\n");
if (title != null) {
html.append("<title>");
html.append(title);
html.append("</title>\n");
} else {
// the title tag is required for valid HTML
html.append("<title></title>\n");
}
html.append("<link rel='stylesheet' type='text/css' href='");
html.append(getStyleUri(getJsp()));
html.append("new_admin.css'>\n");
html.append("<script type='text/javascript' src='");
html.append(getSkinUri());
html.append("admin/javascript/general.js'></script>\n");
html.append("<script type='text/javascript' src='");
html.append(getResourceUri());
html.append("editors/xmlcontent/help.js'></script>\n\n");
html.append("<script type='text/javascript'>\n");
html.append("\tfunction bodyLoad() {\n");
html.append("\t\tsetContext(\"");
html.append(CmsStringUtil.escapeJavaScript(resolveMacros(getAdminTool().getHandler().getHelpText())));
html.append("\");\n");
html.append("\t\tsetActiveItemByName(\"");
html.append(getCurrentToolPath());
html.append("\");\n");
html.append("\t\tloadingOff();\n");
html.append("\t\ttry {\n");
html.append("\t\t\tdocument.getElementById('loaderContainerH').height = wHeight();\n");
html.append("\t\t} catch (e) {}\n");
html.append("\t}\n");
html.append("\tfunction bodyUnload() {\n");
html.append("\t\tloadingOn();\n");
html.append("\t}\n");
html.append("</script>\n");
return html.toString();
}
/**
* Sets the value of the base parameter.<p>
*
* @param paramBase the value of the base parameter to set
*/
public void setParamBase(String paramBase) {
m_paramBase = paramBase;
}
/**
* Sets the path parameter value.<p>
*
* @param paramPath the path parameter value to set
*/
public void setParamPath(String paramPath) {
m_paramPath = paramPath;
}
/**
* Sets the root parameter value.<p>
*
* @param paramRoot the root parameter value to set
*/
public void setParamRoot(String paramRoot) {
m_paramRoot = paramRoot;
}
/**
* Sets the style parameter value.<p>
*
* @param paramStyle the style parameter value to set
*/
public void setParamStyle(String paramStyle) {
m_paramStyle = paramStyle;
}
/**
* Tests if we are working with the new administration dialog style.<p>
*
* The default is the new style, this param is not intented for external use.<p>
*
* @return <code>true</code> if using the new style
*/
public boolean useNewStyle() {
return getParamStyle() != null && getParamStyle().equals(CmsToolDialog.STYLE_NEW);
}
/**
* @see org.opencms.workplace.CmsWorkplace#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
*/
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) {
fillParamValues(request);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -