summaryrefslogtreecommitdiffstats
path: root/application/modules/fbgui/forms/MembershipSelect.php
blob: 6e03f7de8370af96c063c0e74110ce1460f6f9c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

class fbgui_Form_MembershipSelect extends Zend_Form
{
	private $membershiplist;

	public function setMembershiplist($membershiplist){
		$this->membershiplist = $membershiplist;
			
	}

	public function getMembershiplist(){
		return $this->membershiplist;
	}

	public function init()
	{
		$this->setName("MembershipSelect");
		$this->setMethod('post');

		$membershipfield = $this->createElement('select','membershipID');
		$membershipfield ->setLabel('Membership:');

		if(count($this->membershiplist)>0){
			foreach($this->membershiplist as $membership => $m){
				$membershipfield->addMultiOption($m['membershipID'], $m['group'] . ' - ' . $m['role']);
			}
		}

		$membershipfield->setRegisterInArrayValidator(false);
		$this->addElement($membershipfield);

		$this->addElement('submit', 'selectmembership', array(
            'required' => false,
            'ignore'   => true,
            'label'    => 'Select',
		));
	}


}