/[drupal]/contributions/modules/mlm/include/mlm.inc
ViewVC logotype

Diff of /contributions/modules/mlm/include/mlm.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.11, Sun Aug 23 23:06:28 2009 UTC revision 1.12, Wed Aug 26 23:03:36 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: mlm.inc,v 1.10 2009/08/10 01:57:46 vauxia Exp $  <?php // $Id: mlm.inc,v 1.11 2009/08/23 23:06:28 vauxia Exp $
2    
3  class mlm {  class mlm {
4    // The supported list types ( announcement, discussion, etc. ).    // The supported list types ( announcement, discussion, etc. ).
# Line 339  class mlm { Line 339  class mlm {
339      drupal_set_header('Content-Type: text/csv');      drupal_set_header('Content-Type: text/csv');
340      drupal_set_header('Content-Disposition: attachment; filename='. urlencode($this->title) .'-'. date('Y-m-d') .'.csv');      drupal_set_header('Content-Disposition: attachment; filename='. urlencode($this->title) .'-'. date('Y-m-d') .'.csv');
341      $res = $this->subscribers();      $res = $this->subscribers();
342    
343        $header = array();
344        foreach ($values['fields'] as $field) {
345          if ($field) $header[] = strtoupper($field);
346        }
347        echo join(',', $header) ."\n";
348    
349      while ($row = db_fetch_object($res)) {      while ($row = db_fetch_object($res)) {
       if (!isset($header)) {  
         $header = array();  
         foreach ($values['fields'] as $field) {  
           if ($field) $header[] = strtoupper($field);  
         }  
         echo join(',', $header) ."\n";  
       }  
350        $return = array();        $return = array();
351        foreach ($values['fields'] as $field) {        foreach ($values['fields'] as $field => $status) {
352          if ($field) $return[] = $row->$field;          if ($status) $return[] = $row->$field;
353        }        }
354        echo join(',', $return) ."\n";        echo join(',', $return) ."\n";
355      }      }
356        die;
357    }    }
358    
359    function _edit_form(&$form_state) {    function _edit_form(&$form_state) {

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.2