Changeset 6193
- Timestamp:
- 22 May 2011, 16:43:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r6132 r6193 8 8 from z3c.flashmessage.interfaces import IMessageSource, IMessageReceiver 9 9 from zope.component import getUtility, queryUtility, ComponentLookupError 10 from zope.formlib.utility import setUpWidgets 10 11 from zope.interface import Interface 11 try: 12 from zope.site.hooks import getSite 13 except ImportError: 14 # BBB 15 from zope.app.component.hooks import getSite 16 from zope.formlib.utility import setUpWidgets 12 from zope.site.hooks import getSite 17 13 from waeup.sirp.interfaces import IWAeUPObject 18 14 from waeup.sirp.browser.interfaces import ITheme … … 62 58 title = u'' # What appears in the content title... 63 59 pnav = 0 # Primary navigation index... 64 60 65 61 def application_url(self, name=None): 66 62 """Return the URL of the nearest site. … … 84 80 """ 85 81 grok.baseclass() 86 82 87 83 class WAeUPPage(Page): 88 84 """A megrok.layout page with additional methods. … … 101 97 grok.baseclass() 102 98 template = default_waeup_edit_template 103 99 104 100 def setUpWidgets(self,ignore_request=False): 105 101 super(WAeUPEditFormPage,self).setUpWidgets(ignore_request) … … 126 122 def site(self): 127 123 return grok.getSite() 128 124 129 125 def getAppTitle(self): 130 126 return getattr(grok.getSite(), 'name', u'Sample University') 131 127 132 128 def isAuthenticated(self): 133 129 """Return True if the calling user is authenticated. … … 135 131 usertitle = self.request.principal.title 136 132 return usertitle != 'Unauthenticated User' 137 133 138 134 def getUserTitle(self): 139 135 """Return principal title of current user. … … 171 167 resource.need() 172 168 return 169
Note: See TracChangeset for help on using the changeset viewer.