-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.select.class.php
More file actions
55 lines (49 loc) · 937 Bytes
/
input.select.class.php
File metadata and controls
55 lines (49 loc) · 937 Bytes
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
<?php
class NyaaFormInputSelect extends NyaaFormInput
{
public $template = '<select id=":id" name=":name" class=":class" style=":style">:option</select>';
public $options = array();
public $blank = "-";
function __construct( )
{
parent::__construct( );
}
function setOptions( $options )
{
$this->options = $options;
}
function setBlank( $blank )
{
$this->blank = $blank;
}
function toHtml()
{
$html = "";
if( $this->blank != false )
{
$option = NyaaFormInput::factory(
array(
'type'=>'option',
'value'=>"",
'label'=> $this->blank
)
);
$html = $option->toHtml( );
}
foreach( $this->options as $k=>$v )
{
$option = NyaaFormInput::factory(
array(
'type'=>'option',
'value'=>$k,
'label'=>$v
)
);
$option->setValue( $this->getProp('value') );
$html .= $option->toHtml( );
}
$this->option = $html;
return parent::toHtml( );
}
}
?>