aboutsummaryrefslogtreecommitdiffstats
path: root/etherpad/src/etherpad/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'etherpad/src/etherpad/utils.js')
-rw-r--r--etherpad/src/etherpad/utils.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/etherpad/src/etherpad/utils.js b/etherpad/src/etherpad/utils.js
index 1d139ed..65ebe1f 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);
@@ -110,7 +120,8 @@ function renderTemplateAsString(filename, data, plugin) {
data = data || {};
data.helpers = helpers; // global helpers
data.plugins = plugins; // Access callHook and the like...
- var template = new Template(data, plugin);
+ if (data.template == undefined)
+ new Template(data, plugin);
var f = findTemplate(filename, plugin); //"/templates/"+filename;
if (! appjet.scopeCache.ejs) {