comparison src/plugins/plugin_tmp_blog_banner.py @ 890:10bb8574ab11

plugin blog_banner: added temporary plugin with a user parameter to set a blog banner
author souliane <souliane@mailoo.org>
date Tue, 25 Feb 2014 11:32:21 +0100
parents
children
comparison
equal deleted inserted replaced
889:9cce5b42a134 890:10bb8574ab11
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # SAT temporary plugin for setting a blog banner
5 # Copyright (C) 2014 Adrien Cossa (souliane@mailoo.org)
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20
21 from sat.core.i18n import _, D_
22
23 PLUGIN_INFO = {
24 "name": "Blog Banner Plugin",
25 "import_name": "BLOG-BANNER",
26 "type": "TMP",
27 "protocols": [],
28 "dependencies": [],
29 "main": "BlogBanner",
30 "handler": "no",
31 "description": _("""Temporary plugin for setting a blog banner""")
32 }
33
34 PARAM_KEY = "Misc"
35 PARAM_NAME_BANNER = "Blog banner"
36
37
38 class BlogBanner(object):
39
40 params = """
41 <params>
42 <individual>
43 <category name="%(category_name)s" label="%(category_label)s">
44 <param name="%(param_name)s" label="%(param_label)s" value="" type="string" security="0"/>
45 </category>
46 </individual>
47 </params>
48 """ % {
49 'category_name': PARAM_KEY,
50 'category_label': D_(PARAM_KEY),
51 'param_name': PARAM_NAME_BANNER,
52 'param_label': D_('Blog banner URL')
53 }
54
55 def __init__(self, host):
56 host.memory.updateParams(self.params)