Source for file renderer.class.php
Documentation is available at renderer.class.php
* This file implements the RendererPlugin class (EXPERIMENTAL)
* This is the base class from which you should derive all rendering plugins.
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
require_once dirname(__FILE__
).
'/renderer.class.php';
* When should this plugin apply?
* Should this plugin apply to HTML?
* Should this plugin apply to XML?
* It should actually only apply when:
* - it generates some content that is visible without HTML tags
* - it removes some dirty markup when generating the tags (which will get stripped afterwards)
* Note: htmlentityencoded is not considered as XML here.
* Well, this one does nothing but checking if Rendering applies to the output format.
* You need to derive this function.
* {@internal Rendererplugin::render(-)}}
* @param string content to render (by reference) / rendered content
* @param string Output format, see {@link format_to_output()}
* @return boolean true if we can render something for the required output format
function render( & $content, $format )
// display in HTML page body: allow full HTML
// Special mode for RSS 0.92: apply renders and allow full HTML but escape it
// strips out HTML (mainly for use in Title)
// use as an attribute: strips tags and escapes quotes
// use as a form value: escapes quotes and < > but leaves code alone
// use in an XML file: strip HTML tags
// use as an attribute: strips tags and escapes quotes
die( 'Output format ['.
$format.
'] not supported by RendererPlugin.' );