Hi guys,

I've started working on a pattern component for configuring input format filters. At the moment it allows you to configure the roles which are allowed to use a given input format filter. I might also work on configuring the other parts of input format filters (e.g. filters to link each input format to).

Please find the code attached.

Example:

<filter name="Full HTML">
  <roles>
    <role>Editor</role>
    <role>Forum User</role>
  </roles>
</filter>
CommentFileSizeAuthor
#1 filter.inc_.zip1.31 KBhiddentao
filter.inc_.zip1.07 KBhiddentao

Comments

hiddentao’s picture

StatusFileSize
new1.31 KB

I've improved the component.

The root tag is now format. You can now rename input formats and assign filters to them. The code checks all role and filter names to ensure that the given names are all valid.

Examples...

1) Configuring an existing input format:

  <format name="Full HTML">
    <roles>
      <role>authenticated user</role>
      <role>Admin</role>
    </roles>
    <filters>
      <filter>HTML corrector</filter>
      <filter>Line break converter</filter>
      <filter>URL filter</filter>
    </filters>
  </format>  

2) Adding a new format:

  <format name="PHP format">
    <roles>
      <role>authenticated user</role>
    </roles>
    <filters>
      <filter>PHP evaluator</filter>
    </filters>
  </format>  

3) Renaming a format:

  <format id="2">
    <name>New name</name>
  </format>