From b8124f18f88fe11158eb122a1e362cfbd512cf4f Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 27 May 2008 08:14:24 +0000 Subject: [PATCH] * Separated the MVC-Webframework from core * Separated i18n from core to prepare translations --- contrib/package/luci/Makefile | 23 +++++++++++++++---- core/src/i18n/default.en | 14 ----------- i18n/english/Makefile | 2 ++ {core => i18n/english}/src/i18n/cbi.en | 0 web/Makefile | 2 ++ {core => web}/root/etc/config/luci | 0 {core => web}/root/www/resources/cbi.js | 0 {core => web}/src/cbi.lua | 0 {core => web}/src/config.lua | 0 {core => web}/src/dispatcher.lua | 5 +++- {core => web}/src/http.lua | 0 {core => web}/src/i18n.lua | 0 {core => web}/src/template.lua | 0 {core => web}/src/view/cbi/dvalue.htm | 0 {core => web}/src/view/cbi/footer.htm | 0 .../src/view/cbi/full_valuefooter.htm | 0 .../src/view/cbi/full_valueheader.htm | 0 {core => web}/src/view/cbi/fvalue.htm | 0 {core => web}/src/view/cbi/header.htm | 0 {core => web}/src/view/cbi/lvalue.htm | 0 {core => web}/src/view/cbi/map.htm | 0 {core => web}/src/view/cbi/mvalue.htm | 0 {core => web}/src/view/cbi/nsection.htm | 0 {core => web}/src/view/cbi/tblsection.htm | 0 .../src/view/cbi/tiny_valuefooter.htm | 0 .../src/view/cbi/tiny_valueheader.htm | 0 {core => web}/src/view/cbi/tsection.htm | 0 {core => web}/src/view/cbi/ucisection.htm | 0 {core => web}/src/view/cbi/value.htm | 0 {core => web}/src/view/cbi/valuefooter.htm | 0 {core => web}/src/view/cbi/valueheader.htm | 0 {core => web}/src/view/error404.htm | 0 {core => web}/src/view/error500.htm | 0 {core => web}/src/view/footer.htm | 0 {core => web}/src/view/header.htm | 0 35 files changed, 26 insertions(+), 20 deletions(-) delete mode 100644 core/src/i18n/default.en create mode 100644 i18n/english/Makefile rename {core => i18n/english}/src/i18n/cbi.en (100%) create mode 100644 web/Makefile rename {core => web}/root/etc/config/luci (100%) rename {core => web}/root/www/resources/cbi.js (100%) rename {core => web}/src/cbi.lua (100%) rename {core => web}/src/config.lua (100%) rename {core => web}/src/dispatcher.lua (98%) rename {core => web}/src/http.lua (100%) rename {core => web}/src/i18n.lua (100%) rename {core => web}/src/template.lua (100%) rename {core => web}/src/view/cbi/dvalue.htm (100%) rename {core => web}/src/view/cbi/footer.htm (100%) rename {core => web}/src/view/cbi/full_valuefooter.htm (100%) rename {core => web}/src/view/cbi/full_valueheader.htm (100%) rename {core => web}/src/view/cbi/fvalue.htm (100%) rename {core => web}/src/view/cbi/header.htm (100%) rename {core => web}/src/view/cbi/lvalue.htm (100%) rename {core => web}/src/view/cbi/map.htm (100%) rename {core => web}/src/view/cbi/mvalue.htm (100%) rename {core => web}/src/view/cbi/nsection.htm (100%) rename {core => web}/src/view/cbi/tblsection.htm (100%) rename {core => web}/src/view/cbi/tiny_valuefooter.htm (100%) rename {core => web}/src/view/cbi/tiny_valueheader.htm (100%) rename {core => web}/src/view/cbi/tsection.htm (100%) rename {core => web}/src/view/cbi/ucisection.htm (100%) rename {core => web}/src/view/cbi/value.htm (100%) rename {core => web}/src/view/cbi/valuefooter.htm (100%) rename {core => web}/src/view/cbi/valueheader.htm (100%) rename {core => web}/src/view/error404.htm (100%) rename {core => web}/src/view/error500.htm (100%) rename {core => web}/src/view/footer.htm (100%) rename {core => web}/src/view/header.htm (100%) diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index 2458ebd28..c75247b55 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -46,19 +46,32 @@ endef define Package/luci $(call Package/luci/template) MENU:=1 - DEPENDS:=+lua +luaposix +luci-addons + DEPENDS:=+lua +luaposix endef -define Package/luci/conffiles +define Package/luci/install + $(call Package/luci/install/template,$(1),core) +endef + + +### Web Packages ### +define Package/luci-web + $(call Package/luci/template) + DEPENDS:=luci +luci-addons + TITLE:=LuCI - Webframework +endef + +define Package/luci-web/conffiles /etc/config/luci endef -define Package/luci/install - $(call Package/luci/install/template,$(1),core) +define Package/luci-web/install + $(call Package/luci/install/template,$(1),web) $(call Package/luci/install/template,$(1),themes/fledermaus) endef + ### Community Packages ### define Package/luci-ff-halle @@ -111,7 +124,7 @@ endef define Package/luci-mod-admin-core $(call Package/luci/template) - DEPENDS:=luci + DEPENDS:=luci +luci-web TITLE:=Core administrative pages endef diff --git a/core/src/i18n/default.en b/core/src/i18n/default.en deleted file mode 100644 index d76b770e9..000000000 --- a/core/src/i18n/default.en +++ /dev/null @@ -1,14 +0,0 @@ -add = "Add" -save = "Save" -reset = "Reset" - -load = "Load" -webif = "Webinterface" -public = "Public" -admin = "Administration" -apply = "Apply" -changes = "Changes" -revert = "Revert" - -config = "Configuration" -path = "Path" \ No newline at end of file diff --git a/i18n/english/Makefile b/i18n/english/Makefile new file mode 100644 index 000000000..81a96f6a8 --- /dev/null +++ b/i18n/english/Makefile @@ -0,0 +1,2 @@ +include ../../build/config.mk +include ../../build/module.mk \ No newline at end of file diff --git a/core/src/i18n/cbi.en b/i18n/english/src/i18n/cbi.en similarity index 100% rename from core/src/i18n/cbi.en rename to i18n/english/src/i18n/cbi.en diff --git a/web/Makefile b/web/Makefile new file mode 100644 index 000000000..5e64bcd1f --- /dev/null +++ b/web/Makefile @@ -0,0 +1,2 @@ +include ../build/config.mk +include ../build/module.mk \ No newline at end of file diff --git a/core/root/etc/config/luci b/web/root/etc/config/luci similarity index 100% rename from core/root/etc/config/luci rename to web/root/etc/config/luci diff --git a/core/root/www/resources/cbi.js b/web/root/www/resources/cbi.js similarity index 100% rename from core/root/www/resources/cbi.js rename to web/root/www/resources/cbi.js diff --git a/core/src/cbi.lua b/web/src/cbi.lua similarity index 100% rename from core/src/cbi.lua rename to web/src/cbi.lua diff --git a/core/src/config.lua b/web/src/config.lua similarity index 100% rename from core/src/config.lua rename to web/src/config.lua diff --git a/core/src/dispatcher.lua b/web/src/dispatcher.lua similarity index 98% rename from core/src/dispatcher.lua rename to web/src/dispatcher.lua index 103260c48..175f0dcb0 100644 --- a/core/src/dispatcher.lua +++ b/web/src/dispatcher.lua @@ -127,7 +127,10 @@ function dispatch() tpl.viewns.uploadctrl = luci.http.dispatcher_upload() tpl.viewns.media = luci.config.main.mediaurlbase tpl.viewns.resource = luci.config.main.resourcebase - + + -- Load default translation + require("luci.i18n").loadc("default") + if c and type(c.target) == "function" then dispatched = c diff --git a/core/src/http.lua b/web/src/http.lua similarity index 100% rename from core/src/http.lua rename to web/src/http.lua diff --git a/core/src/i18n.lua b/web/src/i18n.lua similarity index 100% rename from core/src/i18n.lua rename to web/src/i18n.lua diff --git a/core/src/template.lua b/web/src/template.lua similarity index 100% rename from core/src/template.lua rename to web/src/template.lua diff --git a/core/src/view/cbi/dvalue.htm b/web/src/view/cbi/dvalue.htm similarity index 100% rename from core/src/view/cbi/dvalue.htm rename to web/src/view/cbi/dvalue.htm diff --git a/core/src/view/cbi/footer.htm b/web/src/view/cbi/footer.htm similarity index 100% rename from core/src/view/cbi/footer.htm rename to web/src/view/cbi/footer.htm diff --git a/core/src/view/cbi/full_valuefooter.htm b/web/src/view/cbi/full_valuefooter.htm similarity index 100% rename from core/src/view/cbi/full_valuefooter.htm rename to web/src/view/cbi/full_valuefooter.htm diff --git a/core/src/view/cbi/full_valueheader.htm b/web/src/view/cbi/full_valueheader.htm similarity index 100% rename from core/src/view/cbi/full_valueheader.htm rename to web/src/view/cbi/full_valueheader.htm diff --git a/core/src/view/cbi/fvalue.htm b/web/src/view/cbi/fvalue.htm similarity index 100% rename from core/src/view/cbi/fvalue.htm rename to web/src/view/cbi/fvalue.htm diff --git a/core/src/view/cbi/header.htm b/web/src/view/cbi/header.htm similarity index 100% rename from core/src/view/cbi/header.htm rename to web/src/view/cbi/header.htm diff --git a/core/src/view/cbi/lvalue.htm b/web/src/view/cbi/lvalue.htm similarity index 100% rename from core/src/view/cbi/lvalue.htm rename to web/src/view/cbi/lvalue.htm diff --git a/core/src/view/cbi/map.htm b/web/src/view/cbi/map.htm similarity index 100% rename from core/src/view/cbi/map.htm rename to web/src/view/cbi/map.htm diff --git a/core/src/view/cbi/mvalue.htm b/web/src/view/cbi/mvalue.htm similarity index 100% rename from core/src/view/cbi/mvalue.htm rename to web/src/view/cbi/mvalue.htm diff --git a/core/src/view/cbi/nsection.htm b/web/src/view/cbi/nsection.htm similarity index 100% rename from core/src/view/cbi/nsection.htm rename to web/src/view/cbi/nsection.htm diff --git a/core/src/view/cbi/tblsection.htm b/web/src/view/cbi/tblsection.htm similarity index 100% rename from core/src/view/cbi/tblsection.htm rename to web/src/view/cbi/tblsection.htm diff --git a/core/src/view/cbi/tiny_valuefooter.htm b/web/src/view/cbi/tiny_valuefooter.htm similarity index 100% rename from core/src/view/cbi/tiny_valuefooter.htm rename to web/src/view/cbi/tiny_valuefooter.htm diff --git a/core/src/view/cbi/tiny_valueheader.htm b/web/src/view/cbi/tiny_valueheader.htm similarity index 100% rename from core/src/view/cbi/tiny_valueheader.htm rename to web/src/view/cbi/tiny_valueheader.htm diff --git a/core/src/view/cbi/tsection.htm b/web/src/view/cbi/tsection.htm similarity index 100% rename from core/src/view/cbi/tsection.htm rename to web/src/view/cbi/tsection.htm diff --git a/core/src/view/cbi/ucisection.htm b/web/src/view/cbi/ucisection.htm similarity index 100% rename from core/src/view/cbi/ucisection.htm rename to web/src/view/cbi/ucisection.htm diff --git a/core/src/view/cbi/value.htm b/web/src/view/cbi/value.htm similarity index 100% rename from core/src/view/cbi/value.htm rename to web/src/view/cbi/value.htm diff --git a/core/src/view/cbi/valuefooter.htm b/web/src/view/cbi/valuefooter.htm similarity index 100% rename from core/src/view/cbi/valuefooter.htm rename to web/src/view/cbi/valuefooter.htm diff --git a/core/src/view/cbi/valueheader.htm b/web/src/view/cbi/valueheader.htm similarity index 100% rename from core/src/view/cbi/valueheader.htm rename to web/src/view/cbi/valueheader.htm diff --git a/core/src/view/error404.htm b/web/src/view/error404.htm similarity index 100% rename from core/src/view/error404.htm rename to web/src/view/error404.htm diff --git a/core/src/view/error500.htm b/web/src/view/error500.htm similarity index 100% rename from core/src/view/error500.htm rename to web/src/view/error500.htm diff --git a/core/src/view/footer.htm b/web/src/view/footer.htm similarity index 100% rename from core/src/view/footer.htm rename to web/src/view/footer.htm diff --git a/core/src/view/header.htm b/web/src/view/header.htm similarity index 100% rename from core/src/view/header.htm rename to web/src/view/header.htm -- 2.25.1