<?php

function b_d3news_topics_show($options) {

	global $xoopsDB;

	$mydirname = $options[0] ;
	require_once XOOPS_ROOT_PATH.'/class/xoopstopic.php';
	require_once dirname(dirname(__FILE__)).'/class/d3newsTopic.php'; // GIJ

	$block = array();
//	$xt = new XoopsTopic($xoopsDB->prefix("{$mydirname}_topics"));
	$bt = new D3newsTopic( $mydirname ); // GIJ
	$jump = XOOPS_URL.'/modules/'.$mydirname.'/index.php?storytopic=';
	$storytopic = isset($_GET['storytopic']) ? intval($_GET['storytopic']) : 0;
//	ob_start();
//	$xt->makeTopicSelBox(1, $storytopic,"storytopic","location=\"".$jump."\"+this.options[this.selectedIndex].value");
//	$block['selectbox'] = ob_get_contents();
//	ob_end_clean();
	$block['selectbox'] = $bt->makeTopicSelBox( true , $storytopic , "storytopic" , "location=\"".$jump."\"+this.options[this.selectedIndex].value" ) ;
	$block['mydirname'] = $mydirname;

	//require_once XOOPS_ROOT_PATH.'/class/template.php' ;
	$tpl = new icms_view_Tpl() ;
	$tpl->assign( 'block' , $block ) ;
	$ret['content'] = $tpl->fetch( 'db:'.$mydirname.'_block_topics.html') ;
	return $ret ;


}
?>
