Skip to content

Instantly share code, notes, and snippets.

@brusch
Created October 5, 2016 10:51
Show Gist options
  • Save brusch/7530948ee5c1265bd7ee790778aa412c to your computer and use it in GitHub Desktop.
Save brusch/7530948ee5c1265bd7ee790778aa412c to your computer and use it in GitHub Desktop.
pimcore.registerNS("pimcore.plugin.test");
pimcore.plugin.test = Class.create(pimcore.plugin.admin, {
getClassName: function() {
return "pimcore.plugin.test";
},
initialize: function() {
pimcore.plugin.broker.registerPlugin(this);
},
pimcoreReady: function (params,broker){
// alert("Test Plugin Ready!");
},
postOpenDocument: function (document, type) {
if(document["type"] == "page" || document["type"] == "snippet") {
var leftToolbar = document.edit.getLayout().getDockedItems('toolbar[dock="left"]').first();
leftToolbar.add({
tooltip: t("Add Widget to Top"),
iconCls: "pimcore_icon_add",
handler: function (el) {
alert("test");
}
});
}
}
});
var testPlugin = new pimcore.plugin.test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment