diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-02-16 08:55:13 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-02-16 08:55:13 +0000 |
commit | 10cfd9d946f2bf5eaea11ea98bd00054431579de (patch) | |
tree | 553b251084f6bc3d574202451104e4e0369f51b1 | |
parent | 96177033b815d813e1c7034597f08f0876047580 (diff) | |
download | acf-core-10cfd9d946f2bf5eaea11ea98bd00054431579de.tar.bz2 acf-core-10cfd9d946f2bf5eaea11ea98bd00054431579de.tar.xz |
Added new view variable wwwprefix to adjust web path, fix index.html redirect.
-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_www-controller.lua | 3 | ||||
-rw-r--r-- | app/dispatcherror-html.lsp | 4 | ||||
-rw-r--r-- | app/exception-html.lsp | 4 | ||||
-rw-r--r-- | app/template-html.lsp | 8 | ||||
-rw-r--r-- | www/index.html | 2 |
7 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 a26bdee..1f9bb13 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='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/apps/system-users.png' HEIGHT='16' WIDTH='16'> <%= html.html_escape(name) %></DT> + <DT><IMG SRC='<%= html.html_escape(page_info.wwwprefix..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 c7d6fc5..5221fce 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='<%= html.html_escape(page_info.staticdir) %>/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.wwwprefix..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='<%= html.html_escape(page_info.staticdir) %>/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.wwwprefix..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_www-controller.lua b/app/acf_www-controller.lua index 0b6d80d..e99ffa5 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -220,7 +220,7 @@ local view_resolver = function(self) action = self.conf.action, prefix = self.conf.prefix, script = self.conf.script, - appname = self.conf.appname, + wwwprefix = self.conf.wwwprefix or "", staticdir = self.conf.staticdir or "", skin = self.conf.skin or "", orig_action = self.conf.orig_action or self.conf.prefix .. self.conf.controller .. "/" .. self.conf.action, @@ -389,6 +389,7 @@ dispatch = function (self, userprefix, userctlr, useraction) if userprefix == nil then self.conf.prefix, self.conf.controller, self.conf.action = parse_path_info(ENV["PATH_INFO"]) + self.conf.wwwprefix = string.gsub(ENV["SCRIPT_NAME"] or "", "/?cgi%-bin/acf.*", "") else self.conf.prefix = userprefix self.conf.controller = userctlr or "" diff --git a/app/dispatcherror-html.lsp b/app/dispatcherror-html.lsp index fde2f03..a72c148 100644 --- a/app/dispatcherror-html.lsp +++ b/app/dispatcherror-html.lsp @@ -1,4 +1,4 @@ -<% view = ... %> +<% view, viewlibrary, page_info = ... %> <style type="text/css"> p.hiddendetail { @@ -10,7 +10,7 @@ font-size: 75%; } </style> -<script type="text/javascript" src="/js/jquery-latest.js"></script> +<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script> <script type="text/javascript"> var clickIt = function(){ $("p.hiddendetail").removeClass("hiddendetail").show("slow"); diff --git a/app/exception-html.lsp b/app/exception-html.lsp index 03bfaf8..e9d3977 100644 --- a/app/exception-html.lsp +++ b/app/exception-html.lsp @@ -1,4 +1,4 @@ -<% view = ... %> +<% view, viewlibrary, page_info = ... %> <style type="text/css"> p.hiddendetail { @@ -10,7 +10,7 @@ font-size: 75%; } </style> -<script type="text/javascript" src="/js/jquery-latest.js"></script> +<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script> <script type="text/javascript"> var clickIt = function(){ $("p.hiddendetail").removeClass("hiddendetail").show("slow"); diff --git a/app/template-html.lsp b/app/template-html.lsp index 0490b0b..5d42907 100644 --- a/app/template-html.lsp +++ b/app/template-html.lsp @@ -23,10 +23,10 @@ if viewlibrary and viewlibrary.dispatch_component then end %> <title><%= html.html_escape(hostname .. " - " .. pageinfo.controller .. "->" .. pageinfo.action) %></title> -<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.staticdir) %>/reset.css"> -<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".css") %>"> +<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.staticdir) %>/reset.css"> +<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".css") %>"> <!--[if IE]> -<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.skin.."/"..posix.basename(pageinfo.skin).."-ie.css") %>"> +<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin).."-ie.css") %>"> <![endif]--> </head> <body> @@ -52,7 +52,7 @@ end io.write ( string.format("\t\t\t\t\t\t<a href=\"%s\">Log in</a>\n", html.html_escape(ctlr) .. "logon" ) ) end %> | - <a href="/">home</a> | + <a href="<%= html.html_escape(pageinfo.wwwprefix) %>/">home</a> | <a href="http://www.alpinelinux.org">about</a> </p></span> <div class="tailer"></div> diff --git a/www/index.html b/www/index.html index 8db9a9d..67b5bcd 100644 --- a/www/index.html +++ b/www/index.html @@ -5,7 +5,7 @@ <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> <meta http-equiv='Cache-Control' content='no-cache' /> <Meta http-equiv='Pragma' content='no-cache' /> -<meta http-equiv='refresh' content='0; url=/cgi-bin/acf'> +<meta http-equiv='refresh' content='0; url=cgi-bin/acf'> </head> <body> |