-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from dachcom-digital/pimcore_10.5_ready
Pimcore 10.5 ready
- Loading branch information
Showing
5 changed files
with
31 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,27 @@ | ||
pimcore.registerNS('pimcore.plugin.Jobs'); | ||
|
||
pimcore.plugin.Jobs = Class.create(pimcore.plugin.admin, { | ||
|
||
getClassName: function () { | ||
return 'pimcore.plugin.Jobs'; | ||
}, | ||
|
||
initialize: function () { | ||
pimcore.plugin.broker.registerPlugin(this); | ||
|
||
if (!String.prototype.format) { | ||
String.prototype.format = function () { | ||
var args = arguments; | ||
return this.replace(/{(\d+)}/g, function (match, number) { | ||
return typeof args[number] != 'undefined' | ||
? args[number] | ||
: match | ||
; | ||
}); | ||
}; | ||
} | ||
}, | ||
|
||
uninstall: function () { | ||
// void | ||
}, | ||
|
||
pimcoreReady: function (params, broker) { | ||
|
||
var jobsMenu, user = pimcore.globalmanager.get('user'); | ||
|
||
if (!user.isAllowed('jobs_permission_settings')) { | ||
return false; | ||
} | ||
|
||
jobsMenu = new Ext.Action({ | ||
id: 'jobs_bundle_setting_button', | ||
text: t('jobs.settings.configuration'), | ||
iconCls: 'jobs_icon_bundle', | ||
handler: this.openSettingsPanel.bind(this) | ||
}); | ||
document.addEventListener(pimcore.events.pimcoreReady, (e) => { | ||
|
||
var user = pimcore.globalmanager.get('user'), | ||
openSettings = function (config) { | ||
try { | ||
pimcore.globalmanager.get('jobs_bundle_settings').activate(); | ||
} catch (e) { | ||
pimcore.globalmanager.add('jobs_bundle_settings', new Jobs.SettingsPanel(config)); | ||
} | ||
}; | ||
|
||
if (!user.isAllowed('jobs_permission_settings')) { | ||
return false; | ||
} | ||
|
||
if (layoutToolbar.settingsMenu) { | ||
layoutToolbar.settingsMenu.add(jobsMenu); | ||
} | ||
}, | ||
jobsMenu = new Ext.Action({ | ||
id: 'jobs_bundle_setting_button', | ||
text: t('jobs.settings.configuration'), | ||
iconCls: 'jobs_icon_bundle', | ||
handler: openSettings.bind(this) | ||
}); | ||
|
||
openSettingsPanel: function () { | ||
try { | ||
pimcore.globalmanager.get('jobs_bundle_settings').activate(); | ||
} catch (e) { | ||
pimcore.globalmanager.add('jobs_bundle_settings', new Jobs.SettingsPanel()); | ||
} | ||
if (layoutToolbar.settingsMenu) { | ||
layoutToolbar.settingsMenu.add(jobsMenu); | ||
} | ||
|
||
}); | ||
|
||
new pimcore.plugin.Jobs(); |