[development] Modify Views CSV Export

Marolijo - Pol maresma marolijo at yahoo.es
Wed Mar 12 14:18:52 UTC 2008


Hello, I need to modify this function to allow it to export imagefield as a
full path, not full <img src=
> tag.
How can I filter the imagefield fields to do something like
If (fieldtype=imagefield){
	$value = $field ['filepath']
}else{
	...
}

Thank's!!!

////////////////////////////////////

  foreach ($nodes as $node) {
    $values = array();
    foreach ($view->field as $field) {
	if ($fields[$field['id']]['visible'] !== false) {
        $value = views_theme_field('views_handle_field',
$field['queryname'], $fields, $field, $node, $view);        
	    $value = preg_replace('/<\/?(a|span|li|ul|div) ?.*?>/', '',
$value); // strip 'a' and 'span' tags        			
        $value = str_replace(array("\r", "\n", ','), ' ', $value); // strip
line breaks and commas
        $value = str_replace('"', '""', $value); // escape " characters
        $value = decode_entities($value);
        $values[] = '"' . $value . '"';

      }      
    }
    $output .= implode(',', $values) . "\r\n";
  }


Pol Maresma / pol at polnetwork.com 
PolNetwork.com / Serveis d'Internet
msn: marolijo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20080312/156f46da/attachment.htm 


More information about the development mailing list