diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index bba3a3873..2b9f71a61 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -312,7 +312,8 @@ define([ if (_.isArray(arrBtns)) { _.each(arrBtns, function(b, index){ - newBtns[index] = {text: b.text, cls: 'custom' + ((b.primary) ? ' primary' : '')}; + if (b.visible) + newBtns[index] = {text: b.text, cls: 'custom' + ((b.primary) ? ' primary' : '')}; }); } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 98816920a..5441821e1 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -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 }); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 3012af9d0..6334dfbcd 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -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 }); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 9a6cb6b81..13d90aa02 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -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 });