docs: public static boolean templateTagAction(
          String element,
          String elementlist,
          boolean checkall,
          boolean checknone,
          ServletRequest req) {
  
          if (elementlist != null) {
  
              CmsFlexController controller = CmsFlexController.getController(req);
              String filename = controller.getCmsObject().getRequestContext().getUri();
  
              I_CmsXmlDocument content = null;
              try {
                  content = CmsXmlPageFactory.unmarshal(controller.getCmsObject(), filename, req);
              } catch (CmsException e) {
                  LOG.error(Messages.get().getBundle().key(Messages.ERR_XML_DOCUMENT_UNMARSHAL_1, filename), e);
              }
  
              if (content != null) {
                  String absolutePath = controller.getCmsObject().getSitePath(content.getFile());
                  // check the elements in the elementlist, if the check fails don't render the element
                  String[] elements = CmsStringUtil.splitAsArray(elementlist, ',');
                  boolean found = false;
                  for (int i = 0; i < elements.length; i++) {
                      String el = elements[i].trim();
                      List<Locale> locales = content.getLocales(el);
                      Locale locale = null;
                      if ((locales != null) && (locales.size() != 0)) {
                          locale = OpenCms.getLocaleManager().getBestMatchingLocale(
                              controller.getCmsObject().getRequestContext().getLocale(),
                              OpenCms.getLocaleManager().getDefaultLocales(controller.getCmsObject(), absolutePath),
                              locales);
                      }
                      if ((locale != null) && content.hasValue(el, locale) && content.isEnabled(el, locale)) {
  
                          found = true;
                          if (!checkall) {
                              // found at least an element that is available
                              break;
                          }
                      } else {
                          if (checkall) {
                              // found at least an element that is not available
                              return false;
                          }
                      }
                  }
  
                  if (!found && !checknone) {
                      // no element found while checking for existing elements
                      return false;
                  } else if (found && checknone) {
                      // element found while checking for nonexisting elements
                      return false;
                  }
              }
          }
  
          // otherwise, check if an element was defined and if its equal to the desired element
          String param = req.getParameter(I_CmsResourceLoader.PARAMETER_ELEMENT);
          return ((element == null) || (param == null) || (param.equals(element)));
      }