new.py now can create instances for Plone 2.5.5, Plone 3.0 to Plone 3.3.5. specificWritePermission and specificReadPermission can hold named (string) permissions instead of simple boolean values (which is still allowed). frontPage can call a custom macro. When launching generate.py with -c option, labels prefixed with custom_ are kept.

This commit is contained in:
Gaetan Delannay 2010-08-12 11:56:42 +02:00
parent bfd2357f69
commit dbcadc506d
17 changed files with 188 additions and 126 deletions

View file

@ -74,8 +74,16 @@ class ToolMixin(AbstractMixin):
'''Returns the list of root classes for this application.'''
return self.getProductConfig().rootClasses
def showPortlet(self):
return not self.portal_membership.isAnonymousUser()
def showPortlet(self, context):
if self.portal_membership.isAnonymousUser(): return False
if context.id == 'skyn': context = context.getParentNode()
res = True
if not self.getRootClasses():
res = False
# If there is no root class, show the portlet only if we are within
# the configuration.
if (self.id in context.absolute_url()): res = True
return res
def getObject(self, uid, appy=False):
'''Allows to retrieve an object from its p_uid.'''
@ -630,7 +638,7 @@ class ToolMixin(AbstractMixin):
contentType, flavourNumber = d1.split(':')
flavourNumber = int(flavourNumber)
searchName = keySuffix = d2
batchSize = self.getNumberOfResultsPerPage()
batchSize = self.appy().numberOfResultsPerPage
if not searchName: keySuffix = contentType
s = self.REQUEST.SESSION
searchKey = 'search_%s_%s' % (flavourNumber, keySuffix)