2012-03-27 03:37:41 -05:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
from appy.gen.wrappers import AbstractWrapper
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
class PageWrapper(AbstractWrapper):
|
|
|
|
|
|
|
|
def validate(self, new, errors):
|
|
|
|
'''Inter-field validation.'''
|
|
|
|
return self._callCustom('validate', new, errors)
|
|
|
|
|
|
|
|
def showSubPages(self):
|
|
|
|
'''Show the sub-pages.'''
|
|
|
|
if self.user.has_role('Manager'): return 'view'
|
|
|
|
|
2013-03-08 09:16:25 -06:00
|
|
|
def showPortlet(self):
|
|
|
|
'''Do not show the portlet for a page, unless sub-pages arre defined.'''
|
|
|
|
if self.isEmpty('pages'): return False
|
|
|
|
return True
|
|
|
|
|
2012-03-27 03:37:41 -05:00
|
|
|
def onEdit(self, created):
|
|
|
|
return self._callCustom('onEdit', created)
|
|
|
|
# ------------------------------------------------------------------------------
|