Exemplo n.º 1
0
 def setUpWidgets(self, ignore_request=False):
     """ Setup widgets
     """
     self.widgets = setUpInputWidgets(
         self.form_fields, self.prefix, self.context, self.request,
         ignore_request=ignore_request,
         )
Exemplo n.º 2
0
 def setUpWidgets(self, ignore_request=False):
     self.widgets = form.setUpInputWidgets(
         self.form_fields,
         self.prefix,
         self.context,
         self.request,
         ignore_request=ignore_request,
     )
Exemplo n.º 3
0
 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
             )
Exemplo n.º 4
0
 def setUpWidgets(self, ignore_request=False):
     """ Setup widgets
     """
     self.widgets = setUpInputWidgets(
         self.form_fields,
         self.prefix,
         self.context,
         self.request,
         ignore_request=ignore_request,
     )
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
    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
Exemplo n.º 7
0
    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
Exemplo n.º 8
0
 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,
         )