some minor bugfixes for dialogs, dijit.Editor and action handling
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2581 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
04b8c9633c
commit
3d8b566b87
6 changed files with 31 additions and 16 deletions
|
@ -102,7 +102,7 @@ actions.register('info', 'object', DialogAction,
|
|||
dialogName='',
|
||||
icon='cybertools.icons/info.png',
|
||||
cssClass='icon-action',
|
||||
addParams=dict(version='this')
|
||||
addParams=dict(version='this'),
|
||||
)
|
||||
|
||||
actions.register('external_edit', 'object', TargetAction,
|
||||
|
@ -111,3 +111,11 @@ actions.register('external_edit', 'object', TargetAction,
|
|||
icon='edit.gif',
|
||||
cssClass='icon-action',
|
||||
)
|
||||
|
||||
actions.register('edit_object', 'portlet', DialogAction,
|
||||
title=_(u'Edit Resource...'),
|
||||
description=_(u'Modify resource object.'),
|
||||
viewName='edit_object.html',
|
||||
dialogName='edit',
|
||||
prerequisites=['registerDojoEditor'],
|
||||
)
|
||||
|
|
|
@ -483,6 +483,11 @@ class BaseView(GenericView, I18NView):
|
|||
jsCall = 'dojo.require("dijit.form.ValidationTextBox");'
|
||||
self.controller.macros.register('js-execute', jsCall, jsCall=jsCall)
|
||||
|
||||
def registerDojoEditor(self):
|
||||
self.registerDojo()
|
||||
jsCall = 'dojo.require("dijit.Editor");'
|
||||
self.controller.macros.register('js-execute', jsCall, jsCall=jsCall)
|
||||
|
||||
|
||||
# vocabulary stuff
|
||||
|
||||
|
|
|
@ -49,9 +49,9 @@ actions.register('editFolder', 'portlet', DialogAction,
|
|||
|
||||
class FolderView(ConceptView):
|
||||
|
||||
def getActions(self, category='concept', page=None):
|
||||
def getActions(self, category='concept', page=None, target=None):
|
||||
if category == 'portlet':
|
||||
return actions.get(category, ['createFolder', 'editFolder'],
|
||||
view=self, page=page)
|
||||
view=self, page=page, target=target)
|
||||
return []
|
||||
|
||||
|
|
|
@ -111,9 +111,11 @@ class ObjectForm(NodeView):
|
|||
|
||||
@Lazy
|
||||
def schema(self):
|
||||
ti = self.typeInterface or IConceptSchema
|
||||
schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
||||
return schemaFactory(ti, manager=self, request=self.request)
|
||||
#ti = self.typeInterface or IConceptSchema
|
||||
#schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
||||
schemaFactory = ISchemaFactory(self.adapted)
|
||||
return schemaFactory(self.typeInterface, manager=self,
|
||||
request=self.request)
|
||||
|
||||
@Lazy
|
||||
def fields(self):
|
||||
|
@ -340,7 +342,10 @@ class CreateConceptForm(CreateObjectForm):
|
|||
@Lazy
|
||||
def typeInterface(self):
|
||||
if self.typeConcept:
|
||||
return removeSecurityProxy(ITypeConcept(self.typeConcept).typeInterface)
|
||||
ti = ITypeConcept(self.typeConcept).typeInterface
|
||||
if ti is not None:
|
||||
return removeSecurityProxy(ti)
|
||||
return IConceptSchema
|
||||
|
||||
@property
|
||||
def assignments(self):
|
||||
|
@ -393,7 +398,8 @@ class EditObject(FormController, I18NView):
|
|||
|
||||
@Lazy
|
||||
def schema(self):
|
||||
schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
||||
#schemaFactory = component.getAdapter(self.adapted, ISchemaFactory)
|
||||
schemaFactory = ISchemaFactory(self.adapted)
|
||||
#return schemaFactory(self.typeInterface)
|
||||
return schemaFactory(self.typeInterface, manager=self,
|
||||
request=self.request)
|
||||
|
|
|
@ -152,9 +152,9 @@ function validate() {
|
|||
if (titleField != undefined && titleField.value == '') {
|
||||
return false;
|
||||
}
|
||||
if (form != undefined) {
|
||||
/*if (form != undefined) {
|
||||
return form.submit();
|
||||
}
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -176,12 +176,8 @@ class ResourceView(BaseView):
|
|||
# actions
|
||||
|
||||
def getPortletActions(self, page=None, target=None):
|
||||
actions = []
|
||||
actions.append(DialogAction(self, title='Edit Resource...',
|
||||
description='Modify resource object.',
|
||||
viewName='edit_object.html', dialogName='edit',
|
||||
page=page, target=target))
|
||||
return actions
|
||||
return actions.get('portlet', ['edit_object'], view=self, page=page,
|
||||
target=target)
|
||||
|
||||
def getObjectActions(self, page=None, target=None):
|
||||
acts = ['info']
|
||||
|
|
Loading…
Add table
Reference in a new issue