Commit 6d31bbd0 authored by Jérome Perrin's avatar Jérome Perrin

when displaying results, display the first *enabled* action

parent bfe42a06
......@@ -358,8 +358,21 @@
.allowPublicAcquisition("whoWantsToDisplayThisResult",
function (param_list) {
// Hey, I want to display some jIO document
// We'll display the result using the first enabled action
var action = "view", action_info, action_id;
for (action_id in portal_types.Output) {
if (portal_types.Output.hasOwnProperty(action_id)) {
action_info = portal_types.Output[action_id];
if ((action_info.condition === undefined) ||
(action_info.condition(this))) {
action = action_id;
break;
}
}
}
return this.aq_pleasePublishMyState({
action: "view",
action: action,
id: param_list[0],
result: param_list[1]
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment