Example #1
0
def allowembedtag(portal,logger):
    from plone.app.controlpanel.filter import FilterControlPanelAdapter
    objAdapter = FilterControlPanelAdapter(portal)
    nastytags = objAdapter.nasty_tags    

    for t in ['object','embed',]:
        try:
            if nastytags.index(t) >= 0:
                nastytags.remove(t)
        except ValueError:
            pass    # do nothing if tag doesn't exist.
            
    objAdapter.nasty_tags = nastytags
    
    strippedtags = objAdapter.stripped_tags
    
    for t in ['object',]:
        try:
            if strippedtags.index(t) >= 0:
                strippedtags.remove(t)
        except ValueError:
            pass    # do nothing if tag doesn't exist.
            
    objAdapter.stripped_tags = strippedtags
    
    customtags = objAdapter.custom_tags
    
    for t in ['object','embed',]:
        try:
            if customtags.index(t) < 0:
                customtags.append(t)
        except ValueError:
            customtags.append(t)
            
    objAdapter.custom_tags = customtags
Example #2
0
 def __call__(self):
     adapter = FilterControlPanelAdapter(self.context)
     adapter.nasty_tags = []
     adapter.stripped_tags = []
     adapter.custom_tags += ['iframe', 'embed']
     self.request.response.redirect(
         self.context.absolute_url() + '/@@filter-controlpanel')
Example #3
0
def allowembedtag(portal, logger):
    from plone.app.controlpanel.filter import FilterControlPanelAdapter
    objAdapter = FilterControlPanelAdapter(portal)
    nastytags = objAdapter.nasty_tags

    for t in [
            'object',
            'embed',
    ]:
        try:
            if nastytags.index(t) >= 0:
                nastytags.remove(t)
        except ValueError:
            pass  # do nothing if tag doesn't exist.

    objAdapter.nasty_tags = nastytags

    strippedtags = objAdapter.stripped_tags

    for t in [
            'object',
    ]:
        try:
            if strippedtags.index(t) >= 0:
                strippedtags.remove(t)
        except ValueError:
            pass  # do nothing if tag doesn't exist.

    objAdapter.stripped_tags = strippedtags

    customtags = objAdapter.custom_tags

    for t in [
            'object',
            'embed',
    ]:
        try:
            if customtags.index(t) < 0:
                customtags.append(t)
        except ValueError:
            customtags.append(t)

    objAdapter.custom_tags = customtags