<?php
// $Id: whatsnew_show_main.php,v 1.3 2005/10/22 08:12:41 ohwada Exp $

// 2005-09-29 K.OHWADA
// change index.php & func.whatsnew.php to class

//=========================================================
// What's New Module
// 2004/08/20 K.OHWADA
//=========================================================

class Whatsnew_Show_Main extends Whatsnew_Show_Block
{
// local variable
	var $_time_start;


//---------------------------------------------------------
// constructor
//---------------------------------------------------------
function Whatsnew_Show_Main()
{
	Whatsnew_Show_Block::Whatsnew_Show_Block();
}

function &getInstance()
{
	static $instance;
	if (!isset($instance)) 
	{
		$instance = new Whatsnew_Show_Main();
	}

	return $instance;
}

// --------------------------------------------------------
// main function
// --------------------------------------------------------
function get_main()
{
// module weight key as mid
	$this->load_system_module();

// collect from all module
	$module_work_array = $this->collect_all_modules( 'block' );

// make block display

	$block = $this->make_block_lang();

	$i = 0;
	foreach ( $this->_system_weight_array as $mid => $weight)
	{
		if ( !isset($module_work_array[$mid]) )  continue;

		$block['modules'][$i++] = $this->make_block_module( $module_work_array[$mid] );
	}

// send ping
	$this->send_ping();

	return $block;
}

//-------------------------------------------------------------------
// measure time
//-------------------------------------------------------------------
function measure_time_start()
{
	$this->_time_start = $this->get_microtime();
}

function measure_time_end()
{
	$time = $this->get_microtime() - $this->_time_start;
	return $time;
}

function get_microtime()
{ 
	list($usec, $sec) = explode(" ",microtime()); 
	return ((float)$sec + (float)$usec); 
}

// --- class end ---
}

?>