summaryrefslogtreecommitdiffstats
path: root/dansguardian-controller.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-05-08 15:00:25 +0000
committerMika Havela <mika.havela@gmail.com>2008-05-08 15:00:25 +0000
commitac11c15126f83bffc7e47251baf41224ae58a113 (patch)
tree07bed27c8ca82c73c7f38f87b63237729edc1067 /dansguardian-controller.lua
parent4837cd73c1d79b17af443e0335cc04259505cd23 (diff)
downloadacf-dansguardian-ac11c15126f83bffc7e47251baf41224ae58a113.tar.bz2
acf-dansguardian-ac11c15126f83bffc7e47251baf41224ae58a113.tar.xz
When looking at a category-object, you now see if the reason why it's marked red or not (by clicking on the object).
You also see the content and other information about the category object. git-svn-id: svn://svn.alpinelinux.org/acf/dansguardian/trunk@1113 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'dansguardian-controller.lua')
-rw-r--r--dansguardian-controller.lua40
1 files changed, 23 insertions, 17 deletions
diff --git a/dansguardian-controller.lua b/dansguardian-controller.lua
index e647954..c72d17c 100644
--- a/dansguardian-controller.lua
+++ b/dansguardian-controller.lua
@@ -222,28 +222,34 @@ category = function( self )
label="Categories available",
value={},
})
- for k,v in pairs(self.model.get_categories()) do
- local types = { weighted, banned, exception }
-
--- for k,v in pairs(types) do
--- if (fs.is_file(
- --table.insert(weighted, cfe({type="link", value="value", name="name", label="label",}))
--- end
-
- table.insert(service.config.categories.value, v )
- end
+ service.config.categories = self.model.get_categories()
return ( cfe ({ option = option, service = service, info = info }) )
end
editcategories = function( self )
- local info = {
- status=self.model.get_status(),
- version = self.model.get_dansguardian_version(),
- autostart = self.model.get_autostart(),
- srvctrl = { value = srvctrl}
- }
+ local info = self.model.get_category(self.clientdata.category, self.clientdata.object)
+ if not (info) then
+ redirect(self, "category")
+ end
+
+ -- Add a cmd button to the view
+ info.cmdsave = cfe({ name="cmdsave",
+ label="Save/Apply above settings",
+ value="Save",
+ type="submit",
+ disabled="yes",
+ errtxt="This button is not configured to work",
+ })
+
+ info.cmddelete = cfe({ name="cmddelete",
+ label="Permanently remove object",
+ value="Delete",
+ type="submit",
+ disabled="yes",
+ errtxt="This button is not configured to work",
+ })
local option = { script = ENV["SCRIPT_NAME"],
prefix = self.conf.prefix,
@@ -252,6 +258,6 @@ editcategories = function( self )
extra = ""
}
- return ( cfe ({ option = option, info = info }) )
+ return ( cfe ({ option = option, info = info, mhdebug=self.clientdata }) )
end