Plugins: add translation for plugin buttons, add option for hiding buttons in the viewer
This commit is contained in:
parent
540da6573d
commit
3eb1c21ecd
|
@ -312,6 +312,7 @@ define([
|
|||
|
||||
if (_.isArray(arrBtns)) {
|
||||
_.each(arrBtns, function(b, index){
|
||||
if (b.visible)
|
||||
newBtns[index] = {text: b.text, cls: 'custom' + ((b.primary) ? ' primary' : '')};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2110,11 +2110,18 @@ define([
|
|||
if (typeof itemVar.descriptionLocale == 'object')
|
||||
description = itemVar.descriptionLocale[lang] || itemVar.descriptionLocale['en'] || description || '';
|
||||
|
||||
_.each(itemVar.buttons, function(b, index){
|
||||
if (typeof b.textLocale == 'object')
|
||||
b.text = b.textLocale[lang] || b.textLocale['en'] || b.text || '';
|
||||
b.visible = (isEdit || b.isViewer !== false);
|
||||
});
|
||||
|
||||
model.set({
|
||||
description: description,
|
||||
index: variationsArr.length,
|
||||
url: itemVar.url,
|
||||
icons: itemVar.icons,
|
||||
buttons: itemVar.buttons,
|
||||
visible: visible
|
||||
});
|
||||
|
||||
|
|
|
@ -1856,11 +1856,18 @@ define([
|
|||
if (typeof itemVar.descriptionLocale == 'object')
|
||||
description = itemVar.descriptionLocale[lang] || itemVar.descriptionLocale['en'] || description || '';
|
||||
|
||||
_.each(itemVar.buttons, function(b, index){
|
||||
if (typeof b.textLocale == 'object')
|
||||
b.text = b.textLocale[lang] || b.textLocale['en'] || b.text || '';
|
||||
b.visible = (isEdit || b.isViewer !== false);
|
||||
});
|
||||
|
||||
model.set({
|
||||
description: description,
|
||||
index: variationsArr.length,
|
||||
url: itemVar.url,
|
||||
icons: itemVar.icons,
|
||||
buttons: itemVar.buttons,
|
||||
visible: visible
|
||||
});
|
||||
|
||||
|
|
|
@ -2053,11 +2053,18 @@ define([
|
|||
if (typeof itemVar.descriptionLocale == 'object')
|
||||
description = itemVar.descriptionLocale[lang] || itemVar.descriptionLocale['en'] || description || '';
|
||||
|
||||
_.each(itemVar.buttons, function(b, index){
|
||||
if (typeof b.textLocale == 'object')
|
||||
b.text = b.textLocale[lang] || b.textLocale['en'] || b.text || '';
|
||||
b.visible = (isEdit || b.isViewer !== false);
|
||||
});
|
||||
|
||||
model.set({
|
||||
description: description,
|
||||
index: variationsArr.length,
|
||||
url: itemVar.url,
|
||||
icons: itemVar.icons,
|
||||
buttons: itemVar.buttons,
|
||||
visible: visible
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue