<?php
	FNTH_class( "Checkbox" );

	class AdminCheckbox extends FNTHCheckbox {
		protected $bShowTitle = false;
		protected $sTitle = "";

		public function setShowTitle( $v ) { $this->bShowTitle = $v; }
		public function setTitle( $v ) { $this->sTitle = $v; }

		public function modifyGetPost( &$g, &$p ) {
			$id = $this->getId();
			if (isset( $this->aG[$id] )) $this->setValue( $this->aG[$id] );
			if (isset( $this->aP[$id] )) $this->setValue( $this->aP[$id] );
			parent::modifyGetPost( $g , $p );
		}



		public function __construct( $id = "AdminCheckbox" , $parent = null ) {
			$this->addMediaDirectory( $GLOBALS["site_root"] , $GLOBALS["site_www"] , "design/rp/","widgets/");
			parent::__construct( $id , $parent );
			$this->setAttribute( "class" , "AdminCheckbox" );
			$this->setParam("language",$GLOBALS["language"]);
		}

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


?>
