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

	class ForumSearchPane extends Widget {

		public function __construct( $id , $parent = null ) {
			parent::__construct( $id , $parent );
			$this->oCommunityToolbar = new CommunityToolbar( "CommunityToolbar" , $this );

			$this->forum_search_form = new ForumSearchForm( "forum_search_form" , $this );
		}

		public function modifyGetPost( &$g , &$p ) {
			$retval = parent::modifyGetPost( $g , $p );
			if (isset( $this->aG["forum_search_submit"] )) {
				$this->forum_search_hits_topics = new ForumSearchHitsTopics( "forum_search_hits_topics" , $this );
				$this->forum_search_hits_posts = new ForumSearchHitsPosts( "forum_search_hits_posts" , $this );
			}
			return $retval;
		}

		protected function loadDatas() {
			if (!$this->forum_search_form->forum_search_submit->isSubmitted()) return;
		}

		public function render() {
			if ($this->sRendered) return $this->sRendered;
			$this->oCommunityToolbar->setTitle( __("forum_Search_in_forum") );
			$this->renderWidgets();
			$this->loadDatas();
			return parent::render();
		}
	}


?>
