summaryrefslogtreecommitdiffstats
path: root/app/acf-util/skins-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-17 18:59:27 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-17 18:59:27 +0000
commitc0e0377e384c8167172ee06d8c11ef2f782522c7 (patch)
treebb89301e467ff61d93a39642354bcfe382571529 /app/acf-util/skins-model.lua
parentfcaab1b363fcd5ff2dccce8f98cacabc5635ba5f (diff)
downloadacf-core-c0e0377e384c8167172ee06d8c11ef2f782522c7.tar.bz2
acf-core-c0e0377e384c8167172ee06d8c11ef2f782522c7.tar.xz
Remove all calls to 'module' in preparation for move to Lua 5.2
Use mymodule parameter for module definition. This was also helpfule in revealing places where the code relied on the global environment.
Diffstat (limited to 'app/acf-util/skins-model.lua')
-rw-r--r--app/acf-util/skins-model.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/acf-util/skins-model.lua b/app/acf-util/skins-model.lua
index e646af9..9016e62 100644
--- a/app/acf-util/skins-model.lua
+++ b/app/acf-util/skins-model.lua
@@ -1,4 +1,4 @@
-module (..., package.seeall)
+local mymodule = {}
modelfunctions = require("modelfunctions")
fs = require("acf.fs")
@@ -31,11 +31,11 @@ local function list_skins(self)
end
-get = function (self)
+mymodule.get = function (self)
return cfe({ type="list", value=list_skins(self), label="Skins" })
end
-get_update = function (self)
+mymodule.get_update = function (self)
local skin = cfe({ type="select", value="", label="Skin", option=list_skins(self) })
if self and self.conf and self.conf.skin then
skin.value = self.conf.skin
@@ -43,7 +43,7 @@ get_update = function (self)
return cfe({ type="group", value={skin=skin}, label="Update Skin" })
end
-update = function (self, newskin)
+mymodule.update = function (self, newskin)
local success = modelfunctions.validateselect(newskin.value.skin)
if success then
set_skins(self, newskin.value.skin.value)
@@ -53,3 +53,5 @@ update = function (self, newskin)
end
return newskin
end
+
+return mymodule