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

	class ForumTopicBreadcrumb extends Widget {
		protected $forum_model;
		public $forum_topic_id = 0;

		public function __construct( $id , $parent = null ) {
			parent::__construct( $id , $parent );
			$this->forum_model = new ForumModel();
		}

		public function setTopicId( $v ) { $this->forum_topic_id = $v; }

		public function render() {
			if ($this->sRendered) return $this->sRendered;
			$breadcrumb = $this->forum_model->getForumTopicBreadcrumbData( $this->forum_topic_id );
			$this->setParam( "breadcrumb" , $breadcrumb );
			return parent::render();
		}

	}

?>
