diff options
Diffstat (limited to 'app/acf-util')
-rw-r--r-- | app/acf-util/password-status-html.lsp | 2 | ||||
-rw-r--r-- | app/acf-util/roles-viewroles-html.lsp | 4 | ||||
-rw-r--r-- | app/acf-util/skins-model.lua | 21 |
3 files changed, 14 insertions, 13 deletions
diff --git a/app/acf-util/password-status-html.lsp b/app/acf-util/password-status-html.lsp index 4a34fab..a26bdee 100644 --- a/app/acf-util/password-status-html.lsp +++ b/app/acf-util/password-status-html.lsp @@ -12,7 +12,7 @@ <H2>Existing account</H2> <DL> <% for name,user in pairs(form.value) do %> - <DT><IMG SRC='/skins/static/tango/16x16/apps/system-users.png' HEIGHT='16' WIDTH='16'> <%= html.html_escape(name) %></DT> + <DT><IMG SRC='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/apps/system-users.png' HEIGHT='16' WIDTH='16'> <%= html.html_escape(name) %></DT> <DD><TABLE> <TR> <TD STYLE='border:none;'><B><%= html.html_escape(user.value.userid.label) %></B></TD> diff --git a/app/acf-util/roles-viewroles-html.lsp b/app/acf-util/roles-viewroles-html.lsp index b2c5aa7..c7d6fc5 100644 --- a/app/acf-util/roles-viewroles-html.lsp +++ b/app/acf-util/roles-viewroles-html.lsp @@ -15,7 +15,7 @@ <TABLE> <% if view.value.defined_roles then %> <% for x,role in pairs(view.value.defined_roles.value) do %> - <TR><TD><dt><img src='/skins/static/tango/16x16/apps/system-users.png' height='16' width='16'> <%= html.html_escape(role) %></dt> + <TR><TD><dt><img src='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/apps/system-users.png' height='16' width='16'> <%= html.html_escape(role) %></dt> <dd> [<a href='viewroleperms?role=<%= html.html_escape(role) %>'>View this role</a>] [<a href='editrole?role=<%= html.html_escape(role) %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this role</a>] @@ -25,7 +25,7 @@ <% end %> <% if view.value.default_roles then %> <% for x,role in pairs(view.value.default_roles.value) do %> - <TR><TD><dt><img src='/skins/static/tango/16x16/categories/applications-system.png' height='16' width='16'> <%= html.html_escape(role) %></dt> + <TR><TD><dt><img src='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/categories/applications-system.png' height='16' width='16'> <%= html.html_escape(role) %></dt> <dd> [<a href='viewroleperms?role=<%= html.html_escape(role) %>'>View this role</a>] [<a href='editrole?role=<%= html.html_escape(role) %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this role</a>] diff --git a/app/acf-util/skins-model.lua b/app/acf-util/skins-model.lua index 8b5a57e..860a943 100644 --- a/app/acf-util/skins-model.lua +++ b/app/acf-util/skins-model.lua @@ -1,4 +1,3 @@ --- acf model for displaying logfiles recusivly module (..., package.seeall) require("fs") @@ -7,9 +6,9 @@ require("format") local function set_skins(self, skin) local content = "\n"..(fs.read_file(self.conf.conffile) or "") local count - content,count = string.gsub(content, "\n%s*skin%s*=[^\n]*", "\nskin="..format.escapespecialcharacters(skin)) + content,count = string.gsub(content, "\n%s*skin%s*=[^\n]*", "\nskin="..skin) if count == 0 then - content = "\nskin="..format.escapespecialcharacters(skin)..content + content = "\nskin="..skin..content end fs.write_file(self.conf.conffile, string.sub(content,2)) local cmdoutput = "New skin selected" @@ -18,13 +17,15 @@ end local function list_skins(self) local skinarray = {} - for i,file in ipairs(posix.dir(self.conf.wwwdir ..self.conf.skindir) or {}) do - -- Ignore files that begins with a '.' and 'cgi-bin' and only list folders - if not ((string.match(file, "^%.")) or (string.match(file, "^cgi[-]bin")) or (string.match(file, "^static")) or (posix.stat(self.conf.wwwdir .. self.conf.skindir .. file).type ~= "directory")) then - local entry = cfe({ value=file, label="Skin name" }) - local current = conf.skin - entry.inuse = (file == current) - table.insert(skinarray, entry) + for skin in string.gmatch(self.conf.skindir, "[^,]+") do + for i,file in ipairs(posix.dir(self.conf.wwwdir ..skin) or {}) do + -- Ignore files that begins with a '.' and 'cgi-bin' and only list folders + if not ((string.match(file, "^%.")) or (string.match(file, "^cgi[-]bin")) or (string.match(file, "^static")) or (posix.stat(self.conf.wwwdir .. skin .. file).type ~= "directory")) then + local entry = cfe({ value=skin..file, label="Skin name" }) + local current = conf.skin + entry.inuse = (file == current) + table.insert(skinarray, entry) + end end end return cfe({ type="list", value=skinarray, label="Skins" }) |