- Timestamp:
- 22 Nov 2011, 14:09:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r7137 r7167 3 3 import grok 4 4 5 from zope.component import getMultiAdapter, queryAdapter 5 from zope.component import getMultiAdapter, queryAdapter, getUtility 6 6 from zope.interface import Interface 7 7 from zope.location.interfaces import ISite 8 from zope.traversing.browser import absoluteURL 9 from zope.pluggableauth.interfaces import IAuthenticatorPlugin 8 10 from waeup.sirp.browser.pages import ( 9 11 UniversityPage, FacultyContainerPage, DatacenterPage, FacultyPage, … … 329 331 text = u'Data Center' 330 332 333 class MyPreferences(LeftSidebarLink): 334 """A link to personal preferences, placed in upper left box. 335 """ 336 grok.order(7) 337 grok.require('waeup.Public') 338 title = u'My Preferences' 339 icon = '' 340 341 def getUserAccount(self): 342 """Return local user account. 343 """ 344 principal_id = self.request.principal.id 345 authenticator = getUtility(IAuthenticatorPlugin, name='users') 346 account = authenticator.getAccount(principal_id) 347 return account 348 349 @property 350 def url(self): 351 account_object = self.getUserAccount() 352 if account_object: 353 return absoluteURL(account_object, self.request) 354 return 355 331 356 # 332 357 # Manage ("Edit settings") actions... 333 358 # 334 #class ManageUniversityActionButton(ManageActionButton):335 # """ 'Edit' button for University instances.336 # """337 # grok.context(IUniversity)338 # grok.view(UniversityPage)339 # text = 'Edit portal settings'340 341 #class ManageFacultiesActionButton(ManageActionButton):342 # """ 'Edit settings' button for faculty container.343 # """344 # grok.context(IFacultyContainer)345 # grok.view(FacultyContainerPage)346 359 347 360 class ManageDataCenterActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.