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

	class FreetextSearchPane extends Widget {
		protected $oArticlesSearchHitsGrid;
		protected $oMemberSearchHitsGrid;
		protected $oSelectedTranslators;

		protected $bGoogle = true;

		public function setGoogle( $v ) { $this->bGoogle = $v; }

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

		public function modifyGetPost( &$g , &$p ) {
			$retval = parent::modifyGetPost( $g , $p );
			if (!$this->bGoogle) {

				if ($GLOBALS["language"]=="hu") {
					$this->oArticlesSearchHitsGrid = new ArticlesSearchHitsGrid( "ArticlesSearchHitsGrid" , $this );
					$this->oArticlesSearchHitsGrid->setPageSize( 5 );
				}

				$this->oMemberSearchHitsGrid = new SearchHitsGrid( "MemberSearchHitsGrid" , $this );
				$this->oMemberSearchHitsGrid->setFreetextSearch( true );
				$this->oMemberSearchHitsGrid->setKeywordField( "q" );
				$this->oMemberSearchHitsGrid->setPageSize( 5 );
				$this->oMemberSearchHitsGrid->setTitle( __("Freetext_search_in_translators" ) );
				$this->oMemberSearchHitsGrid->setAttribute( "class" , "MemberSearchHitsGrid FrontendSuperGrid" );
				$this->oMemberSearchHitsGrid->setOmitHeader( false );

				$this->oSelectedTranslators = new SelectedTranslators( "SelectedTranslators" , $this );
			}
			return $retval;
		}

		public function render() {
			if ($this->sRendered) return $this->sRendered;
			$this->setParam( "bGoogle" , $this->bGoogle );
			return parent::render();
		}
	}

?>
