code: 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);
      }
docs: 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