-
- // TODO factorise
- boolean isAdmin = cmsView.doAs(() -> CurrentUser.isInRole(NodeConstants.ROLE_USER_ADMIN));
- if (isAdmin && adminLayers != null)
- for (String layerId : adminLayers) {
- if (layers.containsKey(layerId)) {
- RankedObject<SuiteLayer> layerObj = layers.get(layerId);
-
- // TODO deal with i10n
- String titleStr = (String) layerObj.getProperties().get(SuiteLayer.Property.title.name());
- Localized title = null;
- if (titleStr != null)
- title = new Localized.Untranslated(titleStr);
-
- String iconName = (String) layerObj.getProperties().get(SuiteLayer.Property.icon.name());
- SuiteIcon icon = null;
- if (iconName != null)
- icon = SuiteIcon.valueOf(iconName);
-
- Button b = SuiteUiUtils.createLayerButton(parent, layerId, title, icon);
- if (first == null)
- first = b;
- }
- }
-
-// Button dashboardB = createButton(parent, SuiteMsg.dashboard.name(), SuiteMsg.dashboard, SuiteIcon.dashboard);
- if (!cmsView.isAnonymous()) {
-// createButton(parent, SuiteMsg.documents.name(), SuiteMsg.documents, SuiteIcon.documents);
-// createButton(parent, SuiteMsg.people.name(), SuiteMsg.people, SuiteIcon.people);
-// createButton(parent, SuiteMsg.locations.name(), SuiteMsg.locations, SuiteIcon.location);
- }