Important update of the plugin engine.

New plugin that allows the handling of an Amavisd-new SQL quarantine.

NB: a DB connections manager has been added inside the lib because
Django does not support multiple connections at the same time. The
main consequence is that we don't use an ORM and that we have to
rewrite a small wrapper that supports several DB (mysql, postgresql, etc.).
Adding a dependancy to an existing ORM module (like SQLalchemy) is
heavy, we don't want that for now.
This commit is contained in:
Antoine Nguyen
2009-06-26 17:13:35 +02:00
parent fc74d34c1d
commit fcab20b608
17 changed files with 227 additions and 19 deletions
+24 -1
View File
@@ -1,10 +1,33 @@
from django import template
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from mailng import main
from mailng.lib import events
register = template.Library()
@register.simple_tag
def menu(selection, perms):
entries = [
{"name" : "autoreply",
"url" : reverse(main.views.autoreply),
"img" : "/static/pics/auto-reply.png",
"label" : _("Auto-reply message")},
{"name" : "changepwd",
"url" : reverse(main.views.changepassword),
"img" : "/static/pics/edit.png",
"label" : _("Change password"),
"class" : "boxed",
"rel" : "{handler:'iframe',size:{x:350,y:220}}"}
]
return render_to_string('main/menu.html',
{"selection" : selection, "perms" : perms})
{"selection" : selection, "entries" : entries,
"perms" : perms})
@register.simple_tag
def loadextmenu(perms):
menu = events.raiseQueryEvent("UserMenuDisplay")
return render_to_string('main/menulist.html',
{"menu" : menu, "perms" : perms})