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

	class BlueboardReplybox extends Widget {
		public $iUserCommentId;
		public $sComment;
		public $bCanReply = false;
		public $bVisible = false;

		public $oCommentReply;

		public function __construct( $id , $parent = null ) {
			parent::__construct( $id , $parent );
			$this->oCommentReply = new FrontendTextbox( "comment_reply" , $this );
			$this->oCommentReply->setWidth( 605 );
			$this->oCommentReply->setAttribute( "maxlength" , 300 );

			$this->oPostReply = new FrontendSubmit( "smb_post_reply" , $this );
			$this->oPostReply->setValue( __("blueboardpage_Reply_to_rating","attr") , $this );
		}

		public function setVisible( $v ) { $this->bVisible = $v; }

		public function generateLangdefs() {
			fo3_add_js_langdef( "blueboardpage_Fill_the_reply" );
		}

		public function render() {
			if ($this->sRendered) return $this->sRendered;

			$this->generateLangdefs();
			$this->setParam( "sComment" , $this->sComment );
			$this->setParam( "bCanReply" , $this->bCanReply );
			$this->setParam( "bVisible" , $this->bVisible );
			$this->setParam( "iUserCommentId" , $this->iUserCommentId );
			return parent::render();
		}
	}	

?>
