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

	class Tab2 extends Widget {
		protected $iActiveTab = 0;
		protected $sTab1Title = "";
		protected $sTab2Title = "";

		public function setActiveTab( $i ) { $this->iActiveTab = $i; }

		public function renderContentLeft() {
			$filename = $this->getTemplateFilename( ".left.content" );
			return $this->renderFromTemplate( $filename );
		}
		
		public function renderContentRight() {
			$filename = $this->getTemplateFilename( ".right.content" );
			return $this->renderFromTemplate( $filename );
		}
		
		public function renderContentBottom() {
			$filename = $this->getTemplateFilename( ".bottom.content" );
			return $this->renderFromTemplate( $filename );
		}

		public function render() {
			if ($this->sRendered) return $this->sRendered;
			$this->renderWidgets();
			$this->setParam( "tab1title" , $this->sTab1Title );
			$this->setParam( "tab2title" , $this->sTab2Title );
			$this->setParam( "activetab" , $this->iActiveTab );
			$this->setParam( "debug_log_queries" , FNTH_db_renderlog() );
			$this->setParam( "content_left" , $this->renderContentLeft() );
			$this->setParam( "content_right" , $this->renderContentRight() );
			$this->setParam( "content_bottom" , $this->renderContentBottom() );
			return parent::render();
		}
	}

?>
