<?php
// DeedSelectForm.php
include_once('core/base/Form.php');

/**
 * 
 *
 * @todo Modifiy the Form class to be able to handle checkbox arrays of multiple form values;  When 
 *       that is done, modify the DeedSelectView class to use the new form functions.  Right now
 *		 the form names and values are hardcoded.
 * @author Matthew Lindberg
 */
class DeedSelectForm extends Form
{
	var $_DeedIDs 			= "deedids";
	var $_NumTimes			= "numtimes";

	
	/**
	 * Constructor.
	 *
	 * @access public
	 */
	function DeedSelectForm(& $session, & $request)
	{
		global $__CS; 
		$__CS->EnterMethod("DeedSelectForm ** Constructor");
		$__CS->SendObject($session,"session");
		$__CS->SendObject($request,"request");
		
		parent::Form(& $session, & $request);
		
		$__CS->ExitMethod("DeedSelectForm ** Constructor");
	}

	
	/**
	 * Loads the form with a DeedModel.
	 *
	 * @param $model
	 * @param $alias_id integer
	 * @access public
	 */
	function loadFromModel(& $deed_model)
	{
		return false;
	}
	
	/**
	 *
	 * @access public
	 * @return array( array(<deedid>,<numtimes>)* )
	 */
	function getSelections()
	{
		$ids = $this->request->get("deedid");
		
		$deeds = array();
		for($i=0; $i<count($ids); $i++) {
			$deeds[] = array($ids[$i],$this->request->get("numoftimes".$ids[$i]));
		}
		return $deeds;
	}
}
?>