61 |
* hidden version of it. |
* hidden version of it. |
62 |
*/ |
*/ |
63 |
var $_visible_checkbox_items = array(); |
var $_visible_checkbox_items = array(); |
64 |
|
|
65 |
|
/** |
66 |
|
* this flag tells us to save the |
67 |
|
* checked items between pages |
68 |
|
* By default this is off. |
69 |
|
*/ |
70 |
|
var $_save_checked_items_flag = FALSE; |
71 |
|
|
72 |
/** |
/** |
73 |
* This variable holds the array of default |
* This variable holds the array of default |
86 |
var $_show_actionbar = TRUE; |
var $_show_actionbar = TRUE; |
87 |
|
|
88 |
/** |
/** |
89 |
* This variable tells us whether to display select all checkbox |
* This variable tells us whether to display |
90 |
*/ |
* select all checkbox |
91 |
|
*/ |
92 |
var $_allow_select_all = TRUE; |
var $_allow_select_all = TRUE; |
93 |
|
|
94 |
|
|
95 |
/** |
/** |
96 |
|
* this array holds some strings for the |
97 |
|
* search functionality. This enables |
98 |
|
* some level of localization for other |
99 |
|
* languages. |
100 |
|
* |
101 |
|
*/ |
102 |
|
var $_search_text = array("title" => "Search", |
103 |
|
"find" => "Find", |
104 |
|
"button" => "Search"); |
105 |
|
|
106 |
|
/** |
107 |
|
* If true, allows search block to be |
108 |
|
* collapsed/expanded. |
109 |
|
* |
110 |
|
* NOTE: This doesn't stay collapsed between |
111 |
|
* pages, when using GET as the form method. |
112 |
|
* |
113 |
|
*/ |
114 |
|
var $_collapsable_search = FALSE; |
115 |
|
|
116 |
|
/** |
117 |
|
* Initial state of the search tree |
118 |
|
* |
119 |
|
*/ |
120 |
|
var $_search_tree_open = TRUE; |
121 |
|
|
122 |
|
/** |
123 |
|
* for a reference so the row_filter |
124 |
|
* affects the paging information. |
125 |
|
*/ |
126 |
|
var $__page_info = ""; |
127 |
|
|
128 |
|
|
129 |
|
var $_cur_col_cntr = 0; |
130 |
|
|
131 |
|
|
132 |
|
/** |
133 |
* This function sets a prefix for all |
* This function sets a prefix for all |
134 |
* variables that are used in the item list |
* variables that are used in the item list |
135 |
* table on a page. This allows you to have |
* table on a page. This allows you to have |
144 |
} |
} |
145 |
|
|
146 |
|
|
147 |
|
/** |
148 |
|
* This sets the flag to turn on/off the |
149 |
|
* ability to collapse the search box. |
150 |
|
* |
151 |
|
* @param bool |
152 |
|
*/ |
153 |
|
function set_search_collapse($flag=TRUE) { |
154 |
|
$this->_collapsable_search = $flag; |
155 |
|
} |
156 |
|
|
157 |
|
|
158 |
function gui_init() { |
function gui_init() { |
159 |
$container = container(); |
$container = container(); |
160 |
$container->add( $this->build_tool_link("first"), |
if (!$this->get_showall()) { |
161 |
|
$container->add( $this->build_tool_link("first"), |
162 |
$this->build_tool_link("prev"), |
$this->build_tool_link("prev"), |
163 |
$this->build_tool_link("next"), |
$this->build_tool_link("next"), |
164 |
$this->build_tool_link("last"), |
$this->build_tool_link("last"), |
165 |
$this->build_tool_link("all"), |
$this->build_tool_link("expand") ); |
166 |
$this->get_page_info() ); |
} |
167 |
|
|
168 |
|
$container->add_reference( $this->__page_info ); |
169 |
|
|
170 |
$this->_data_table = html_table($this->get_width(),0,0,0, $this->_align); |
$this->_data_table = html_table($this->get_width()); |
171 |
$this->_data_table->set_class("datalist_border"); |
$this->_data_table->set_class("datalist_border"); |
172 |
|
|
173 |
$this->_tool_td = html_td("datalist_title", "right", $container); |
$this->_tool_td = html_td("datalist_title", "right", $container); |
246 |
$td = $this->_build_action_column("LAST", TRUE); |
$td = $this->_build_action_column("LAST", TRUE); |
247 |
$this->_header_tr->add( $td ); |
$this->_header_tr->add( $td ); |
248 |
} |
} |
249 |
unset( $this->_cur_col_cntr ); |
$this->_cur_col_cntr = 0; |
250 |
} else { |
} else { |
251 |
$this->_cur_col_cntr++; |
$this->_cur_col_cntr++; |
252 |
} |
} |
284 |
|
|
285 |
$this->_data_table->add_row( $this->_data_row ); |
$this->_data_table->add_row( $this->_data_row ); |
286 |
$this->_data_row = new TRtag; |
$this->_data_row = new TRtag; |
287 |
unset( $this->_cur_col_cntr ); |
$this->_cur_col_cntr = 0; |
288 |
} else { |
} else { |
289 |
$this->_cur_col_cntr++; |
$this->_cur_col_cntr++; |
290 |
} |
} |
291 |
} |
} |
292 |
|
|
293 |
|
/** |
294 |
|
* Override the parent's method so we can wrap |
295 |
|
* everything in a div to hold it all together |
296 |
|
* when we change the alignment |
297 |
|
* |
298 |
|
* @return DIVtag object |
299 |
|
*/ |
300 |
|
function build_gui() { |
301 |
|
$div = html_div("", DataList::build_gui() ); |
302 |
|
$div->set_tag_attribute("align", $this->_align ); |
303 |
|
return $div; |
304 |
|
} |
305 |
|
|
306 |
function child_get_gui() { |
function child_get_gui() { |
307 |
|
$this->__page_info = $this->get_page_info(); |
308 |
return container( $this->_data_table, |
return container( $this->_data_table, |
309 |
$this->_build_actionbar() ); |
$this->_build_actionbar() ); |
310 |
} |
} |
311 |
|
|
312 |
|
function _build_default_vars() { |
313 |
|
$c = parent::_build_default_vars(); |
314 |
|
|
315 |
|
if ($this->_save_checked_items_enabled()) { |
316 |
|
foreach( $this->_hidden_checkbox_items as $key => $value ) { |
317 |
|
if (!isset($this->_visible_checkbox_items[$key])) { |
318 |
|
$c->add( form_hidden($this->_vars["checkboxVar"].'[]', $key ) ); |
319 |
|
} |
320 |
|
} |
321 |
|
} |
322 |
|
|
323 |
|
return $c; |
324 |
|
} |
325 |
|
|
326 |
/** |
/** |
327 |
* This function builds the object/text |
* This function builds the object/text |
348 |
|
|
349 |
$td->set_tag_attribute("title","Sort By ".$col_name); |
$td->set_tag_attribute("title","Sort By ".$col_name); |
350 |
|
|
351 |
$td->push(html_a($col_url, $col_name,"form_link")); |
$td->add(html_a($col_url, $col_name,"form_link")); |
352 |
|
|
353 |
if ($this->_columns[$col_name]["data_name"] == $this->orderby()) { |
if ($this->_columns[$col_name]["data_name"] == $this->orderby()) { |
354 |
|
|
356 |
$alt_title = "Sorted in Ascending Order"; |
$alt_title = "Sorted in Ascending Order"; |
357 |
$img = html_img($this->get_image_path()."/picto_down.gif",11,11,'',$alt_title); |
$img = html_img($this->get_image_path()."/picto_down.gif",11,11,'',$alt_title); |
358 |
$img->set_tag_attribute("style", "padding-left: 5px;margin-left:5px;vertical-align:middle;"); |
$img->set_tag_attribute("style", "padding-left: 5px;margin-left:5px;vertical-align:middle;"); |
359 |
$td->push($img); |
$td->add($img); |
360 |
} else { |
} else { |
361 |
$alt_title = "Sorted in Descending Order"; |
$alt_title = "Sorted in Descending Order"; |
362 |
$img = html_img($this->get_image_path()."/picto_up.gif",11,11,'',$alt_title); |
$img = html_img($this->get_image_path()."/picto_up.gif",11,11,'',$alt_title); |
363 |
$img->set_tag_attribute("style", "padding-left: 5px;margin-left:5px;vertical-align:middle;"); |
$img->set_tag_attribute("style", "padding-left: 5px;margin-left:5px;vertical-align:middle;"); |
364 |
$td->push($img); |
$td->add($img); |
365 |
} |
} |
366 |
} |
} |
367 |
|
|
375 |
|
|
376 |
|
|
377 |
if ($this->get_form_method() == "POST") { |
if ($this->get_form_method() == "POST") { |
378 |
$td->set_tag_attribute("onClick", $col_url); |
$td->set_tag_attribute("onclick", $col_url); |
379 |
} |
} |
380 |
else { |
else { |
381 |
$td->set_tag_attribute("onClick", "javascript:document.location='".$col_url."';"); |
$td->set_tag_attribute("onclick", "javascript:document.location='".$col_url."';"); |
382 |
} |
} |
383 |
} else { |
} else { |
384 |
$td->push($col_name); |
$td->add($col_name); |
385 |
$td->set_tag_attribute("style", $style."padding-left:5px;padding-right:5px;white-space:nowrap;"); |
$td->set_tag_attribute("style", "padding-left:5px;padding-right:5px;white-space:nowrap;"); |
386 |
} |
} |
387 |
|
|
388 |
return $td; |
return $td; |
447 |
"align" => "left", |
"align" => "left", |
448 |
"class" => "font10"); |
"class" => "font10"); |
449 |
|
|
450 |
$table = html_table($this->get_width(),0,0,0,$this->_align); |
$table = html_table($this->get_width()); |
451 |
|
|
452 |
|
if (isset($_REQUEST["_search_tree_open"])) { |
453 |
|
// set the search tree state |
454 |
|
$this->_search_tree_open = $_REQUEST["_search_tree_open"]; |
455 |
|
} |
456 |
|
|
457 |
//test to see if they want to render the outer borders |
//test to see if they want to render the outer borders |
458 |
$table->set_tag_attribute("style", "border-left: 1px solid #a1a1a1;". |
$table->set_tag_attribute("style", "border-left: 1px solid #a1a1a1;". |
461 |
$td = new TDtag($td_attributes); |
$td = new TDtag($td_attributes); |
462 |
|
|
463 |
if ($this->search_type() == "advanced") { |
if ($this->search_type() == "advanced") { |
464 |
$td->push($this->_build_advanced_search_form()); |
$td->add($this->_build_advanced_search_form()); |
465 |
} else { |
} else { |
466 |
$td->push($this->_build_simple_search_form()); |
$td->add($this->_build_simple_search_form()); |
467 |
} |
} |
468 |
$table->push_row($td); |
$table->add_row($td); |
469 |
|
|
470 |
|
if ($this->_collapsable_search) { |
471 |
|
$div = new DIVtag(array("id"=>"search"), $table); |
472 |
|
if (!$this->_search_tree_open) { |
473 |
|
// hide search if tree is closed |
474 |
|
$div->set_tag_attribute("style", "visibility:hidden;height:1px;"); |
475 |
|
} |
476 |
|
|
477 |
return container($this->_build_search_title(), $table); |
$this->set_save_vars(array("_search_tree_open" => |
478 |
|
(int)$this->_search_tree_open)); |
479 |
|
|
480 |
|
|
481 |
|
return container($this->_build_search_title(), $div); |
482 |
|
} else { |
483 |
|
return container($this->_build_search_title(), $table); |
484 |
|
} |
485 |
} |
} |
486 |
|
|
487 |
/** |
/** |
491 |
*/ |
*/ |
492 |
function _build_search_title() { |
function _build_search_title() { |
493 |
//build the title stacked table |
//build the title stacked table |
494 |
$title = html_table($this->get_width(), 0, 0, 0, $this->_align); |
$title = html_table($this->get_width()); |
495 |
|
|
496 |
|
if ($this->_collapsable_search) { |
497 |
|
// build link for collapsable search |
498 |
|
|
499 |
|
if ($this->_search_tree_open) $img_source = "tree_open.gif"; |
500 |
|
else $img_source = "tree_closed.gif"; |
501 |
|
|
502 |
|
$img = html_img("/images/widgets/" . $img_source, 10, 10); |
503 |
|
$img->set_tag_attribute("id", "isearch"); |
504 |
|
|
505 |
|
$img = html_a("javascript:toggle_tree('search')", $img); |
506 |
|
|
507 |
|
$link = html_a("javascript:toggle_tree('search')", $this->_search_text["title"], "form_link"); |
508 |
|
$link->set_tag_attribute("id", "lsearch"); |
509 |
|
|
510 |
|
$c = container(_HTML_SPACE, $img, $link); |
511 |
|
} else { |
512 |
|
$c = container(_HTML_SPACE . $this->_search_text["title"]); |
513 |
|
} |
514 |
|
|
515 |
|
|
516 |
//test to see if they want to render the outer borders |
//test to see if they want to render the outer borders |
517 |
$title->set_tag_attribute("style","border: 1px solid #a1a1a1;"); |
$title->set_tag_attribute("style","border: 1px solid #a1a1a1;"); |
518 |
$title->push_row(new TDtag(array("class" => "datalist_title", |
$title->add_row(new TDtag(array("class" => "datalist_title", |
519 |
"style" => "color: ".$this->_title_fcolor.";". |
"align" => "left"), $c)); |
|
"background-color: ".$this->_title_color.";"), " Search")); |
|
520 |
|
|
521 |
return $title; |
return $title; |
522 |
} |
} |
542 |
if ($cnt == 1) { |
if ($cnt == 1) { |
543 |
//user only has 1 field to show. |
//user only has 1 field to show. |
544 |
list($name, $field) = each($fields); |
list($name, $field) = each($fields); |
545 |
$container->push("Find ".$name." "); |
$container->add($this->_search_text["find"]." ".$name." "); |
546 |
} else { |
} else { |
547 |
//user has many fields to show. |
//user has many fields to show. |
548 |
$container->push("Find ", |
$container->add($this->_search_text["find"]." ", |
549 |
form_select($this->_vars["search_fieldVar"], $fields, $this->search_field())); |
form_select($this->_vars["search_fieldVar"], $fields, $this->search_field())); |
550 |
} |
} |
551 |
|
|
552 |
if ($this->get_simple_search_modifier()) { |
if ($this->get_simple_search_modifier()) { |
553 |
//the user wants the search modifier turned on. |
//the user wants the search modifier turned on. |
554 |
$container->push($this->_build_simple_search_modifier()); |
$container->add($this->_build_simple_search_modifier()); |
555 |
} |
} |
556 |
|
|
557 |
$container->push(form_text($this->_vars["search_valueVar"], $this->search_value_filter($this->search_value()), "20", "100", array("style"=>"vertical-align:middle;")), |
$container->add(form_text($this->_vars["search_valueVar"], $this->search_value_filter($this->search_value()), "20", "100", array("style"=>"vertical-align:middle;")), |
558 |
form_submit($this->get_form_name(), "Search", array("style"=>"vertical-align:middle;"))); |
form_submit($this->get_form_name(), |
559 |
|
$this->_search_text["button"], array("style"=>"vertical-align:middle;"))); |
560 |
|
|
561 |
if ($this->is_advanced_search_enabled()) { |
if ($this->is_advanced_search_enabled()) { |
562 |
$span = html_span(html_a("ass","Advanced Search", "title")); |
$span = html_span(html_a("#","Advanced Search", "title")); |
563 |
$container->push(" ", $span); |
$container->add(" ", $span); |
564 |
} |
} |
565 |
|
|
566 |
if ($cnt == 1) { |
if ($cnt == 1) { |
567 |
$container->push(form_hidden($this->_vars["search_fieldVar"], $field)); |
$container->add(form_hidden($this->_vars["search_fieldVar"], $field)); |
568 |
} |
} |
569 |
|
|
570 |
return $container; |
return $container; |
623 |
* set the flag to tell the object to |
* set the flag to tell the object to |
624 |
* save the checked items |
* save the checked items |
625 |
* |
* |
626 |
*/ |
* NOTE: this only works if we are in POST mode. |
627 |
function save_checked_items() { |
* GET can easily fail because of too many |
628 |
$this->_save_checked_items_flag = TRUE; |
* items saved on the query string. |
629 |
|
* |
630 |
|
* @param boolean TRUE = enable |
631 |
|
*/ |
632 |
|
function save_checked_items($flag=TRUE) { |
633 |
|
if ($this->get_form_method() == 'POST') { |
634 |
|
$this->_save_checked_items_flag = $flag; |
635 |
|
} else { |
636 |
|
user_error(__CLASS__."::".__FUNCTION__."() - Cannot be used while form method is GET. ". |
637 |
|
"You should call DataList::set_form_method('POST') first.<br>", E_USER_ERROR); |
638 |
|
} |
639 |
} |
} |
640 |
|
|
641 |
/** |
/** |
762 |
$obj = form_checkbox($name, $form_value); |
$obj = form_checkbox($name, $form_value); |
763 |
if ($header_flag) { |
if ($header_flag) { |
764 |
if ($this->_allow_select_all) { |
if ($this->_allow_select_all) { |
765 |
$obj->set_tag_attribute("onClick", "javascript:mass(this.form)"); |
$obj->set_tag_attribute("onclick", "javascript:mass(this.form)"); |
766 |
} else { |
} else { |
767 |
$obj = _HTML_SPACE; |
$obj = _HTML_SPACE; |
768 |
} |
} |
782 |
//save which items we have rendered visibly. |
//save which items we have rendered visibly. |
783 |
//so we can filter those out in the hidden |
//so we can filter those out in the hidden |
784 |
//items |
//items |
785 |
$this->_visible_checkbox_items[$form_value] = TRUE;; |
$this->_visible_checkbox_items[$form_value] = TRUE; |
786 |
break; |
break; |
787 |
} |
} |
788 |
$td->push($obj); |
$td->add($obj); |
789 |
$td->set_collapse(); |
$td->set_collapse(); |
790 |
return $td; |
return $td; |
791 |
} |
} |
815 |
|
|
816 |
if (isset($this->_hidden_checkbox_items[$value])) { |
if (isset($this->_hidden_checkbox_items[$value])) { |
817 |
return TRUE; |
return TRUE; |
818 |
} |
} else { |
|
else { |
|
819 |
return FALSE; |
return FALSE; |
820 |
} |
} |
821 |
} |
} |
856 |
|
|
857 |
if ($this->show_actionbar()) { |
if ($this->show_actionbar()) { |
858 |
|
|
859 |
$table = html_table($this->get_width(),0,0,0,$this->_align); |
$table = html_table($this->get_width()); |
860 |
$table->set_class("datalist_actionbar"); |
$table->set_class("datalist_actionbar"); |
861 |
/*if ($this->show_outer_border()) { |
/*if ($this->show_outer_border()) { |
862 |
$table->set_tag_attribute("style", _CSS_BORDER_LEFT. |
$table->set_tag_attribute("style", _CSS_BORDER_LEFT. |
899 |
$td->set_tag_attribute("align", "left"); |
$td->set_tag_attribute("align", "left"); |
900 |
if ($this->_has_action_column("FIRST") && |
if ($this->_has_action_column("FIRST") && |
901 |
$this->_datasource->get_total_rows()) { |
$this->_datasource->get_total_rows()) { |
902 |
$td->push(html_img("/phphtmllib/images/widgets/arrow_right.gif")); |
$td->add(html_img($this->get_image_path()."/arrow_right.gif")); |
903 |
} |
} |
904 |
else { |
else { |
905 |
$td->push(" "); |
$td->add(" "); |
906 |
} |
} |
907 |
} |
} |
908 |
else { |
else { |
909 |
$td->set_tag_attribute("align", "right"); |
$td->set_tag_attribute("align", "right"); |
910 |
if ($this->_has_action_column("LAST") && |
if ($this->_has_action_column("LAST") && |
911 |
$this->_datasource->get_total_rows()) { |
$this->_datasource->get_total_rows()) { |
912 |
$td->push(html_img("/phphtmllib/images/widgets/arrow_left.gif")); |
$td->add(html_img($this->get_image_path()."/arrow_left.gif")); |
913 |
} |
} |
914 |
else { |
else { |
915 |
$td->push(" "); |
$td->add(" "); |
916 |
} |
} |
917 |
} |
} |
918 |
return $td; |
return $td; |
940 |
} |
} |
941 |
|
|
942 |
if ($flag && $this->_datasource->get_total_rows()) { |
if ($flag && $this->_datasource->get_total_rows()) { |
943 |
$td->push($this->actionbar_cell()); |
$td->add($this->actionbar_cell()); |
944 |
} |
} |
945 |
else { |
else { |
946 |
$td->push(" "); |
$td->add(" "); |
947 |
} |
} |
948 |
|
|
949 |
return $td; |
return $td; |
993 |
* @return mixed |
* @return mixed |
994 |
*/ |
*/ |
995 |
function _javascript() { |
function _javascript() { |
996 |
|
$js = ''; |
997 |
|
|
998 |
|
if ($this->_collapsable_search) { |
999 |
|
$js .= $this->_search_javascript(); |
1000 |
|
} |
1001 |
|
|
1002 |
|
|
1003 |
if ($this->_has_action_column("FIRST") || $this->_has_action_column("LAST")) { |
if ($this->_has_action_column("FIRST") || $this->_has_action_column("LAST")) { |
1004 |
$last = $this->_action_column["LAST"]["type"]; |
$last = isset($this->_action_column["LAST"]["type"]) ? $this->_action_column["LAST"]["type"] : ''; |
1005 |
$first = $this->_action_column["FIRST"]["type"]; |
$first = isset($this->_action_column["FIRST"]["type"]) ? $this->_action_column["FIRST"]["type"] : ''; |
1006 |
if ($last == "checkbox" || $first == "checkbox") { |
if ($last == "checkbox" || $first == "checkbox") { |
1007 |
return $this->_checkbox_javascript(); |
$js .= $this->_checkbox_javascript(); |
1008 |
} |
} |
1009 |
} |
} |
1010 |
else { |
|
1011 |
|
if (strlen($js) > 0) { |
1012 |
|
$script = new SCRIPTtag(array("language" => "Javascript")); |
1013 |
|
$script->add($js); |
1014 |
|
return $script; |
1015 |
|
} else { |
1016 |
return NULL; |
return NULL; |
1017 |
} |
} |
1018 |
} |
} |
1024 |
* @return SCRIPTtag |
* @return SCRIPTtag |
1025 |
*/ |
*/ |
1026 |
function _checkbox_javascript() { |
function _checkbox_javascript() { |
|
$script = new SCRIPTtag(array("language" => "Javascript")); |
|
|
|
|
1027 |
$var_name = $this->_vars["checkboxVar"]; |
$var_name = $this->_vars["checkboxVar"]; |
1028 |
|
|
1029 |
$js = "function mass(form) {\n"; |
$js = "function mass(form) {\n"; |
1030 |
$js .= " var i=0;\n"; |
$js .= " var i=0;\n"; |
1031 |
$js .= " var value=0;\n\n"; |
$js .= " var value=0;\n\n"; |
1032 |
$js .= " if (form.$var_name.checked) {\n"; |
$js .= " if (form.".$var_name.".checked) {\n"; |
1033 |
$js .= " value=1;\n"; |
$js .= " value=1;\n"; |
1034 |
$js .= " } else {\n"; |
$js .= " } else {\n"; |
1035 |
$js .= " value=0;\n"; |
$js .= " value=0;\n"; |
1036 |
$js .= " }\n\n"; |
$js .= " }\n\n"; |
1037 |
$js .= " for (i = 0; i < form.length; i++) {\n"; |
$js .= " for (i = 0; i < form.length; i++) {\n"; |
1038 |
$js .= " if (form.elements[i].name.substring(0, 8) == '$var_name' && !form.elements[i].disabled) {\n"; |
$js .= " if (form.elements[i].name.substring(0, ".strlen($var_name).") == '".$var_name."' && !form.elements[i].disabled) {\n"; |
1039 |
$js .= " form.elements[i].checked = value;\n"; |
$js .= " form.elements[i].checked = value;\n"; |
1040 |
$js .= " }\n"; |
$js .= " }\n"; |
1041 |
$js .= " }\n"; |
$js .= " }\n"; |
1042 |
$js .= "}\n"; |
$js .= "}\n"; |
1043 |
|
|
1044 |
$script->push($js); |
return $js; |
1045 |
return $script; |
} |
1046 |
|
|
1047 |
|
/** |
1048 |
|
* This function builds the JS needed for |
1049 |
|
* collapsable search |
1050 |
|
* |
1051 |
|
* @return string - js code |
1052 |
|
*/ |
1053 |
|
function _search_javascript() { |
1054 |
|
$js = "var tree_open = new Image();\n". |
1055 |
|
"tree_open.src = '/images/widgets/tree_open.gif';\n". |
1056 |
|
"var tree_closed = new Image();\n". |
1057 |
|
"tree_closed.src = '/images/widgets/tree_closed.gif';\n". |
1058 |
|
|
1059 |
|
"function toggle_tree(id) {\n". |
1060 |
|
"element = document.getElementById(id);\n". |
1061 |
|
"img = document.getElementById('i'+id);\n". |
1062 |
|
"if (!element) return;\n". |
1063 |
|
|
1064 |
|
"if (element.style.visibility=='visible' || element.style.visibility=='') {\n". |
1065 |
|
" element.style.visibility = 'hidden';\n". |
1066 |
|
" element.style.overflow = 'hidden';\n". |
1067 |
|
" element.style.height='1px';\n". |
1068 |
|
" img.src = tree_closed.src;\n". |
1069 |
|
|
1070 |
|
"document.forms['" . $this->get_form_name() . "']._search_tree_open.value=0;\n". |
1071 |
|
"}\n". |
1072 |
|
"else {\n". |
1073 |
|
" element.style.visibility = 'visible';\n". |
1074 |
|
" element.style.overflow = 'visible';\n". |
1075 |
|
" element.style.height='';\n". |
1076 |
|
" img.src = tree_open.src;\n". |
1077 |
|
"document.forms['" . $this->get_form_name() . "']._search_tree_open.value=1;\n". |
1078 |
|
"}\n". |
1079 |
|
"document.getElementById('l'+id).blur();\n". |
1080 |
|
"}"; |
1081 |
|
|
1082 |
|
return $js; |
1083 |
} |
} |
1084 |
|
|
1085 |
|
|