Add admin panel
This commit is contained in:
@@ -1634,6 +1634,14 @@ define([
|
||||
content: h('span', Messages.settingsButton)
|
||||
});
|
||||
}
|
||||
// Add administration panel link if the user is an admin
|
||||
if (priv.edPublic && Array.isArray(Config.adminKeys) && Config.adminKeys.indexOf(priv.edPublic) !== -1) {
|
||||
options.push({
|
||||
tag: 'a',
|
||||
attributes: {'class': 'cp-toolbar-menu-admin fa fa-cogs'},
|
||||
content: h('span', Messages.adminPage || 'Admin')
|
||||
});
|
||||
}
|
||||
// Add login or logout button depending on the current status
|
||||
if (accountName) {
|
||||
options.push({
|
||||
@@ -1729,6 +1737,13 @@ define([
|
||||
window.parent.location = origin+'/settings/';
|
||||
}
|
||||
});
|
||||
$userAdmin.find('a.cp-toolbar-menu-admin').click(function () {
|
||||
if (padType) {
|
||||
window.open(origin+'/admin/');
|
||||
} else {
|
||||
window.parent.location = origin+'/admin/';
|
||||
}
|
||||
});
|
||||
$userAdmin.find('a.cp-toolbar-menu-profile').click(function () {
|
||||
if (padType) {
|
||||
window.open(origin+'/profile/');
|
||||
|
||||
Reference in New Issue
Block a user