⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmspreferences.java

📁 找了很久才找到到源代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
        String[] vals = new String[] {I_CmsReport.REPORT_TYPE_SIMPLE, I_CmsReport.REPORT_TYPE_EXTENDED};
        List values = new ArrayList(java.util.Arrays.asList(vals));
        int selectedIndex = 0;
        if (I_CmsReport.REPORT_TYPE_EXTENDED.equals(getParamTabWpReportType())) {
            selectedIndex = 1;
        }
        return buildSelect(htmlAttributes, options, values, selectedIndex);
    }

    /**
     * Builds the html for the workplace start site select box.<p>
     * 
     * @param htmlAttributes optional html attributes for the &lgt;select&gt; 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 = OpenCms.getSiteManager().getAvailableSites(getCms(), true);
        String wpSite = getParamTabWpSite();
        if (!wpSite.endsWith("/")) {
            wpSite += "/";
        }

        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(wpSite)) {
                // 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&gt; 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 for the workplace search result list type select box.<p>
     * 
     * @param htmlAttributes optional html attributes for the &lgt;select&gt; tag
     * @return the html for the workplace search result list type select box
     */
    public String buildSelectWorkplaceSearchResult(String htmlAttributes) {

        List options = new ArrayList(3);
        List values = new ArrayList(3);
        int checkedIndex = 0;

        // add all styles to the select box
        options.add(key(CmsSearchResultStyle.STYLE_EXPLORER.getKey()));
        values.add(CmsSearchResultStyle.STYLE_EXPLORER.getMode());
        if (getParamTabExWorkplaceSearchResult().equals(CmsSearchResultStyle.STYLE_EXPLORER.toString())) {
            // mark the currently active locale
            checkedIndex = 0;
        }
        options.add(key(CmsSearchResultStyle.STYLE_LIST_WITH_EXCERPTS.getKey()));
        values.add(CmsSearchResultStyle.STYLE_LIST_WITH_EXCERPTS.getMode());
        if (getParamTabExWorkplaceSearchResult().equals(CmsSearchResultStyle.STYLE_LIST_WITH_EXCERPTS.toString())) {
            // mark the currently active locale
            checkedIndex = 1;
        }
        options.add(key(CmsSearchResultStyle.STYLE_LIST_WITHOUT_EXCERPTS.getKey()));
        values.add(CmsSearchResultStyle.STYLE_LIST_WITHOUT_EXCERPTS.getMode());
        if (getParamTabExWorkplaceSearchResult().equals(CmsSearchResultStyle.STYLE_LIST_WITHOUT_EXCERPTS.toString())) {
            // mark the currently active locale
            checkedIndex = 2;
        }

        return buildSelect(htmlAttributes, options, values, checkedIndex);
    }

    /**
     * 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(getLocale()));
        result.append("</td>\n");
        result.append("</tr>\n");
        result.append("</table>\n");

        return result.toString();
    }

    /**
     * Creates the HTML JavaScript and stylesheet includes required by the calendar for the head of the page.<p>
     * 
     * @return the necessary HTML code for the js and stylesheet includes
     * 
     * @deprecated use {@link CmsCalendarWidget#calendarIncludes(java.util.Locale)}, this is just here so that old JSP still work
     */
    public String calendarIncludes() {

        return CmsCalendarWidget.calendarIncludes(getLocale());
    }

    /**
     * Generates the HTML to initialize the JavaScript calendar element on the end of a page.<p>
     * 
     * @param inputFieldId the ID of the input field where the date is pasted to
     * @param triggerButtonId the ID of the button which triggers the calendar
     * @param align initial position of the calendar popup element
     * @param singleClick if true, a single click selects a date and closes the calendar, otherwise calendar is closed by doubleclick
     * @param weekNumbers show the week numbers in the calendar or not
     * @param mondayFirst show monday as first day of week
     * @param dateStatusFunc name of the function which determines if/how a date should be disabled
     * @param showTime true if the time selector should be shown, otherwise false
     * @return the HTML code to initialize a calendar poup element
     * 
     * @deprecated use {@link CmsCalendarWidget#calendarInit(org.opencms.i18n.CmsMessages, String, String, String, boolean, boolean, boolean, String, boolean)}, this is just here so that old JSP still work
     */
    public String calendarInit(
        String inputFieldId,
        String triggerButtonId,
        String align,
        boolean singleClick,
        boolean weekNumbers,
        boolean mondayFirst,
        String dateStatusFunc,
        boolean showTime) {

        return CmsCalendarWidget.calendarInit(
            getMessages(),
            inputFieldId,
            triggerButtonId,
            align,
            singleClick,
            weekNumbers,
            mondayFirst,
            dateStatusFunc,
            showTime);
    }

    /**
     * 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());
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -