From 1db9f295fa3e98a1f1472d2a8eda881333db5a43 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 5 Mar 2011 06:35:26 +0000 Subject: libs/web: repair and modernize FileBrowser widget, patches by Kevin Locke (#207) --- libs/web/luasrc/view/cbi/browser.htm | 5 +++-- libs/web/luasrc/view/cbi/filebrowser.htm | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'libs/web/luasrc/view') diff --git a/libs/web/luasrc/view/cbi/browser.htm b/libs/web/luasrc/view/cbi/browser.htm index 3b7b23f5d2..08df483b54 100644 --- a/libs/web/luasrc/view/cbi/browser.htm +++ b/libs/web/luasrc/view/cbi/browser.htm @@ -14,10 +14,11 @@ $Id$ -%> <% - local t = require("luci.tools.webadmin") local v = self:cfgvalue(section) -%> <%+cbi/valueheader%> /> - '<%=self.default_path and ", '"..self.default_path.."'"%>);return false" alt="<%:Search file...%>" title="<%:Search file...%>" src="<%=resource%>/cbi/folder.png" style="vertical-align:bottom" /> + <%+cbi/valuefooter%> diff --git a/libs/web/luasrc/view/cbi/filebrowser.htm b/libs/web/luasrc/view/cbi/filebrowser.htm index f82957221c..40480ec9d9 100644 --- a/libs/web/luasrc/view/cbi/filebrowser.htm +++ b/libs/web/luasrc/view/cbi/filebrowser.htm @@ -54,10 +54,10 @@ $Id$ require("luci.dispatcher") local field = luci.http.formvalue('field') - local request = luci.dispatcher.context.path + local request = luci.dispatcher.context.args local path = { '' } - for i = 3, #request do + for i = 1, #request do if request[i] ~= '..' and #request[i] > 0 then path[#path+1] = request[i] end @@ -103,7 +103,7 @@ $Id$ if stat and stat.type == 'dir' then -%>
  • - Directory + <%:Directory%> <%=e%>/
  • <% end end -%> @@ -113,7 +113,7 @@ $Id$ if stat and stat.type ~= 'dir' then -%>
  • - File + <%:File%> <%=e%>
  • <% end end -%> -- cgit v1.2.3