code: public static String getSiteSelectOptionsStatic(CmsObject cms, Locale locale) {
  
          List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(
              cms,
              true,
              false,
              cms.getRequestContext().getOuFqn());
  
          StringBuffer resultBuffer = new StringBuffer();
          Iterator<CmsSite> i = sites.iterator();
          int counter = 0;
          while (i.hasNext()) {
              CmsSite site = i.next();
              String siteRoot = site.getSiteRoot();
              if (!siteRoot.endsWith("/")) {
                  siteRoot += "/";
              }
              if (counter != 0) {
                  resultBuffer.append("|");
              }
              resultBuffer.append(siteRoot).append(":").append(
                  CmsWorkplace.substituteSiteTitleStatic(site.getTitle(), locale));
              counter++;
          }
  
          if (sites.size() < 1) {
              // no site found, assure that at least the current site is shown in the selector
              String siteRoot = cms.getRequestContext().getSiteRoot();
              CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(siteRoot);
              if (!siteRoot.endsWith("/")) {
                  siteRoot += "/";
              }
              String title = "";
              if (site != null) {
                  title = site.getTitle();
              }
              resultBuffer.append(siteRoot).append(":").append(title);
          }
          return resultBuffer.toString();
      }
docs: Gets the options for the site selector.<p>
  
  @param cms the CMS context
  @param locale the locale for the select options
  
  @return the options for the site selector