Index: audio.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/audio/audio.module,v
retrieving revision 1.29
diff -u -r1.29 audio.module
--- audio.module	4 Dec 2005 02:44:23 -0000	1.29
+++ audio.module	6 Dec 2005 04:06:06 -0000
@@ -41,8 +41,8 @@
 /**
  * Implementation of hook_node_name
  */
-function audio_node_name() {
-  return t('audio');
+function audio_node_info() {
+  return array('audio' => array('name' => t('audio'), 'base' => 'audio'));
 }
 
 /**
@@ -77,11 +77,42 @@
  */
 function audio_settings() {
   _audio_check_settings();
-  $output.= form_hidden('audio_updated', time());
-  $paths .= form_textfield(t('Path to uploaded audio files'), 'audio_default_path', variable_get('audio_default_path', 'audio'), 30, 255, t('Subdirectory in the directory "%dir" where audio files will be stored.', array('%dir' => '<em>'. variable_get('file_directory_path', 'files') .'/</em>')));
-  $paths .= form_textfield(t('Path to the \'getID3\' folder'), 'audio_getid3_path', variable_get('audio_getid3_path', drupal_get_path('module', 'audio').'/getid3/'), 30, 255, t('The path to the \'getid3\' library folder. (include trailing slash.)'));
-  $output.= form_group(t('File paths'), $paths);
-  return $output;
+
+  $form['audio_updated'] = array(
+    '#type' => 'hidden',
+    '#value' => time()
+  );
+
+  $form[$paths] = array(
+    '#type' => 'fieldset',
+    '#title' => t('File paths')
+  );
+  $form[$paths]['audio_default_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Path to uploaded audio files'),
+    '#default_value' => variable_get('audio_default_path', 'audio'),
+    '#size' => 30,
+    '#maxlength' => 255,
+    '#description' => t('Subdirectory in the directory "%dir" where audio files will be stored.', array('%dir' => '<em>'. variable_get('file_directory_path', 'files') .'/</em>'))
+  );
+  $form[$paths]['audio_getid3_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Path to the \'getID3\' folder'),
+    '#default_value' => variable_get('audio_getid3_path', drupal_get_path('module', 'audio').'/getid3/'),
+    '#size' => 30,
+    '#maxlength' => 255,
+    '#description' => t('The path to the \'getid3\' library folder. (include trailing slash.)')
+  );
+  return $form;
+
+/* //TODO: check for the library
+  // check for id3 library
+  $id3_path = variable_get('audio_getid3_path', drupal_get_path('module', 'audio').'/getid3/');
+  if (!file_exists($id3_path.'getid3.php')) {
+    form_set_error('', t('The audio module requires that getId3 be installed.'));
+  }
+*/
+
 }
 
 /**
@@ -128,8 +159,9 @@
  */
 function audio_link($type, $node, $main = 0) {
   $links = array();
-  if ($type == 'node' && $node->type == 'audio' && _is_downloadable($node->audio['fid']))
+  if ($type == 'node' && $node->type == 'audio' && _is_downloadable($node->audio['fid'])) {
     $links[] = l(t('download audio file'), 'audio/download/'.$node->nid, NULL);
+  }
   return $links;
 }
 
@@ -143,14 +175,18 @@
       //NOTE: RSS only allows one enclosure per item
       if ($node->type == 'audio' && $node->audio['fid']) {
         $node->teaser = db_result(db_query("SELECT body FROM {node} WHERE nid=%d", $node->nid));
-      $file = db_fetch_object(db_query("SELECT * FROM {files} WHERE nid=%d", $node->nid));
-
-      return array(array('key' => 'enclosure',
-		'attributes' => array('url' => $GLOBALS['base_url'].'/'.variable_get('file_directory_path', 'files')
-																			.'/'.variable_get('audio_default_path', 'audio')
-																			.'/'. rawurlencode($file->filename),
-      						 'length' => $file->filesize,
-						         'type' => $file->filemime)));
+        $file = db_fetch_object(db_query("SELECT * FROM {files} WHERE nid=%d", $node->nid));
+        $path = $GLOBALS['base_url']
+          .'/'. variable_get('file_directory_path', 'files')
+          .'/'. variable_get('audio_default_path', 'audio')
+          .'/'. rawurlencode($file->filename);
+        // package it for return
+        $item['key'] = 'enclosure';
+        $item['attributes'] = array(
+          'url' => $path,
+          'length' => $file->filesize,
+          'type' => $file->filemime);
+        return $item;
       }
     break;
   }
