def setUpWidgets(self, ignore_request=False): """ Setup widgets """ self.widgets = setUpInputWidgets( self.form_fields, self.prefix, self.context, self.request, ignore_request=ignore_request, )
def setUpWidgets(self, ignore_request=False): self.widgets = form.setUpInputWidgets( self.form_fields, self.prefix, self.context, self.request, ignore_request=ignore_request, )
def setUpWidgets(self, ignore_request=False): # In order to support fieldsets, we need to setup the widgets on all # the fieldsets as well. if self.is_fieldsets(): self.widgets = None for fieldset in self.form_fields.fieldsets: fieldset.widgets = form.setUpInputWidgets( fieldset, self.prefix, self.context, self.request, ignore_request=ignore_request ) if self.widgets is None: self.widgets = fieldset.widgets else: self.widgets += fieldset.widgets else: self.widgets = form.setUpInputWidgets( self.form_fields, self.prefix, self.context, self.request, ignore_request=ignore_request )
def setUpWidgets(self, ignore_request=False): # In order to support fieldsets, we need to setup the widgets on all # the fieldsets as well. if self.is_fieldsets(): self.widgets = None for fieldset in self.form_fields.fieldsets: fieldset.widgets = form.setUpInputWidgets( fieldset, self.prefix, self.context, self.request, ignore_request=ignore_request) if self.widgets is None: self.widgets = fieldset.widgets else: self.widgets += fieldset.widgets else: self.widgets = form.setUpInputWidgets( self.form_fields, self.prefix, self.context, self.request, ignore_request=ignore_request)
def get_options(self): html = '' for name, action in self.actions: html += '<div class="image-edit-action" id="%s-options">' % name widgets = form.setUpInputWidgets( action.options, name, self.context, self.request, ignore_request=True ) for widget in widgets: html += """ <div class="edit-option"> <label class="formQuestion" for="%s.%s">%s</label> <div class="formHelp">%s</div> %s </div> """ % ( name, widget.name, zope.i18n.translate(widget.context.title), zope.i18n.translate(widget.context.description), widget() ) if not action.skip_apply: html += """ <input type="button" id="%(name)s-apply-button" class="image-edit-apply-button" name="%(name)s" value="%(apply)s" /> """ % {'name': name, 'apply': zope.i18n.translate(ts.Apply)} html += '</div>' return html
def get_options(self): html = '' for name, action in self.actions: html += '<div class="image-edit-action" id="%s-options">' % name widgets = form.setUpInputWidgets(action.options, name, self.context, self.request, ignore_request=True) for widget in widgets: html += """ <div class="edit-option"> <label class="formQuestion" for="%s.%s">%s</label> <div class="formHelp">%s</div> %s </div> """ % (name, widget.name, zope.i18n.translate(widget.context.title), zope.i18n.translate( widget.context.description), widget()) if not action.skip_apply: html += """ <input type="button" id="%(name)s-apply-button" class="image-edit-apply-button" name="%(name)s" value="%(apply)s" /> """ % { 'name': name, 'apply': zope.i18n.translate(ts.Apply) } html += '</div>' return html
def setUpWidgets(self, ignore_request=True): self.widgets = form.setUpInputWidgets( self.form_fields, self.prefix, self.context, self.request, form=self, ignore_request=ignore_request, )