# # # # update_reports_menu_labels() # # # This adds the labels to all reports menu items from reports but not to menu groups. # A report menu item actually has no editable label but the label is taken from # the linked report. The only reason we add the labels to the reports menu items # is that we need a true reports_menu state checksum, which wouldn't be possible # without the labels. # # This subroutine is used: # - upon profile import --> KHP-RC, add in import # - in profile setup # - in reports editor upon save # subroutine(update_reports_menu_labels( node reports_menu, node reports), ( # node statistics = profile{"statistics"}; # node reports = statistics{"reports"}; # node reports_menu = statistics{"reports_menu"}; node menu_item; string report_name; string report_label; foreach menu_item reports_menu ( if (menu_item?{"report"}) then ( # This is a menu item report_name = @menu_item{"report"}; # Get report label from report report_label = @(reports . "." . report_name . ".label"); # Set label in reports menu item set_subnode_value(menu_item, "label", report_label); ) else if (menu_item?{"items"}) then ( # This is a report group update_reports_menu_labels(menu_item{"items"}, reports); ); ); ));