<?php
	require_once( $GLOBALS["site_root"]."/includes/widgets/Widget.inc.php" );
	require_once( $GLOBALS["site_root"]."/includes/models/TodoList.inc.php" );

	class TodoPanel extends Widget {
		protected $iUserId = 0;

		public function __construct( $id , $parent = null ) {
			parent::__construct( $id , $parent );
		}

		public function setUserId( $v ) { $this->iUserId = $v; }

		protected function getDatas() {
			$tlm = new TodoListModel();
			$ds = $tlm->getUserTodoListItems( $this->iUserId );
			$this->setParam( "todo_list" , $ds );
		}

		public function render() {
			if ($this->sRendered) return $this->sRendered;
			$this->getDatas();
			return parent::render();
		}
	}

?>
