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

	class AdminNewsletterUserGroups extends AdminCheckboxList {

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

		public function modifyGetPost( &$g, &$p ) {
			$retval = parent::modifyGetPost( $g , $p );
			$nm = new NewsletterModel();
			$ngs = $nm->getNewsletterGroupOptions( false );
			foreach ($ngs as $ng_id => $ng_title)
				$this->addCheckbox( $ng_id , $ng_title . "<br/>" );
			return $retval;
		}

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

?>
