class LoginAlerts(Viewlet): viewletmanager(Top) order(15) context(LoginRoot) layer(DefaultLayer) template = get_template('messages.pt', __file__)
class Alerts(Viewlet): viewletmanager(Top) order(15) context(GateKeeper) layer(DefaultLayer) template = get_template('messages.pt', __file__)
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()]
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 = []
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()
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
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()
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
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)
class RGPDCK(uvclight.Viewlet): uvclight.viewletmanager(managers.IAboveContent) uvclight.order(00) uvclight.name('rgpdck') template = uvclight.get_template('rgpdck.cpt', __file__)
class AddMenuViewlet(MenuViewlet): uvclight.viewletmanager(managers.IAboveContent) uvclight.layer(IVBGTheme) uvclight.order(20) menu = menus.AddMenu
class ObjectActionMenuViewlet(MenuViewlet): uvclight.viewletmanager(managers.IAboveContent) uvclight.context(IContent) uvclight.layer(IVBGTheme) uvclight.order(10) menu = menus.ContextualActionsMenu