comparison src/plugins/plugin_misc_static_blog.py @ 1020:adbde4a3a52f

plugin misc_static_blog: renamed from tmp_blog_banner, now also with page's title, meta keywords and description
author souliane <souliane@mailoo.org>
date Tue, 13 May 2014 17:17:57 +0200
parents src/plugins/plugin_tmp_blog_banner.py@10bb8574ab11
children 4c48e2549592
comparison
equal deleted inserted replaced
1019:6a16ec17a458 1020:adbde4a3a52f
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # SAT plugin for static blogs
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 from sat.core.constants import Const as C
23
24
25 PLUGIN_INFO = {
26 "name": "Static Blog Plugin",
27 "import_name": "STATIC-BLOG",
28 "type": "MISC",
29 "protocols": [],
30 "dependencies": [],
31 "main": "StaticBlog",
32 "handler": "no",
33 "description": _("""Plugin for static blogs""")
34 }
35
36
37 class StaticBlog(object):
38
39 params = """
40 <params>
41 <individual>
42 <category name="%(category_name)s" label="%(category_label)s">
43 <param name="%(title_name)s" label="%(title_label)s" value="" type="string" security="0"/>
44 <param name="%(banner_name)s" label="%(banner_label)s" value="" type="string" security="0"/>
45 <param name="%(keywords_name)s" label="%(keywords_label)s" value="" type="string" security="0"/>
46 <param name="%(description_name)s" label="%(description_label)s" value="" type="string" security="0"/>
47 </category>
48 </individual>
49 </params>
50 """ % {
51 'category_name': C.STATIC_BLOG_KEY,
52 'category_label': D_(C.STATIC_BLOG_KEY),
53 'title_name': C.STATIC_BLOG_PARAM_TITLE,
54 'title_label': D_('Page title'),
55 'banner_name': C.STATIC_BLOG_PARAM_BANNER,
56 'banner_label': D_('Banner URL'),
57 'keywords_name': C.STATIC_BLOG_PARAM_KEYWORDS,
58 'keywords_label': D_('Keywords'),
59 'description_name': C.STATIC_BLOG_PARAM_DESCRIPTION,
60 'description_label': D_('Description'),
61 }
62
63 def __init__(self, host):
64 host.memory.updateParams(self.params)