Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.dotcms.publisher.business;

import com.dotcms.contenttype.model.type.ContentType;
import com.dotcms.publisher.util.PusheableAsset;
import com.dotmarketing.business.APILocator;
import com.dotmarketing.exception.DotDataException;
Expand Down Expand Up @@ -30,6 +31,7 @@ public class PublishQueueElementTransformer {
public static final String TITLE_KEY = "title";
public static final String INODE_KEY = "inode";
public static final String CONTENT_TYPE_NAME_KEY = "content_type_name";
public static final String CONTENT_TYPE_VARIABLE_KEY = "content_type_variable";
public static final String LANGUAGE_CODE_KEY = "language_code";
public static final String COUNTRY_CODE_KEY = "country_code";
public static final String OPERATION_KEY = "operation";
Expand Down Expand Up @@ -151,11 +153,16 @@ private static Map<String, Object> getMapForContentlet(final String id) {
contentlet = PublishAuditUtil.getInstance()
.findContentletByIdentifier(id);

final ContentType contentType = UtilMethods.isSet(contentlet) ? contentlet.getContentType() : null;
final String contentTypeName = contentType != null ? contentType.name() : StringPool.BLANK;
final String contentTypeVariable = contentType != null ? contentType.variable() : StringPool.BLANK;

return new HashMap<>(UtilMethods.isSet(contentlet) ?
Map.of(
TITLE_KEY, contentlet.getTitle(),
INODE_KEY, contentlet.getInode(),
CONTENT_TYPE_NAME_KEY, contentlet.getContentType().name(),
CONTENT_TYPE_NAME_KEY, contentTypeName,
CONTENT_TYPE_VARIABLE_KEY, contentTypeVariable,
HTML_PAGE_KEY, contentlet.isHTMLPage()
) : Map.of(TITLE_KEY, id, INODE_KEY, id));
} catch (DotSecurityException | DotDataException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@

<script type="text/javascript">

function openContentEditor(inode, contentType) {
var customEvent = document.createEvent("CustomEvent");
customEvent.initCustomEvent("ng-event", false, false, {
name: "edit-contentlet",
data: {
inode: inode,
contentType: contentType
}
});
document.dispatchEvent(customEvent);
}

dojo.require("dijit.Tooltip");

Expand Down Expand Up @@ -322,8 +333,10 @@

final Object structureObject = asset.get(PublishQueueElementTransformer.CONTENT_TYPE_NAME_KEY);
structureName = UtilMethods.isSet(structureObject) ? structureObject.toString() : StringPool.BLANK;
final Object contentTypeVariableObject = asset.get(PublishQueueElementTransformer.CONTENT_TYPE_VARIABLE_KEY);
final String contentTypeVariable = UtilMethods.isSet(contentTypeVariableObject) ? contentTypeVariableObject.toString() : StringPool.BLANK;
%>
<a href="/c/portal/layout?p_l_id=<%=layoutId %>&p_p_id=<%=PortletID.CONTENT%>&p_p_action=1&p_p_state=maximized&p_p_mode=view&_<%=PortletID.CONTENT%>_struts_action=/ext/contentlet/edit_contentlet&_<%=PortletID.CONTENT%>_cmd=edit&inode=<%=inode %>&referer=<%=referer %>">
<a href="javascript:void(0)" onclick="openContentEditor('<%=inode%>', '<%=contentTypeVariable%>')">
<%=StringEscapeUtils.escapeHtml(title)%>
</a>
<% } else {
Expand Down
Loading