source: trunk/merengueproj/plugins/core/config.py @ 4884

Revision 4884, 2.8 KB checked in by pmartin, 8 months ago (diff)

See #1 #2032 Change the name of the action

Line 
1# Copyright (c) 2010 by Yaco Sistemas
2#
3# This file is part of Merengue.
4#
5# Merengue is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# Merengue is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with Merengue.  If not, see <http://www.gnu.org/licenses/>.
17
18from django.conf import settings
19from django.core.urlresolvers import reverse
20from django.utils.translation import ugettext_lazy as _
21
22from merengue.pluggable import Plugin
23from merengue.registry import params
24from merengue.multimedia.admin import PhotoAdmin, VideoAdmin, AudioAdmin
25from merengue.multimedia.models import Photo, Video, Audio
26from merengue.section.admin import DocumentRelatedModelAdmin, DocumentAdmin
27from merengue.section.models import Document
28
29from plugins.core.actions import AdminAction, LoginAction, LogoutAction, PrintAction, HotLinkAction
30from plugins.core.blocks import (CoreMenuBlock, NavigationBlock,
31                                 PortalMenuBlock, ContactInfoBlock,
32                                 AnnouncementsBlock, PortalLinksBlock)
33from plugins.core.panels import (InplaceEditPanel, InlineTransPanel, VersionPanel,
34                                 InvalidateCachePanel, AddBlockPanel)
35
36
37class PluginConfig(Plugin):
38    name = 'Core'
39    description = 'Core plugin'
40    version = '0.0.1a'
41
42    url_prefixes = (
43        ('core', 'plugins.core.urls'),
44    )
45
46    config_params = [
47        params.Content(name='home_initial_content',
48                       label=_('home initial content'), default=1),
49        params.Single(name='login_url',
50                       label=_('Login URL'), default=settings.LOGIN_URL)]
51
52    def get_actions(self):
53        return [AdminAction, LoginAction, LogoutAction, PrintAction, HotLinkAction]
54
55    def get_blocks(self):
56        return [CoreMenuBlock, NavigationBlock, PortalMenuBlock,
57                ContactInfoBlock, AnnouncementsBlock, PortalLinksBlock]
58
59    def get_toolbar_panels(self):
60        return [InplaceEditPanel, InlineTransPanel, AddBlockPanel,
61                InvalidateCachePanel, VersionPanel, ]
62
63    def models(self):
64        return [
65            (Document, DocumentAdmin),
66            (Photo, PhotoAdmin),
67            (Video, VideoAdmin),
68            (Audio, AudioAdmin),
69        ]
70
71    def section_models(self):
72        return [(Document, DocumentRelatedModelAdmin)]
73
74    def get_perms(self):
75        return ()
76
77    def get_section_prefixes(self):
78        return (reverse('section_index'), )
Note: See TracBrowser for help on using the repository browser.