Esempio n. 1
0
class LoginAlerts(Viewlet):
    viewletmanager(Top)
    order(15)
    context(LoginRoot)
    layer(DefaultLayer)

    template = get_template('messages.pt', __file__)
Esempio n. 2
0
class Alerts(Viewlet):
    viewletmanager(Top)
    order(15)
    context(GateKeeper)
    layer(DefaultLayer)

    template = get_template('messages.pt', __file__)
Esempio n. 3
0
class FlashMessages(uvclight.Viewlet):
    uvclight.order(2)
    uvclight.layer(IVBGTheme)
    uvclight.viewletmanager(managers.IAboveContent)
    template = uvclight.get_template('flash.cpt', __file__)

    def update(self):
        self.messages = [msg.message for msg in receive()]
Esempio n. 4
0
class FlashMessages(uvclight.Viewlet):
    uvclight.viewletmanager(IAboveContent)
    template = uvclight.get_template('flashmessage.cpt', __file__)

    def update(self):
        messages = receive(None)
        if messages:
            self.messages = [msg for msg in receive(None)]
        else:
            self.messages = []
Esempio n. 5
0
class ContextualMenuDisplay(Viewlet):
    viewletmanager(Top)
    order(20)
    layer(DefaultLayer)

    def update(self):
        self.menu = ContextualActions(self.context, self.request, self.view)
        self.menu.update()

    def render(self):
        return self.menu.render()
Esempio n. 6
0
class FooterViewlet(MenuViewlet):
    uvclight.viewletmanager(managers.IFooter)
    uvclight.layer(IVBGTheme)
    uvclight.order(20)

    menu = menus.PersonalMenu
    template = get_template('footer.cpt')

    def getFooter(self):
        menu = menus.FooterMenu(self.context, self.request, self.view)
        menu.update()
        return menu.entries
Esempio n. 7
0
class DocumentActionsViewlet(MenuViewlet):
    uvclight.viewletmanager(managers.IAboveContent)
    uvclight.layer(IVBGTheme)
    uvclight.order(20)

    template = get_template('documentactionstemplate.cpt')
    name = u'Aktion'
    id = u'documentactionsviewlet'

    def update(self):
        self.menu = menus.DocumentActionsMenu(
            self.context, self.request, self.view)
        self.menu.update()
Esempio n. 8
0
class NavigationMenuViewlet(MenuViewlet):
    uvclight.viewletmanager(Navigation)
    uvclight.layer(IVBGTheme)
    uvclight.order(30)

    menu = menus.NavigationMenu
    template = get_template('navigationtemplate.cpt')

    id = u'globalmenuviewlet'

    def getNavigation(self):
        menu = menus.NavigationMenu(self.context, self.request, self.view)
        menu.update()
        return menu.entries

    def getUser(self):
        menu = menus.UserMenu(self.context, self.request, self.view)
        menu.update()
        return menu.entries

    def getRenderableItems(self):
       return list()

    def getQuicklinks(self):
        menu = menus.Quicklinks(self.context, self.request, self.view)
        menu.update()
        return menu.entries

    def getPersonal(self):
        menu = menus.PersonalMenu(self.context, self.request, self.view)
        menu.update()
        return menu.entries

    def isAuth(self):
        if hasattr(self.request, 'principal'):
            if self.request.principal.id != 'user.unauthenticated':
                return True
        return False
Esempio n. 9
0
class GlobalNav(uvclight.Viewlet):
    uvclight.viewletmanager(MainNavigation)
    uvclight.context(interface.Interface)
    template = uvclight.get_template('globalnav.cpt', __file__)

    @property
    def title(self):
        site = uvclight.getSite()
        if site is not None:
            return site.title
        return u'Navigation'

    def update(self):
        self.gmentries = []
        self.globalmenu = getMultiAdapter(
            (self.view.context, self.request, self.view), IViewletManager,
            'globalmenu')
        self.globalmenu.update()
        self.globalmenu.template = uvclight.get_template(
            'globalmenu.cpt', __file__)
        self.personalmenu = getMultiAdapter(
            (self.view.context, self.request, self.view), IViewletManager,
            'personal')
        self.personalmenu.update()
        self.personalmenu.template = uvclight.get_template(
            'personalmenu.cpt', __file__)
        self.submenus = list()
        submenus = getAdapters(
            (self.context, self.request, self.view, self.globalmenu), ISubMenu)
        for name, submenu in submenus:
            submenu.update()
            submenu.template = uvclight.get_template('submenu.cpt', __file__)
            self.submenus.append(submenu)
        for entry in self.globalmenu.entries:
            self.gmentries.append(entry)
        self.gmentries += self.submenus
        setattr(self.globalmenu, 'gmentries', self.gmentries)
Esempio n. 10
0
class RGPDCK(uvclight.Viewlet):
    uvclight.viewletmanager(managers.IAboveContent)
    uvclight.order(00)
    uvclight.name('rgpdck')
    template = uvclight.get_template('rgpdck.cpt', __file__)
Esempio n. 11
0
class AddMenuViewlet(MenuViewlet):
    uvclight.viewletmanager(managers.IAboveContent)
    uvclight.layer(IVBGTheme)
    uvclight.order(20)
    menu = menus.AddMenu
Esempio n. 12
0
class ObjectActionMenuViewlet(MenuViewlet):
    uvclight.viewletmanager(managers.IAboveContent)
    uvclight.context(IContent)
    uvclight.layer(IVBGTheme)
    uvclight.order(10)
    menu = menus.ContextualActionsMenu