I've a small problem. One one hand I'm using the function _all_fields() to select all fields that are available as
filters for the view module and present the list in a form.
function _all_fields() {
$allfields = _views_get_fields();
$fields = array();
foreach($allfields as $name => $field) {
$fields[$name] = $field['name'];
}
The array that I pass in the form looks like this :
node_data_field_safety_person.field_safety_person_nid => Node Reference: Safety Person (field_safety_person),
comments.subject => Comment: Subject
... and so on...
One the other hand I retrieve the result of the view as:
$view = views_get_view($view_name);
$view_result = views_build_view('items',$view,$args);
$view_items = $view_result['items'];
Now suppose that I want to select from the result array a particular field that was selected in the form above
with key comments.subject (for example)
It there a way of extracting from the _all_fields() array meaningful information to get the field that
is actually used in the result view ? For cck type I can easily get this information from
$array[content_field][field_name] but this doesn't work for other types as node, usernode and others.
Is there a way ?
Comments
Comment #1
somebodysysop commentedIf what you really want to accomplish is to create a view from which you can create a recipient list to send e-mails, take a look at this discussion: http://drupal.org/node/134931.
I've actually modified the submitted module so that it is currently functional.
I'm also working to add a schedule feature (using actions) to defer the mailing of emails to a later date. http://drupal.org/node/138061
I tried doing what it sound like you want to do: Storing and retrieving customized view, but just couldn't get that to work.
If you'd like the module I'm working on, I'll post it in the issue above shortly.
Comment #2
munga commentedI find a away of extracting this information. Actually it's kinda trivial...
and to retrive the result I use:
where recipient_view_field contains a pair generated by the _all_fields function.
This way on one side you can specify which field to use to build the recipient list
and on the other extract this information from the view.
Looking forward to try your module.
Comment #3
sunSorry, unfortunately this support request is way too specific. Please have a look at the issue queue - Views maintainers are buried already. You might want to try to get further support at http://drupal.org/support.