@@ -215,56 +251,145 @@
 /**
  * Implementation of hook_form
  */
-function audio_form(&$node, &$param) {
+function audio_form(&$node) {
   _audio_check_settings();
   
   
   // This sets the form param reference.
-  $param['options'] = array("enctype" => "multipart/form-data",  "name" => "audio_forms");
+  $form['#attributes'] = array('enctype' => 'multipart/form-data');
 
-  
-  $output .= form_textarea(t('Description'), 'body', $node->body, 60, 20, '', NULL, TRUE);
-  
-  
-  $output .= form_hidden('audio_file_tmp', _is_set_or($node->audio['filepath'], $node->audio_file_tmp->filepath));
-  
-  // Taxonomy select form
-  if (module_exist('taxonomy'))
-    $output .= implode('', taxonomy_node_form('audio', $node));
+  $form['body'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Description'),
+    '#default_value' => $node->body,
+    '#cols' => 60,
+    '#rows' => 5,
+    '#description' => '',
+    '#attributes' => NULL,
+    '#required' => TRUE
+  );
 
+  //make this required... only if the file has not been uploaded..
+  $form['file'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Audio File'),
+    '#weight' => -14,
+  );
   //show the user their current file, if one exists..
-  if ($node->audio['title'] || $node->audio_file_tmp->filename){
-       $file_output.= form_item(t('Current Audio File'),
-        t("Your current audio file is:")."<b>" . _is_set_or($node->audio['title'], 
-       $node->audio_file_tmp->filename) . 
-       "</b><br/>".t("Use the 'browse' button below to upload a different audio file, or do nothing to keep it the same."));
+  if ($node->audio['title'] || $node->file->filepath){
+    $form['file']['current'] = array(
+      '#type' => 'item',
+      '#title' => t('Current Audio File'),
+      '#value' => t("The file <b>%filename</b> is attached to this node.", array('%filename' => _is_set_or($node->audio['title'], $node->audio_file_tmp->filename))),
+      '#description' => t("Use the 'browse' button below to upload a different audio file, or do nothing to keep it the same."),
+    );
+    // for validation
+    $form['audio_current_filepath'] = array(
+      '#type' => 'value',
+      '#value' => $node->file->filepath,
+    );
+  }
+  else {
+    $form['file']['current'] = array(
+      '#type' => 'item',
+      '#title' => t('Current Audio File'),
+      '#value' => t('No file is attached.'),
+      '#description' => t("Use the 'browse' button below to select an audio file."),
+    );
   }
   
-  //make this required... only if the file has not been uploaded..
-  $file_output .= form_file(t('Audio File'), 'audio_file', 50, t('Click "Browse..." to select an audio file to upload.'), TRUE);
-  $file_output .= form_checkbox(t('Allow file downloads.'), 'audio][downloadable', 1, _is_set_or($node->audio['downloadable'],1) , t('If checked, people will be able to download this audio file on to their own computer.'), NULL, FALSE);
-  $output .= form_group(t('Audio File'), $file_output); 
-  
+  $form['file']['audio_file'] = array(
+    '#type' => 'file',
+    '#title' => t('New Audio File'),
+    '#size' => 50,
+    '#description' => t('Click "Browse..." to select an audio file to upload.'),
+    '#attributes' => TRUE
+  );
+
   //show all current file metadata, if an audio file has been uploaded, or is being previewed...
-  if (!empty($node->audio)) {
-    $audio_output .= form_textfield(t("Song Title"), 'audio][title', $node->audio['title'], 40, 80);
-    $audio_output .= form_textfield(t("Artist"), 'audio][artist', $node->audio['artist'], 40, 80);
-    $audio_output .= form_textfield(t("Album"), 'audio][album', $node->audio['album'], 40, 80);
-    $audio_output .= form_textfield(t("Year"), 'audio][year', $node->audio['year'], 10, 15);
-    $audio_output .= form_textfield(t("Track Number"), 'audio][track', $node->audio['track'], 5, 10,t('Enter a single number here. "1" means that this is the first track on the album.'));
-    $audio_output .= form_textfield(t("Genre"), 'audio][genre', $node->audio['genre'], 20, 40);
+  if (isset($node->audio)) {
+    $form['audio'] = array(
+      '#type' => 'fieldset',
+      '#title' => t("Audio File Information"),
+      '#tree' => TRUE,
+      '#weight' => -15,
+    );
+    $form['audio']['downloadable'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Allow file downloads.'),
+      '#return_value' => 1,
+      '#default_value' => _is_set_or($node->audio['downloadable'],1),
+      '#description' => t('If checked, people will be able to download this audio file on to their own computer.'),
+      '#attributes' => NULL,
+      '#required' => FALSE
+    );
+    $form['audio']['title'] = array(
+      '#type' => 'textfield',
+      '#title' => t("Song Title"),
+      '#default_value' => $node->audio['title'],
+      '#size' => 40,
+      '#maxlength' => 80
+    );
+    $form['audio']['artist'] = array(
+      '#type' => 'textfield',
+      '#title' => t("Artist"),
+      '#default_value' => $node->audio['artist'],
+      '#size' => 40,
+      '#maxlength' => 80
+    );
+    $form['audio']['album'] = array(
+      '#type' => 'textfield',
+      '#title' => t("Album"),
+      '#default_value' => $node->audio['album'],
+      '#size' => 40,
+      '#maxlength' => 80
+    );
+    $form['audio']['year'] = array(
+      '#type' => 'textfield',
+      '#title' => t("Year"),
+      '#default_value' => $node->audio['year'],
+      '#size' => 10,
+      '#maxlength' => 15
+    );
+    $form['audio']['track'] = array(
+      '#type' => 'textfield',
+      '#title' => t("Track Number"),
+      '#default_value' => $node->audio['track'],
+      '#size' => 5,
+      '#maxlength' => 10,
+      '#description' => t('Enter a single number here. "1" means that this is the first track on the album.')
+    );
+    $form['audio']['genre'] = array(
+      '#type' => 'textfield',
+      '#title' => t("Genre"),
+      '#default_value' => $node->audio['genre'],
+      '#size' => 20,
+      '#maxlength' => 40
+    );
+  }
+  return $form;
+}
 
-    $output .= form_group(t("Audio File Information"), $audio_output);
+
+
+
+function audio_execute(&$node) {
+  // Check for a new file upload.
+  if ($file = file_check_upload('audio_file')) {
+    $node->file = $file;
+    $node->audio = audio_get_info($file->filepath);
+    $node->audio_tmp_file = TRUE;
+    _copy_fileinfo($node, $file);
   }
-  return $output;
 }
 
 /**
  * Implementation of hook_view
  */
-function audio_view(&$node, $main = 0, $page = 0) {
-  $node = node_prepare($node, $main);
-  $node->teaser = theme('audio_display_teaser', $node);
+function audio_view(&$node, $teaser = FALSE, $page = FALSE) {
+  $node = node_prepare($node, $teaser);
+  $node->title = $node->audio['title'];
+  $node->teaser = theme('audio_display_teaser', $teaser);
   $node->body = audio_display($node) . $node->body;
 }
 
@@ -393,28 +518,41 @@
  * Implementation of hook_user().
  */
 function audio_user($type, &$edit, &$user) {
-  if ($type == 'view') { //&& user_access('edit own blog', $user) //Not needed??...
-    return array(t('History') => form_item(t('Audio'), l(t('listen to the most recent audio files added'), "audio/$user->uid", array('title' => t("Listen to %username's latest audio files.", array('%username' => $user->name))))));
+  if ($type == 'view') {
+    // TODO: this isn't showing up for me.
+    $ret[t('History')] = l(
+      t('listen to the most recently added audio files'),
+      	"audio/$user->uid",
+      	array('title' => t("Listen to %username's latest audio files.", array('%username' => $user->name_))
+      )
+    );
+    return $ret;
   }
 }
 
 /**
  * Implementation of hook_load
  */
-function audio_load(&$node) {
-  $fid = db_result(db_query("SELECT fid FROM {files} WHERE nid=%d limit 1", $node->nid));
-  if ($fid){
+function audio_load($node) {
+  $ret = array();
+  
+  if ($file = db_fetch_object(db_query("SELECT * FROM {files} WHERE nid=%d limit 1", $node->nid))) {
     //If a file has been uploaded and is located in the file table...
-    $node->audio = db_fetch_array(db_query("SELECT * FROM {audio_node_metadata} WHERE fid=%d", $fid));    
-        
+    $audio = db_fetch_array(db_query("SELECT * FROM {audio_node_metadata} WHERE fid=%d", $file->fid));
+
     $params->url = url('audio/play/'.$node->nid, NULL, NULL, TRUE);
     $params->title = $node->audio['title'];
     //if there is no theme function that provides a player of this file type, use the default.
     //The defualt just shows a bare link to the file...
-    if (!($player = theme($node->audio['fileformat'] . '_player', $params)))
+    if (!($player = theme($audio['fileformat'] . '_player', $params))) {
       $player = theme('audio_player', $params);
-    $node->audio['player'] = $player;
+    }
+    $audio['player'] = $player;
+    
+    $ret['audio'] = $audio;
+    $ret['file'] = $file;
   }
+  return $ret;
 }
 
 /**
@@ -437,9 +575,9 @@
  */
 function theme_audio_player($params) {
   $output = '<span class="audio">';
-    $output .= '<a href="'. $params->url .'">'.t("Click here").'</a>';
-    $output .= "</span>\n";
-    return $output;
+  $output .= '<a href="'. $params->url .'">'.t("Click here").'</a>';
+  $output .= "</span>\n";
+  return $output;
 }
 
 
@@ -447,23 +585,20 @@
  * Implementation of hook_insert
  */
 function audio_insert(&$node) {
-  $dest = variable_get('audio_default_path', 'audio')."/". basename($node->audio['filepath']);
- 
-  if (file_copy($node->audio['filepath'], $dest)) {
-
+  if ($file = file_save_upload('audio_file', variable_get('audio_default_path', 'audio'))) {
     $fid = db_next_id('{files}_fid');
     //insert into file table...
-    db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize, list) VALUES (%d, %d, '%s', '%s', '%s', '%s', %d)",
-             $fid, $node->nid, $node->audio['filename'], $node->audio['filepath'], 
-             $node->audio['filemime'], $node->audio['filesize'], 0);
-    
+    db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize, list)
+      VALUES (%d, %d, '%s', '%s', '%s', '%s', %d)",
+      $fid, $node->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize, 0);
+
     //insert into audio_node table
-    db_query("INSERT INTO {audio_node_metadata} (fid, playcount, fileformat, bitrate, sample_rate, 
-               playtime_seconds, title, artist, album, year, track, genre, comment, downloadable) 
-            VALUES (%d, %d, '%s', %f, %f, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', %d)",
-             $fid, 0, $node->audio['fileformat'], $node->audio['bitrate'], $node->audio['sample_rate'], $node->audio['playtime_seconds'], 
-             $node->audio['title'], $node->audio['artist'], $node->audio['album'], $node->audio['year'], 
-             $node->audio['track'], $node->audio['genre'], $node->audio['comment'], $node->audio['downloadable']);
+    db_query("INSERT INTO {audio_node_metadata} (fid, playcount, fileformat, bitrate, sample_rate,
+      playtime_seconds, title, artist, album, year, track, genre, comment, downloadable)
+      VALUES (%d, %d, '%s', %f, %f, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', %d)",
+      $fid, 0, $node->audio['fileformat'], $node->audio['bitrate'], $node->audio['sample_rate'], $node->audio['playtime_seconds'],
+      $node->audio['title'], $node->audio['artist'], $node->audio['album'], $node->audio['year'],
+      $node->audio['track'], $node->audio['genre'], $node->audio['comment'], $node->audio['downloadable']);
   }
   return $node->nid;
 }
@@ -547,68 +682,48 @@
 function audio_update(&$node) {
   //if a new file has been uploaded, delete all meta information and read in new info from file...
   if ($node->audio_file_tmp) {
-    $file = db_fetch_object(db_query("SELECT * FROM {files} WHERE nid=%d", $node->nid));
-    file_delete(file_create_path($file->filepath));
-        //delete from the files table...
-        db_query("DELETE FROM {files} WHERE filename='%s' AND nid=%d", $file->filename, $node->nid);
-        //delete from the audio_node_meta table...
-        db_query("DELETE FROM {audio_node_metadata} WHERE fid=%d", $file->fid);
-
-        //insert the new audio file...
-        audio_insert($node);
-    } else {
-      $fid = db_result(db_query("SELECT fid FROM {files} WHERE nid=%d limit 1", $node->nid));
-    //no new file.. Just updating the meta fields...        
-
-    db_query("UPDATE {audio_node_metadata} SET title = '%s',
-                artist = '%s', album = '%s', year = '%s', track =%d, genre = '%s', 
-                downloadable = %d WHERE fid = %d", 
-               $node->audio['title'], $node->audio['artist'], $node->audio['album'], 
-                $node->audio['year'], $node->audio['track'], $node->audio['genre'], 
-                $node->audio['downloadable'], $fid);
-        
-        //update ID3 info in the actual file...
-        audio_write_ID3tags($node);
-    }
+    // delete the old node...
+    audio_delete($node);
+    // insert a new one...
+    audio_insert($node);
+  }
+  else {
+    $fid = db_result(db_query("SELECT fid FROM {files} WHERE nid=%d limit 1", $node->nid));
+    //  no new file.. Just updating the meta fields...
+    db_query("UPDATE {audio_node_metadata} SET title = '%s', artist = '%s',
+      album = '%s', year = '%s', track =%d, genre = '%s', downloadable = %d WHERE fid = %d",
+      $node->audio['title'], $node->audio['artist'], $node->audio['album'],
+      $node->audio['year'], $node->audio['track'], $node->audio['genre'],
+      $node->audio['downloadable'], $fid);
+
+    //update ID3 info in the actual file...
+    audio_write_ID3tags($node);
+  }
 }
 
 /**
  * Implementation of hook_validate
  */
 function audio_validate(&$node) {
+  // Check for a new file upload.
+  if ($file = file_check_upload('audio_file')) {
+    $node->file = $file;
+  }
 
-  if (!empty($_FILES['edit']['name']['audio_file'])) {
-
-    $file = file_check_upload('audio_file');
-    if (!empty($file)) {
-
-      $file = file_save_upload($file);
-      $node->audio = audio_get_info($file->filepath);
-
-      if (!empty($node->audio['error'])){
-        form_set_error('audio_file', t('Uploaded file is not an audio file'));
-      } else {
-
-        $node->audio_file_tmp = $file;
-        _copy_fileinfo($node, $file);
-        
-        //add "downloadable" field to the audio array. This field is a bit of a lost dog since
-        //it is the only field in the $node->audio array that is set in the form, rather then
-        //by the getID3 function...
-        $node->audio['downloadable'] = $_POST['edit']['audio']['downloadable'];
-      }
+  // Make sure there is an upload or an existing file.
+  if (!$file) {
+    if (!file_exists($node->audio_current_filepath)) {
+      form_set_error('audio_file', t('A file must be provided.'));
     }
   }
-  elseif (isset($_POST['edit']['audio']) || $_POST['op'] == "Preview") {
-    $node->audio = array_merge(audio_get_info($_POST['edit']['audio_file_tmp']), $_POST['edit']['audio']);
-    
-    if ($_SESSION['file_uploads']){
-      _copy_fileinfo($node, $_SESSION['file_uploads']['audio_file']);
+  else {
+    $node->audio = audio_get_info($file->filepath);
+    if (!empty($node->audio['error'])) {
+      form_set_error('audio_file', 'Could not load the MP3.');
+    }
+    else {
+      $node->audio_file_tmp = $file;
     }
-  }
-  
-  if ($_POST['edit']['audio_file_tmp']){
-    $node->audio_file_tmp = $_POST['edit']['audio_file_tmp'];
   }
 }
 
@@ -687,46 +802,50 @@
   // NOTE: Because of their wanky includes, this file must be included
   // AFTER an instance of the getID3 class is instantiated.
   require_once($id3_path.'write.php');
-    $tagwriter = new getid3_writetags;
-    $tagwriter->filename       = file_create_path($node->files[$fid]->filepath); //needs to be full path
-    $tagwriter->tagformats     = array('id3v1', 'id3v2.3');
-    
-    // set various options (optional)
-    $tagwriter->overwrite_tags = true;
-    $tagwriter->tag_encoding   = 'UTF-8';
-    $tagwriter->remove_other_tags = true;
-                    
-    //populate data array. Ugly mapping, but what can one do?...
-    $tag_data['title'][]   = $node->audio['title'];
-    $tag_data['artist'][]  = $node->audio['artist'];
-    $tag_data['album'][]   = $node->audio['album'];
-    $tag_data['year'][]    = $node->audio['year'];
-    $tag_data['genre'][]   = $node->audio['genre'];
-    $tag_data['comment'][] = $node->audio['comment'];
-    $tag_data['track'][]   = $node->audio['track'];
-    $tagwriter->tag_data = $tag_data;
-    
-    // write tags
-    //TODO: error handling!....
-    if ($tagwriter->WriteTags()) {
-        //echo 'Successfully wrote tags<br>';
-        if (!empty($tagwriter->warnings)) {
-            //echo 'There were some warnings:<br>'.implode('<br><br>', $tagwriter->warnings);
-        }
-    } else {
-        //echo 'Failed to write tags!<br>'.implode('<br><br>', $tagwriter->errors);
-    }
+  $tagwriter = new getid3_writetags;
+  
+  $tagwriter->filename       = file_create_path($node->files[$fid]->filepath); //needs to be full path
+  $tagwriter->tagformats     = array('id3v1', 'id3v2.3');
 
+  // set various options (optional)
+  $tagwriter->overwrite_tags = true;
+  $tagwriter->tag_encoding   = 'UTF-8';
+  $tagwriter->remove_other_tags = true;
+
+  //populate data array. Ugly mapping, but what can one do?...
+  $tag_data['title'][]   = $node->audio['title'];
+  $tag_data['artist'][]  = $node->audio['artist'];
+  $tag_data['album'][]   = $node->audio['album'];
+  $tag_data['year'][]    = $node->audio['year'];
+  $tag_data['genre'][]   = $node->audio['genre'];
+  $tag_data['comment'][] = $node->audio['comment'];
+  $tag_data['track'][]   = $node->audio['track'];
+  $tagwriter->tag_data = $tag_data;
+
+  // write tags
+  //TODO: error handling!....
+  if ($tagwriter->WriteTags()) {
+      //echo 'Successfully wrote tags<br>';
+      if (!empty($tagwriter->warnings)) {
+        //echo 'There were some warnings:<br>'.implode('<br><br>', $tagwriter->warnings);
+      }
+  } else {
+      //echo 'Failed to write tags!<br>'.implode('<br><br>', $tagwriter->errors);
+  }
 }
 
 /**
  * Implementation of hook_delete.
  */
 function audio_delete($node) {
-    file_delete(file_create_path($node->audio['filepath']));
-    db_query("DELETE FROM {files} WHERE filename='%s' AND nid=%d", $label, $node->nid);
-    //delete from the audio_node_meta table...
-    db_query("DELETE FROM {audio_node_metadata} WHERE fid=%d", $node->audio['fid']);
+  // load the existing info
+  $file = db_fetch_object(db_query("SELECT * FROM {files} WHERE nid=%d", $node->nid));
+  // delete the file
+  file_delete(file_create_path($file->filepath));
+  //delete record in the files table...
+  db_query("DELETE FROM {files} WHERE filename='%s' AND nid=%d", $file->filename, $node->nid);
+  //delete record in the audio_node_meta table...
+  db_query("DELETE FROM {audio_node_metadata} WHERE fid=%d", $file->fid);
 }
 
 /**
@@ -770,7 +889,8 @@
   return l($node->audio['title'], 'node/'.$node->nid) . $node->audio['player']. "<br/>";
 }
 
-/* returns nodes (or html) representation of audio files specified by taxonomy id,
+/**
+ * returns nodes (or html) representation of audio files specified by taxonomy id,
  * or all audio files, if no tid is present...
  */
 function audio_get_files($tid = NULL, $as_html = TRUE){

