Closed (fixed)
Project:
Webform View Reference Component
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2010 at 20:07 UTC
Updated:
1 Feb 2013 at 16:26 UTC
I was poking around the code and I thought if you could use maybe views_get_result_view() and maybe take the first 2 values as key => label perhaps?
I tried this out on my local box and got a couple term/node views to work that way:
function _webform_viewselect_options($view,$args = NULL) {
$options = array();
$view_results = module_invoke('views', 'get_view_result', $view, NULL);
foreach ($view_results as $result) {
reset($result);
$key = current($result);
$label = next($result);
$options[$key] = check_plain($label);
}
return $options;
}
I couldn't get the args deal to work, I think you need to be able to select the display id or key it in on the configure page. If you could do that and it could support any view type I think you'd have something pretty good.
| Comment | File | Size | Author |
|---|---|---|---|
| patch.txt | 4.09 KB | drupalninja99 |
Comments
Comment #1
drupalninja99 commentedHello?
Comment #2
freakalis commentedNodes, terms, and users are supported in beta3.