📄 cmspreferences.java
字号:
* @param htmlAttributes optional html attributes for the &lgt;select> tag
* @return the html for the workplace start site select box
*/
public String buildSelectSite(String htmlAttributes) {
List options = new ArrayList();
List values = new ArrayList();
int selectedIndex = 0;
List sites = CmsSiteManager.getAvailableSites(getCms(), true);
Iterator i = sites.iterator();
int pos = 0;
while (i.hasNext()) {
CmsSite site = (CmsSite)i.next();
String siteRoot = site.getSiteRoot();
if (!siteRoot.endsWith("/")) {
siteRoot += "/";
}
values.add(siteRoot);
options.add(site.getTitle());
if (siteRoot.equals(getParamTabWpSite())) {
// this is the user's currently chosen site
selectedIndex = pos;
}
pos++;
}
return buildSelect(htmlAttributes, options, values, selectedIndex);
}
/**
* Returns a html select box filled with the views accessible by the current user.<p>
*
* @param htmlAttributes attributes that will be inserted into the generated html
* @return a html select box filled with the views accessible by the current user
*/
public String buildSelectView(String htmlAttributes) {
List options = new ArrayList();
List values = new ArrayList();
int selectedIndex = 0;
// loop through the vectors and fill the result vectors
Iterator i = OpenCms.getWorkplaceManager().getViews().iterator();
int count = -1;
while (i.hasNext()) {
count++;
CmsWorkplaceView view = (CmsWorkplaceView)i.next();
boolean visible = true;
try {
getCms().readResource(view.getUri());
} catch (CmsException e) {
// should usually never happen
if (LOG.isInfoEnabled()) {
LOG.info(e.getLocalizedMessage());
}
visible = false;
}
if (visible) {
String localizedKey = resolveMacros(view.getKey());
options.add(localizedKey);
values.add(view.getUri());
if (view.getUri().equals(getParamTabWpView())) {
selectedIndex = count;
}
}
}
return buildSelect(htmlAttributes, options, values, selectedIndex);
}
/**
* Builds the html for the workplace button style select box.<p>
*
* @param htmlAttributes optional html attributes for the &lgt;select> tag
* @return the html for the workplace button style select box
*/
public String buildSelectWorkplaceButtonStyle(String htmlAttributes) {
int selectedIndex = Integer.parseInt(getParamTabWpButtonStyle());
return buildSelectButtonStyle(htmlAttributes, selectedIndex);
}
/**
* Builds the html code for the static user information table (tab 4).<p>
*
* @return the html code for the static user information table
*/
public String buildUserInformation() {
StringBuffer result = new StringBuffer(512);
CmsUser user = getSettings().getUser();
result.append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n");
result.append("<tr>\n");
result.append("\t<td style=\"width: 25%;\">");
result.append(key(Messages.GUI_LABEL_USER_0));
result.append("</td>\n");
result.append("\t<td class=\"textbold\" style=\"width: 25%;\">");
result.append(user.getName());
result.append("</td>\n");
result.append("\t<td style=\"width: 25%;\">");
result.append(key(Messages.GUI_LABEL_EMAIL_0));
result.append("</td>\n");
result.append("\t<td class=\"textbold\" style=\"width: 25%;\">");
result.append(user.getEmail());
result.append("</td>\n");
result.append("</tr>\n");
result.append("<tr>\n");
result.append("\t<td>");
result.append(key(Messages.GUI_LABEL_LASTNAME_0));
result.append("</td>\n");
result.append("\t<td class=\"textbold\">");
result.append(user.getLastname());
result.append("</td>\n");
result.append("\t<td rowspan=\"3\" style=\"vertical-align: top;\">");
result.append(key(Messages.GUI_INPUT_ADRESS_0));
result.append("</td>\n");
String address = user.getAddress();
result.append("\t<td rowspan=\"3\" class=\"textbold\" style=\"vertical-align: top;\">");
result.append(address);
result.append("</td>\n");
result.append("</tr>\n");
result.append("<tr>\n");
result.append("\t<td>");
result.append(key(Messages.GUI_LABEL_FIRSTNAME_0));
result.append("</td>\n");
result.append("\t<td class=\"textbold\">");
result.append(user.getFirstname());
result.append("</td>\n");
result.append("</tr>\n");
result.append("<tr>\n");
result.append("\t<td>");
result.append(key(Messages.GUI_LABEL_DESCRIPTION_0));
result.append("</td>\n");
result.append("\t<td class=\"textbold\">");
result.append(user.getDescription());
result.append("</td>\n");
result.append("</tr>\n");
result.append("</table>\n");
return result.toString();
}
/**
* Returns the new password value.<p>
*
* @return the new password value
*/
public String getParamNewPassword() {
return m_paramNewPassword;
}
/**
* Returns the old password value.<p>
*
* @return the old password value
*/
public String getParamOldPassword() {
return m_paramOldPassword;
}
/**
* Returns the "copy file default" setting.<p>
*
* @return the "copy file default" setting
*/
public String getParamTabDiCopyFileMode() {
return "" + m_userSettings.getDialogCopyFileMode();
}
/**
* Returns the "copy folder default" setting.<p>
*
* @return the "copy folder default" setting
*/
public String getParamTabDiCopyFolderMode() {
return "" + m_userSettings.getDialogCopyFolderMode();
}
/**
* Returns the "delete file default" setting.<p>
*
* @return the "delete file default" setting
*/
public String getParamTabDiDeleteFileMode() {
return "" + m_userSettings.getDialogDeleteFileMode();
}
/**
* Returns the "expand inherited permissions" default setting.<p>
*
* @return the "expand inherited permissions" default setting
*/
public String getParamTabDiPermissionsExpandInherited() {
return isParamEnabled(m_userSettings.getDialogExpandInheritedPermissions());
}
/**
* Returns the "expand current users permissions" default setting.<p>
*
* @return the "expand current users permissions" default setting
*/
public String getParamTabDiPermissionsExpandUser() {
return isParamEnabled(m_userSettings.getDialogExpandUserPermissions());
}
/**
* Returns the "inherit permissions on folders" default setting.<p>
*
* @return the "inherit permissions on folders" default setting
*/
public String getParamTabDiPermissionsInheritOnFolder() {
return isParamEnabled(m_userSettings.getDialogPermissionsInheritOnFolder());
}
/**
* Returns the "publish file siblings default" setting.<p>
*
* @return the "publish file siblings default" setting
*/
public String getParamTabDiPublishFileMode() {
return "" + m_userSettings.getDialogPublishSiblings();
}
/**
* Returns the "display lock dialog" setting.<p>
*
* @return <code>"true"</code> if the "display lock dialog" input field is checked, otherwise ""
*/
public String getParamTabDiShowLock() {
return isParamEnabled(m_userSettings.getDialogShowLock());
}
/**
* Returns the "editor button style" setting.<p>
*
* @return the "editor button style" setting
*/
public String getParamTabEdButtonStyle() {
return "" + m_userSettings.getEditorButtonStyle();
}
/**
* Returns the "direct edit button style" setting.<p>
*
* @return the "direct edit button style" setting
*/
public String getParamTabEdDirectEditButtonStyle() {
return "" + m_userSettings.getDirectEditButtonStyle();
}
/**
* Returns the "explorer button style" setting.<p>
*
* @return the "explorer button style" setting
*/
public String getParamTabExButtonStyle() {
return "" + m_userSettings.getExplorerButtonStyle();
}
/**
* Returns the "display file creation date" setting.<p>
*
* @return <code>"true"</code> if the file creation date input field is checked, otherwise ""
*/
public String getParamTabExFileDateCreated() {
return isParamEnabled(m_userSettings.showExplorerFileDateCreated());
}
/**
* Returns the "display file date expired" setting.<p>
*
* @return <code>"true"</code> if the file date expired input field is checked, otherwise ""
*/
public String getParamTabExFileDateExpired() {
return isParamEnabled(m_userSettings.showExplorerFileDateExpired());
}
/**
* Returns the "display file last modification date" setting.<p>
*
* @return <code>"true"</code> if the file last modification date input field is checked, otherwise ""
*/
public String getParamTabExFileDateLastModified() {
return isParamEnabled(m_userSettings.showExplorerFileDateLastModified());
}
/**
* Returns the "display file date released" setting.<p>
*
* @return <code>"true"</code> if the file date released input field is checked, otherwise ""
*/
public String getParamTabExFileDateReleased() {
return isParamEnabled(m_userSettings.showExplorerFileDateReleased());
}
/**
* Returns the "explorer number of entries per page" setting.<p>
*
* @return the "explorer number of entries per page" setting
*/
public String getParamTabExFileEntries() {
return "" + m_userSettings.getExplorerFileEntries();
}
/**
* Returns the "display file locked by" setting.<p>
*
* @return <code>"true"</code> if the file locked by input field is checked, otherwise ""
*/
public String getParamTabExFileLockedBy() {
return isParamEnabled(m_userSettings.showExplorerFileLockedBy());
}
/**
* Returns the "display file permissions" setting.<p>
*
* @return <code>"true"</code> if the file permissions input field is checked, otherwise ""
*/
public String getParamTabExFilePermissions() {
return isParamEnabled(m_userSettings.showExplorerFilePermissions());
}
/**
* Returns the "display file size" setting.<p>
*
* @return <code>"true"</code> if the file size input field is checked, otherwise ""
*/
public String getParamTabExFileSize() {
return isParamEnabled(m_userSettings.showExplorerFileSize());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -