Esempio n. 1
0
 def set_value(self, resource, context, name, form):
     if name == 'data':
         return HTMLEditView.set_value(self, resource, context, name, form)
     if name in TagsAware_Edit.keys:
         return TagsAware_Edit.set_value(self, resource, context, name,
                                         form)
     return HTMLEditView.set_value(self, resource, context, name, form)
Esempio n. 2
0
 def get_value(self, resource, context, name, datatype):
     if name in ('data', 'file'):
         return HTMLEditView.get_value(self, resource, context, name,
                                       datatype)
     if name in TagsAware_Edit.keys:
         return TagsAware_Edit.get_value(self, resource, context, name,
                                         datatype)
     return HTMLEditView.get_value(self, resource, context, name, datatype)
Esempio n. 3
0
 def _get_query_to_keep(self, resource, context):
     """Forward is_admin_popup if defined"""
     to_keep = HTMLEditView._get_query_to_keep(self, resource, context)
     is_admin_popup = context.get_query_value('is_admin_popup')
     if is_admin_popup:
         to_keep.append({'name': 'is_admin_popup', 'value': '1'})
     return to_keep
Esempio n. 4
0
File: html.py Progetto: hforge/itws
    def _get_schema(self, resource, context):
        schema = merge_dicts(
                HTMLEditView._get_schema(self, resource, context),
                # other
                title_link_schema,
                display_title=Boolean)
        # Delete unused description/subject(keywords)
        del schema['description']
        del schema['subject']

        return freeze(schema)
Esempio n. 5
0
File: html.py Progetto: hforge/itws
 def _get_widgets(self, resource, context):
     base_widgets = HTMLEditView._get_widgets(self, resource, context)
     # Delete unused description/subject(keywords)
     widgets = [ widget for widget in base_widgets
                 if widget.name not in ('description', 'subject', 'state',
                                        'data') ]
     return freeze(widgets + [
         display_title_widget,
         PathSelectorWidget('title_link', title=MSG(u'Title link')),
         RadioWidget('title_link_target', title=MSG(u'Title link target'),
                     has_empty_option=False, oneline=True),
         advance_rte_widget, state_widget ])
Esempio n. 6
0
    def _get_schema(self, resource, context):
        schema = merge_dicts(
                HTMLEditView._get_schema(self, resource, context),
                # BoxAware API
                resource.edit_schema,
                # other
                title_link=String,
                title_link_target=Target,
                display_title=Boolean)
        # Delete unused description/subject(keywords)
        del schema['description']
        del schema['subject']

        return schema
Esempio n. 7
0
    def _get_widgets(self, resource, context):
        widgets = HTMLEditView._get_widgets(self, resource, context)[:]
        # Add display title widget
        display_title_widget = RadioWidget('display_title',
                title=MSG(u'Display title on webpage view ?'))
        widgets.insert(2, display_title_widget)
        # Tags
        widgets.extend(TagsAware_Edit._get_widgets(self, resource, context))

        # TODO: Add a mechanism in ikaaro that allow to configure RTE
        new_widgets = []
        for w in widgets:
            if issubclass(w, RTEWidget):
                w = Advance_RTEWidget(w.name, title=w.title)
            new_widgets.append(w)
        return freeze(new_widgets)
Esempio n. 8
0
 def action(self, resource, context, form):
     return HTMLEditView.action(self, resource, context, form)
Esempio n. 9
0
 def _get_schema(self, resource, context):
     return merge_dicts(HTMLEditView._get_schema(self, resource, context),
                        TagsAware_Edit._get_schema(self, resource, context),
                        display_title=Boolean)