diff options
-rw-r--r-- | etherpad/src/etherpad/utils.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/etherpad/src/etherpad/utils.js b/etherpad/src/etherpad/utils.js index 1d139ed..091901d 100644 --- a/etherpad/src/etherpad/utils.js +++ b/etherpad/src/etherpad/utils.js @@ -70,11 +70,21 @@ function findExistsingFile(files) { function findTemplate(filename, plugin) { var files = []; - if (plugin != undefined) { - files.push('/plugins/' + plugin + '/templates/' + filename); - files.push('/themes/' + appjet.config.theme + '/plugins/' + plugin + '/templates/' + filename); - files.push('/themes/default/plugins/' + plugin + '/templates/' + filename); - } + var pluginList = [plugin]; + try { + if (plugin.forEach !== undefined) + pluginList = plugin; + else + pluginList = [plugin]; + } catch (e) {} + + pluginList.forEach(function (plugin) { + if (plugin != undefined) { + files.push('/plugins/' + plugin + '/templates/' + filename); + files.push('/themes/' + appjet.config.theme + '/plugins/' + plugin + '/templates/' + filename); + files.push('/themes/default/plugins/' + plugin + '/templates/' + filename); + } + }); files.push('/themes/' + appjet.config.theme + '/templates/' + filename); files.push('/themes/default/templates/' + filename); |