mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-20 10:14:00 +01:00
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:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user