<?php

/* TODO: Add code here */
class PmEventFunction
{
	function AccessToViewpmsg(&$controller,$eventArgs)
	{
		$controller->executeForward(XOOPS_MODULE_URL."/pm/index.php");
	}

	function AccessToReadpmsg(&$controller,$eventArgs)
	{
		$msg_id=intval($_GET['msg_id']);
		$controller->executeForward(XOOPS_MODULE_URL."/pm/index.php?action=read&msg_id=".$msg_id);
	}

	function AccessToPmlite(&$controller,$eventArgs)
	{
		//
		// Does this access request reply mode?
		//
		$reply=isset($_GET['reply']) ? intval($_GET['reply']) : null;
		$msg_id=isset($_GET['msg_id']) ? intval($_GET['msg_id']) : 0;

		if($reply==null||$msg_id==0) {
			$controller->executeForward(XOOPS_MODULE_URL."/pm/pmlite.php");
		}
		else {
			$controller->executeForward(XOOPS_MODULE_URL."/pm/pmlite.php?reply=1&msg_id=".$msg_id);
		}
	}
}

?>