fix a bug that would make item keys available as text list columns even though they depend on a capability

This commit is contained in:
rolux 2012-04-19 09:34:40 +00:00
parent ab46a85a89
commit fbadfec8f6

View file

@ -54,22 +54,25 @@ pandora.ui.list = function() {
width: 16 width: 16
}], Ox.map(pandora.site.sortKeys, function(key) { }], Ox.map(pandora.site.sortKeys, function(key) {
var position = pandora.user.ui.listColumns.indexOf(key.id); var position = pandora.user.ui.listColumns.indexOf(key.id);
return { return !key.capability
align: ['string', 'text'].indexOf( || pandora.site.capabilities[key.capability][pandora.user.level]
Ox.isArray(key.type) ? key.type[0]: key.type ? {
) > -1 ? 'left' : key.type == 'list' ? 'center' : 'right', align: ['string', 'text'].indexOf(
defaultWidth: key.columnWidth, Ox.isArray(key.type) ? key.type[0]: key.type
format: key.format, ) > -1 ? 'left' : key.type == 'list' ? 'center' : 'right',
id: key.id, defaultWidth: key.columnWidth,
operator: pandora.getSortOperator(key.id), format: key.format,
position: position, id: key.id,
removable: !key.columnRequired, operator: pandora.getSortOperator(key.id),
title: key.title, position: position,
type: key.type, removable: !key.columnRequired,
unique: key.id == 'id', title: key.title,
visible: position > -1, type: key.type,
width: pandora.user.ui.listColumnWidth[key.id] || key.columnWidth unique: key.id == 'id',
}; visible: position > -1,
width: pandora.user.ui.listColumnWidth[key.id] || key.columnWidth
}
: null;
})), })),
columnsMovable: true, columnsMovable: true,
columnsRemovable: true, columnsRemovable: true,