<?php

define('_MD_PICO_FILTERS_XPWIKIINITWEIGHT',15);

function pico_xpwiki( $mydirname , $text , $content_row )
{
	@ include_once XOOPS_TRUST_PATH."/modules/xpwiki/include.php";

	if( ! class_exists( 'XpWiki' ) ) die( 'xpWiki is not installed correctly' ) ;

	// Get instance. option is xpWiki module's directory name.
	// 引数は、xpWikiをインストールしたディレクトリ名です。
	$wiki =& XpWiki::getSingleton( 'xpwiki' );
	
	// xpWiki の動作を決定する設定値を変更できます。
	// $wiki->setIniConst( '[KEY]' , '[VALUE]' ); // $wiki->root->[KEY] = [VALUE];
	// $wiki->setIniRoot( '[KEY]' , '[VALUE]' );  // $wiki->cont->[KEY] = [VALUE];
	
	// ex, 改行を有効にする
	$render->setIniRoot( 'line_break' , 1 );
	// ex. レンダリングキャッシュをする
	$render->setIniRoot( 'render_use_cache' , 1 );
	// ex. レンダリングキャッシュの有効期限は新たにページが作成されるまで
	$render->setIniRoot( 'render_cache_min' , 0 ); // キャッシュ有効時間(分)
	// ex. 外部リンクの target 属性 '_blank'
	$render->setIniRoot( 'link_target' , '_blank' );

	
	// 第二引数は、xpWikiのCSSを適用するためのDIVクラス名
	// 通常インストールしたディレクトリ名です。
	// CSS を適用しない場合は空白 '' でOK。
	return $wiki->transform( $text , 'xpwiki' );
}

?>