Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/1.2' into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Jun 4, 2024
2 parents 0af211b + 19d6051 commit c59c08c
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions public/js/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ pimcore.bundle.web2print.startup = Class.create({
var menu = e.detail.menu;
var tree = e.detail.tree;
var me = this;
const perspectiveCfg = tree.perspectiveCfg;

const addPrintDocuments = perspectiveCfg.inTreeContextMenu("document.addPrintPage");
const addBlankPrintDocuments = perspectiveCfg.inTreeContextMenu("document.addBlankPrintPage");

if (tree.tree.getSelectionModel().getSelected().length > 1) {
return;
Expand All @@ -56,19 +60,21 @@ pimcore.bundle.web2print.startup = Class.create({
if (childSupportedDocument && document.data.permissions.create) {
documentMenu = this.populatePredefinedDocumentTypes(documentMenu, tree, document);

// empty print pages
documentMenu.printPage.push({
text: "> " + t("add_printpage"),
iconCls: "pimcore_icon_printpage pimcore_icon_overlay_add",
handler: me.addDocument.bind(tree, tree, document, "printpage")
});
documentMenu.printPage.push({
text: "> " + t("add_printcontainer"),
iconCls: "pimcore_icon_printcontainer pimcore_icon_overlay_add",
handler: me.addDocument.bind(tree, tree, document, "printcontainer")
});
if (addBlankPrintDocuments) {
// empty print pages
documentMenu.printPage.push({
text: "> " + t("add_printpage"),
iconCls: "pimcore_icon_printpage pimcore_icon_overlay_add",
handler: me.addDocument.bind(tree, tree, document, "printpage")
});
documentMenu.printPage.push({
text: "> " + t("add_printcontainer"),
iconCls: "pimcore_icon_printcontainer pimcore_icon_overlay_add",
handler: me.addDocument.bind(tree, tree, document, "printcontainer")
});
}

if (document.data.type != "email" && document.data.type != "newsletter" && document.data.type != "link") {
if (addPrintDocuments && document.data.type != "email" && document.data.type != "newsletter" && document.data.type != "link") {
menu.insert(0, new Ext.menu.Item({
text: t('add_printpage'),
iconCls: "pimcore_icon_printpage pimcore_icon_overlay_add",
Expand Down

0 comments on commit c59c08c

Please sign in to comment.