<?php
require '../../../include/cp_header.php';
require '../class/message.php';
require_once '../class/xoopssimplecontroller.php';

class DiscussMessageAdminList extends XoopsTableObjectList
{
	function DiscussMessageAdminList() {
		$this->addElement('discuss_id', 'discuss', 50, array('sort'=>true, 'filter'=>true, 'method'=>'id2name', 'class'=>'discuss'));
		$this->addElement('message_id', 'mid', 20, array('sort'=>true));
		$this->addElement('uid', 'uid', 20, array('sort'=>true));
		$this->addElement('uname', 'uname', 100, array('sort'=>true, 'filter'=>true));
		$this->addElement('message',  'message', 500);
		$this->addElement('timestamp',  'datetime', 150, array('sort'=>true, 'method'=>'time2str'));
		$this->addElement('__SimpleEditLink__','',50);
		$this->addElement('__SimpleDeleteLink__','',50);
	}
}

class DiscussMessageAdminForm extends XoopsTableObjectForm
{
	function DiscussMessageAdminForm() {
		$this->setPrefix('discuss_msg');
		$this->addElement('discuss_id', 'Hidden', '', 0);
		$this->addElement('message_id', 'Hidden', '', 0);
		$this->addElement('uid', 'Text', 'uid');
		$this->addElement('uname', 'Text', 'uname');
		$this->addElement('message', 'TextArea', 'message');
		$this->addElement('timestamp', 'Text', 'timestamp');
		$this->addElement('color', 'Text', 'color');
	}
}

$simpleAdmin =& new XoopsSimpleAdminController('DiscussMessage', _AD_DISCUSS_LANG_MESSAGE);
$simpleAdmin->allowedOp = array('list','edit','save','delete','deleteok','deleteall','deleteallok');
$simpleAdmin->execute();
?>