@@ -562,16 +562,32 @@ function form_actions() {
562
562
563
563
if (cacti_sizeof ($ trees )) {
564
564
foreach ($ trees as $ tree ) {
565
+ $ branches = db_fetch_assoc_prepared ('SELECT id, title
566
+ FROM graph_tree_items
567
+ WHERE graph_tree_id = ?
568
+ AND host_id = 0
569
+ AND local_graph_id = 0
570
+ AND parent = 0
571
+ ORDER BY parent, position ' ,
572
+ array ($ tree ['id ' ]));
573
+
574
+ if (cacti_sizeof ($ branches )) {
575
+ $ branches = array_rekey ($ branches , 'id ' , 'title ' );
576
+ } else {
577
+ $ branches [0 ] = '[root] ' ;
578
+ }
579
+
565
580
$ form_data ['options ' ]['tr_ ' . $ tree ['id ' ]] = [
566
581
'smessage ' => __esc ('Click \'Continue \' to Place the following Device on Tree %s. ' , $ tree ['name ' ]),
567
- 'pmessage ' => __esc ('Click \'Continue \' to Duplicate following Devices on Tree %s. ' , $ tree ['name ' ]),
582
+ 'pmessage ' => __esc ('Click \'Continue \' to Place the following Devices on Tree %s. ' , $ tree ['name ' ]),
568
583
'scont ' => __ ('Place Device on Tree ' ),
569
584
'pcont ' => __ ('Place Devices on Tree ' ),
570
585
'extra ' => [
571
586
'tree_item_id ' => [
572
- 'method ' => 'drop_branch ' ,
587
+ 'method ' => 'drop_array ' ,
573
588
'title ' => __ ('Destination Branch ' ),
574
- 'id ' => $ tree ['id ' ]
589
+ 'array ' => $ branches ,
590
+ 'default ' => array_key_first ($ branches ),
575
591
]
576
592
],
577
593
'eaction ' => 'tree_id ' ,
0 commit comments