/** * Returns the remote ip address of the current user.<p> * * @return the remote ip address of the current user */ public String getLoginAddress() { return getCms().getRequestContext().getRemoteAddress(); }
/** * Returns the remote ip address of the current user.<p> * * @return the remote ip address of the current user */ public String getLoginAddress() { return getCms().getRequestContext().getRemoteAddress(); }
/** * Performs certain clear cache actions if the top frame is reloaded.<p> * * @param settings the current users workplace settings */ protected void topFrameReload(CmsWorkplaceSettings settings) { // ensure to read the settings from the database initUserSettings(getCms(), settings, true); // reset the HTML list in order to force a full reload settings.setListObject(null); } }
/** * Performs certain clear cache actions if the top frame is reloaded.<p> * * @param settings the current users workplace settings */ protected void topFrameReload(CmsWorkplaceSettings settings) { // ensure to read the settings from the database initUserSettings(getCms(), settings, true); // reset the HTML list in order to force a full reload settings.setListObject(null); } }
/** * Returns a html select box filled with the current users accessible sites.<p> * * @param htmlAttributes attributes that will be inserted into the generated html * @return a html select box filled with the current users accessible sites */ public String getSiteSelect(String htmlAttributes) { List options = new ArrayList(); List values = new ArrayList(); int selectedIndex = 0; List sites = OpenCms.getSiteManager().getAvailableSites(getCms(), true); Iterator i = sites.iterator(); int pos = 0; while (i.hasNext()) { CmsSite site = (CmsSite)i.next(); values.add(site.getSiteRoot()); options.add(site.getTitle()); if (site.getSiteRoot().equals(getSettings().getSite())) { // this is the user's current site selectedIndex = pos; } pos++; } return buildSelect(htmlAttributes, options, values, selectedIndex); }
/** * Indicates if the site selector should be shown in the top frame depending on the count of accessible sites.<p> * * @return true if site selector should be shown, otherwise false */ public boolean showSiteSelector() { if (getSettings().getUserSettings().getRestrictExplorerView()) { // restricted explorer view to site and folder, do not show site selector return false; } // count available sites int siteCount = OpenCms.getSiteManager().getAvailableSites(getCms(), true).size(); return (siteCount > 1); }
/** * Indicates if the site selector should be shown in the top frame depending on the count of accessible sites.<p> * * @return true if site selector should be shown, otherwise false */ public boolean showSiteSelector() { if (getSettings().getUserSettings().getRestrictExplorerView()) { // restricted explorer view to site and folder, do not show site selector return false; } // count available sites int siteCount = OpenCms.getSiteManager().getAvailableSites(getCms(), true).size(); return (siteCount > 1); }
/** * Returns a html select box filled with the current users accessible sites.<p> * * @param htmlAttributes attributes that will be inserted into the generated html * @return a html select box filled with the current users accessible sites */ public String getSiteSelect(String htmlAttributes) { List<String> options = new ArrayList<String>(); List<String> values = new ArrayList<String>(); int selectedIndex = 0; List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(getCms(), true); Iterator<CmsSite> i = sites.iterator(); int pos = 0; while (i.hasNext()) { CmsSite site = i.next(); values.add(site.getSiteRoot()); options.add(substituteSiteTitle(site.getTitle())); String siteRoot = CmsFileUtil.addTrailingSeparator(site.getSiteRoot()); String settingsSiteRoot = getSettings().getSite(); if (settingsSiteRoot != null) { settingsSiteRoot = CmsFileUtil.addTrailingSeparator(settingsSiteRoot); } if (siteRoot.equals(settingsSiteRoot)) { // this is the user's current site selectedIndex = pos; } pos++; } return buildSelect(htmlAttributes, options, values, selectedIndex); }
if (getCms().existsResource(view.getUri(), CmsResourceFilter.ONLY_VISIBLE_NO_DELETED)) { count++;
if (getCms().existsResource(view.getUri(), CmsResourceFilter.ONLY_VISIBLE_NO_DELETED)) { count++;
try { String ouFqn = ""; CmsUserSettings settings = new CmsUserSettings(getCms()); if (!settings.getListAllProjects()) { ouFqn = getCms().getRequestContext().getCurrentUser().getOuFqn(); getCms(), ouFqn, settings.getListAllProjects()); ou = OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getCms().getRequestContext().getOuFqn()); } catch (CmsException e) { + " - " + OpenCms.getOrgUnitManager().readOrganizationalUnit( getCms(), project.getOuFqn()).getDisplayName(getLocale()); } catch (CmsException e) {
try { String ouFqn = ""; CmsUserSettings settings = new CmsUserSettings(getCms()); if (!settings.getListAllProjects()) { ouFqn = getCms().getRequestContext().currentUser().getOuFqn(); getCms(), ouFqn, settings.getListAllProjects()); ou = OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getCms().getRequestContext().getOuFqn()); } catch (CmsException e) { projectName = projectName + " - " + OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), project.getOuFqn()).getDisplayName( getLocale()); } catch (CmsException e) {
/** * Returns the html for the "preferences" button depending on the current users permissions and * the default workplace settings.<p> * * @return the html for the "preferences" button */ public String getPreferencesButton() { int buttonStyle = getSettings().getUserSettings().getWorkplaceButtonStyle(); if (!getCms().getRequestContext().currentUser().isManaged()) { return button( "../commons/preferences.jsp", "body", "preferences.png", Messages.GUI_BUTTON_PREFERENCES_0, buttonStyle); } else { return button(null, null, "preferences_in.png", Messages.GUI_BUTTON_PREFERENCES_0, buttonStyle); } }
/** * Returns the html for the "preferences" button depending on the current users permissions and * the default workplace settings.<p> * * @return the html for the "preferences" button */ public String getPreferencesButton() { int buttonStyle = getSettings().getUserSettings().getWorkplaceButtonStyle(); if (!getCms().getRequestContext().getCurrentUser().isManaged()) { return button( "../commons/preferences.jsp", "body", "preferences.png", Messages.GUI_BUTTON_PREFERENCES_0, buttonStyle); } else { return button(null, null, "preferences_in.png", Messages.GUI_BUTTON_PREFERENCES_0, buttonStyle); } }