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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
<?php
class Application_Form_Session extends Zend_Form
{
private $clients;
private $bootos;
private $bootisos;
private $bootmenuentries;
public function init()
{
$this->setName("session");
$this->setMethod('post');
$this->addElement('text', 'alphasessionID', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 16)),
),
'required' => false,
'label' => 'alphasessionID:',
));
$clientfield = $this->createElement('select','clientID');
$clientfield ->setLabel('Client:');
$clientfield->addMultiOption('','');
if(count($this->clients)>0){
foreach($this->clients as $id => $g){
$clientfield->addMultiOption($g->getID(), $g->getMacadress());
}
}
$clientfield->setRegisterInArrayValidator(false);
$this->addElement($clientfield);
$bootmenuentrieyfield = $this->createElement('select','bootmenuentryID');
$bootmenuentrieyfield->setLabel('BootmenuentryID:');
$bootmenuentrieyfield->addMultiOption('','');
if(count($this->bootmenuentries)>0){
foreach($this->bootmenuentries as $id => $g){
$bootmenuentrieyfield->addMultiOption($g->getID(), $g->getTitle());
}
}
$bootmenuentrieyfield->setRegisterInArrayValidator(false);
$this->addElement($bootmenuentrieyfield);
$bootosfield = $this->createElement('select','bootosID');
$bootosfield ->setLabel('BootOs:');
$bootosfield->addMultiOption('','');
if(count($this->bootos)>0){
foreach($this->bootos as $id => $g){
$bootosfield->addMultiOption($g->getID(), $g->getTitle());
}
}
$bootosfield->setRegisterInArrayValidator(false);
$this->addElement($bootosfield);
$bootisofield = $this->createElement('select','bootisoID');
$bootisofield ->setLabel('BootIso:');
if(count($this->bootisos)>0){
foreach($this->bootisos as $id => $g){
$bootisofield->addMultiOption($g->getID(), $g->getTitle());
}
}
$bootisofield->setRegisterInArrayValidator(false);
$this->addElement($bootisofield);
$this->addElement('text', 'time', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 50)),
),
'required' => true,
'label' => 'time:',
));
$this->addElement('text', 'ip', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 50)),
),
'required' => false,
'label' => 'ip:',
));
$this->addElement('text', 'ip6', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 50)),
),
'required' => false,
'label' => 'ip6:',
));
$this->addElement('submit', 'add', array(
'required' => false,
'ignore' => true,
'label' => $this->buttontext,
));
$this->addElement('button', 'Cancel', array(
'onclick' => 'self.location="/session"'
));
}
function setClients($v){
$this->clients = $v;
}
function setBootos($v){
$this->bootos = $v;
}
function setBootisos($v){
$this->bootisos = $v;
}
function setBootmenuentries($v){
$this->bootmenuentries = $v;
}
private $buttontext = 'Save';
function setButtontext($v){
$this->buttontext = $v;
}
}
|