Source for file data.quote.php
Documentation is available at data.quote.php
* @subpackage plugins_data
// +----------------------------------------------------------------------+
// | Copyright (c) 2005, bitweaver.org
// +----------------------------------------------------------------------+
// | All Rights Reserved. See below for details and a complete list of authors.
// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
// | For comments, please use phpdocu.sourceforge.net documentation standards!!!
// | -> see http://phpdocu.sourceforge.net/
// +----------------------------------------------------------------------+
// | Author (TikiWiki): Gustavo Muslera <gmuslera@users.sourceforge.net>
// | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
// | Reworked from: data.articles.php from wikiplugin_articles.php
// +----------------------------------------------------------------------+
global $gBitSystem, $gBitSmarty;
define( 'PLUGIN_GUID_DATAQUOTE', 'dataquote' );
'auto_activate' => FALSE,
'load_function' => 'data_quote',
'help_function' => 'data_quote_help',
'help_page' => 'DataPluginQuote',
'description' => tra( "This plugin allows content to be attributed to other authors and visually indicated." ),
'syntax' => "{quote format_guid= user= comment_id= }.. content ..{/quote}",
$help = "<table class=\"data help\">
<th>" . tra( "Key" ) . "</th>
<th>" . tra( "Type" ) . "</th>
<th>" . tra( "Comments" ) . "</th>
<td>" . tra( "comment_id") . '<br />' . tra("(optional)") . "</td>
<td>" . tra( "specify the comment_id of the comment being quoted") . "</td>
<td>" . tra( "user") . '<br />' . tra("(optional)") . "</td>
<td>" . tra( "specify the user whose comemnt is being quoted") . "</td>
<td>" . tra( "string") . '<br />' . tra("(required)") . "</td>
<td>" . tra( "Specify what renderer should be used to render the contents") . "</td>
tra("Example: ") . '{quote format_guid="tikiwiki" comment_id="7" user="user"} ... {/quote}<br />';
global $gLibertySystem, $gBitSmarty, $gBitSystem;
if( empty( $pParams['format_guid'] )) {
// default should be set - if not, we'll use tikiwiki - can't use PLUGIN_GUID_TIKIWIKI since it might not be defined.
$pParams['format_guid'] = $gBitSystem->getConfig( 'default_format', 'tikiwiki' );
$rendererHash['content_id'] = 0;
$rendererHash['format_guid'] = $pParams['format_guid'];
$rendererHash['data'] = trim( $pData );
$formatGuid = $rendererHash['format_guid'];
if( $func = $gLibertySystem->getPluginFunction( $formatGuid, 'load_function' ) ) {
$ret = $func( $rendererHash, $this );
$user = empty( $pParams['user'] ) ? NULL : $pParams['user'];
if( !empty( $pParams['comment_id'] )) {
if( ACTIVE_PACKAGE == 'boards' ) {
if( empty( $c->mInfo['title'] )) {
$c->mInfo['title'] = "#". $c->mCommentId;
$quote['title'] = $c->mInfo['title'];
$quote['created'] = $c->mInfo['created'];
$user = $c->mInfo['login'];
$quote['user_display_name'] = $u->mInfo['display_name'];
$gBitSmarty->assign( "quote", $quote );
$repl = $gBitSmarty->fetch( "bitpackage:liberty/plugins/data_quote.tpl" );
|