54 $this->default_value=-1;
57 $this->position=
"normal";
100 if (!in_array(
$position, array(
"normal",
"in-absolute",
"absolute")))
110 $list_id=sprintf(
'%s_list', $this->
id);
111 switch ($this->position)
117 $javascript=sprintf(
'
118 $("%s_bt").onclick=function() {
119 displaySelectBox("%s");
121 ', $this->
id, $this->
id);
133 $list_id=sprintf(
'%s_list', $this->
id);
139 printf(
'<input type="button" class="smallbutton " id="%s_bt" value="%s ⇩" >',
140 $this->
id, $this->
value);
141 printf(
'<input type="hidden" id="%s" name="%s" value="%s">',
142 $this->
id, $this->
id, $this->default_value);
143 printf(
'<div class="select_box " id="select_box%s" style="%s">',
144 $this->
id, $this->style_box);
147 if ($this->filter!=
"")
154 printf(
'<ul id="%s">', $list_id);
155 for (
$i=0;
$i<count($this->item);
$i++)
157 if ($this->item[
$i][
'type']==
"url")
159 printf(
'<li><a href="%s">%s</a></li>', $this->item[
$i][
'url'], $this->item[
$i][
'label']);
162 if ($this->item[
$i][
'type']==
"javascript")
164 printf(
'<li><a href="javascript:void(0)" onclick="%s">%s</a></li>', $this->item[
$i][
'javascript'],
165 $this->item[
$i][
'label']);
167 else if ($this->item[
$i][
'type']==
"value")
169 printf(
'<li><a href="javascript:void(0)" onclick="%s">%s</a></li>', $this->item[
$i][
'javascript'],
170 $this->item[
$i][
'label']);
172 else if ($this->item[
$i][
'type']==
"input")
175 $ok->value=$this->item[
$i][
'label'];
176 $ok->javascript=$this->item[
$i][
'input']->javascript;
177 printf(
'<li> %s %s</li>', $this->item[
$i][
'input']->
input(), $ok->input()
206 $javascript.
";$('select_box{$this->id}').hide()";
208 $this->item[
$this->cnt][
'javascript']=$javascript.
";$('select_box{$this->id}').hide()";
218 $this->item[
$this->cnt][
'javascript']=sprintf(
" $('%s').value='%s';$('%s_bt').value='%s \u21E9';$('select_box%s').hide()",
232 $this->item[
$this->cnt][
'input']=clone $p_element;
noalyss_str_replace($search, $replace, $string)
Display a kind of select.
add_javascript($label, $javascript, $replace=false)
$filter
allow a dynamic not case sensitive search
add_input($p_label, HtmlInput $p_element)
set_default_value($default_value)
$position
change depending if we are in an absolute block or not
__construct($p_id, $value)
add_value($label, $value)