[% PROCESS inputs; PROCESS utils; BLOCK widget_selector; logme("widget_selector called for table $tableid"); linkid = tableid; tableid = INCLUDE find_table_id id=tableid; choose_base_cols = 0; # if we got some columns, use them. if not, get all non-primary columns IF ! columns; columns = []; choose_base_cols = 1; columns_xpath = '/reporter/tables/table[@id="' _ tableid _ '"]/fields/field[not(@primary) or @primary!="true"]'; FOR c = config.findnodes(columns_xpath); link_text_xpath = "../../links/link[@field='" _ c.findvalue('@name') _ "']"; NEXT IF c.findnodes(link_text_xpath); columns.push(c); END; logme("widget_selector had to grab columns for table $tableid linked from $linkid"); END; column_input_type="checkbox"; IF force && ! choose_base_cols; column_input_type="hidden"; END; FOR column = columns; column_name=column.findvalue('@name'); WRAPPER html/row; WRAPPER html/cell valign='top' align='right'; # checkbox for column filter here ... INCLUDE $column_input_type name="filter:$linkid" value=column_name checked=0; column.findvalue('label'); END; WRAPPER html/cell; col_widget_fams_xpath = '/reporter/widgets/widget-family[@datatype="' _ column.findvalue('@datatype') _ '"]'; IF column.findnodes('@widget-family'); col_widget_fams_xpath = '/reporter/widgets/widget-family[@name="' _ column.findvalue('@widget-family') _ '"]'; END; logme("finding widget families using $col_widget_fams_xpath"); widget_fams = config.findnodes(col_widget_fams_xpath); ''; END; END; END; END; %]