Community Documentation

Check_output() changes

Last updated February 19, 2008. Created by drumm on May 30, 2005.
Edited by puregin, ax. Log in to edit this page.

Because of the multiple input formats, a module which implements content has to take care of managing the format with each item. If your module uses the node system and passes content through check_output(), then you need to do two things:

  • Pass $node->format as the second parameter to check_output() whenever you use it.
  • Add a filter format selector to hook_form using a snippet like:
    <?php
    $output
    .= filter_form('format', $node->format);
    ?>

The node system will automatically save/load the format value for you.

If your module provides content outside of the node system, you can decide if you want to support multiple input formats or not. If you don't, the default format will always be used. However, if your module accepts input through the browser, it is strongly advised to support input formats!

To do this, you must:

  • Provide a selector for input formats on your forms, using filter_form().
  • Validate the chosen input format on submission, using filter_access().
  • Store the format ID with each content item (the format ID is a number).
  • Pass the format ID to check_output().

Check the API documentation for these functions for more information on how to use them.

Archive

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here