diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-10-11 19:38:47 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-10-11 19:38:47 +0000 |
commit | 14ff90b2855a78628a60187d733572234d9c4aac (patch) | |
tree | 801c5b80418993700351774c80487cae7cec9a85 /app | |
parent | 4694b7d7eefb3ae96e0d511742d8860fe3e94c5a (diff) | |
download | acf-core-14ff90b2855a78628a60187d733572234d9c4aac.tar.bz2 acf-core-14ff90b2855a78628a60187d733572234d9c4aac.tar.xz |
Added option to have skin-specific template in skindir
Diffstat (limited to 'app')
-rw-r--r-- | app/acf_www-controller.lua | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua index b455b4d..6a5f49c 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -177,11 +177,24 @@ view_resolver = function(self) pageinfo.viewfunc = viewfunc pageinfo.skinned = self.clientdata.skinned or "true" + if self.sessiondata.userinfo and self.sessiondata.userinfo.skin and self.sessiondata.userinfo.skin ~= "" then + pageinfo.skin = self.sessiondata.userinfo.skin + else + pageinfo.skin = self.conf.skin or "" + end + -- search for template local template if self.conf.component ~= true then - template = find_template ( self.conf.appdir, self.conf.prefix, - self.conf.controller, self.conf.action, self.conf.viewtype ) + -- First, check for skin-specific template + if pageinfo.skin ~= "" then + template = find_template ( self.conf.wwwdir..pageinfo.skin, "/", + self.conf.controller, self.conf.action, self.conf.viewtype ) + end + if not template then + template = find_template ( self.conf.appdir, self.conf.prefix, + self.conf.controller, self.conf.action, self.conf.viewtype ) + end end local func = viewfunc @@ -190,12 +203,6 @@ view_resolver = function(self) func = haserl.loadfile (template) end - if self.sessiondata.userinfo and self.sessiondata.userinfo.skin and self.sessiondata.userinfo.skin ~= "" then - pageinfo.skin = self.sessiondata.userinfo.skin - else - pageinfo.skin = self.conf.skin or "" - end - return func, viewlibrary, pageinfo, self.sessiondata end |