amalgame/commit

use input_item//3 hook to add special class to input field that should be pre-filled with concept from the concept browser

authorJacco van Ossenbruggen
Mon Aug 18 09:36:12 2014 +0200
committerJacco van Ossenbruggen
Mon Aug 18 09:36:12 2014 +0200
commit24cfc93e9058bd6472c742606f800ed41c648f14
tree10ef0983a95510440ad3e2249cb6370083b623be
parentcb9f053059c97e006ead5acfaaaf3988ac43e007
Diff style: patch stat
diff --git a/lib/ag_modules/subtree_select.pl b/lib/ag_modules/subtree_select.pl
index fe78753..8f6cd54 100644
--- a/lib/ag_modules/subtree_select.pl
+++ b/lib/ag_modules/subtree_select.pl
@@ -1,5 +1,9 @@
 :- module(subtree_select, []).
 
+:- use_module(library(option)).
+:- use_module(library(http/html_write)).
+:- use_module(components(amalgame/util)). % for the amalgame:input_item//3 multifile hook
+
 :- public amalgame_module/1.
 :- public parameter/4.
 :- public selecter/3.
@@ -20,3 +24,9 @@ selecter(Scheme, and((Scheme), subtree(Parent)), Options) :-
 selecter(Scheme, and((Scheme), not(subtree(Parent))), Options) :-
 	option(mode(remove), Options),
 	option(parent(Parent), Options).
+
+% Add class 'concept' to the input form so we can use the values from
+% the concept browser to assist the user in filling in the form:
+
+amalgame:input_item(uri, Value, parent) -->
+	html(input([name(parent), class(concept), value(Value)])).