Skip to content

Commit

Permalink
Added 'adeDetailId' parameter to pass detail content ids to context m…
Browse files Browse the repository at this point in the history
…enu actions from the page editor.
  • Loading branch information
gWestenberger committed Dec 5, 2023
1 parent c0ddf2e commit f7d5b9d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@
import org.opencms.gwt.client.ui.CmsErrorDialog;
import org.opencms.gwt.client.ui.CmsNotification;
import org.opencms.gwt.client.ui.CmsNotification.Type;
import org.opencms.gwt.client.ui.contextmenu.CmsEmbeddedAction;
import org.opencms.gwt.client.util.CmsDebugLog;
import org.opencms.gwt.client.util.CmsDomUtil;
import org.opencms.gwt.client.util.I_CmsSimpleCallback;
import org.opencms.gwt.shared.CmsContextMenuEntryBean;
import org.opencms.gwt.shared.CmsCoreData.AdeContext;
import org.opencms.gwt.shared.CmsGalleryContainerInfo;
import org.opencms.gwt.shared.CmsGwtConstants;
import org.opencms.gwt.shared.CmsGwtLog;
import org.opencms.gwt.shared.CmsListInfoBean;
import org.opencms.gwt.shared.CmsTemplateContextInfo;
import org.opencms.gwt.shared.I_CmsAutoBeanFactory;
Expand Down Expand Up @@ -2096,6 +2098,10 @@ public void init(
CmsContentEditorHandler contentEditorHandler,
CmsContainerpageUtil containerpageUtil) {

if (getData().getDetailId() != null) {
CmsEmbeddedAction.PARAMS.put(CmsGwtConstants.PARAM_ADE_DETAIL_ID, "" + getData().getDetailId());
}

Window.addResizeHandler(new ResizeHandler() {

public void onResize(ResizeEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import org.opencms.util.CmsUUID;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
* Context menu command to call workplace actions.<p>
Expand All @@ -41,6 +43,9 @@
*/
public class CmsEmbeddedAction implements I_CmsHasContextMenuCommand, I_CmsContextMenuCommand {

/** Parameters to send to server, filled in by other code. */
public static final Map<String, String> PARAMS = new HashMap<>();

/**
* Hidden utility class constructor.<p>
*/
Expand Down Expand Up @@ -70,7 +75,8 @@ public void execute(
dialogHandler.openDialog(
dialogId,
handler.getContextType(),
structureId != null ? Collections.singletonList(structureId) : Collections.<CmsUUID> emptyList());
structureId != null ? Collections.singletonList(structureId) : Collections.<CmsUUID> emptyList(),
PARAMS);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/org/opencms/gwt/shared/CmsGwtConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ public static final class RpcContext {
/** Name of the meta tag used to set the editor stylesheet. */
public static final String META_EDITOR_STYLESHEET = "cms-editor-stylesheet";

/** Parameter to pass detail id to page editor context menu actions. */
public static final String PARAM_ADE_DETAIL_ID = "adeDetailId";

/** Parameter for the button left position. */
public static final String PARAM_BUTTON_LEFT = "__buttonLeft";

Expand Down

0 comments on commit f7d5b9d

Please sign in to comment.