/[drupal]/contributions/modules/mmb/mmb.module
ViewVC logotype

Diff of /contributions/modules/mmb/mmb.module

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

revision 1.13, Fri Aug 17 10:21:11 2007 UTC revision 1.14, Fri Aug 17 20:10:38 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* $Id: mmb.module,v 1.12 2007/08/17 06:13:56 sanduhrs Exp $ */  /* $Id: mmb.module,v 1.13 2007/08/17 10:21:11 sanduhrs Exp $ */
3    
4  /**  /**
5   * @file   * @file
# Line 41  function mmb_mailhandler($node, $result, Line 41  function mmb_mailhandler($node, $result,
41    //Handle different node types    //Handle different node types
42    switch ($node->type) {    switch ($node->type) {
43      case 'image':      case 'image':
44          if (!module_exists('image')) {
45            watchdog('mmb', t('Install and setup !image to post image files.', array('!image' => l('image.module',  'http://drupal.org/project/image', array(), NULL, NULL, TRUE))), WATCHDOG_WARNING);
46            break;
47          }
48        //Get the first attached image file        //Get the first attached image file
49        foreach($node->files as $key => $file) {        foreach($node->files as $key => $file) {
50          $mime = explode('/', $file['filemime']);          $mime = explode('/', $file['filemime']);
# Line 48  function mmb_mailhandler($node, $result, Line 52  function mmb_mailhandler($node, $result,
52            //Prepare for image.module            //Prepare for image.module
53            $node->images[IMAGE_ORIGINAL] = $node->files[$key]['filepath'];            $node->images[IMAGE_ORIGINAL] = $node->files[$key]['filepath'];
54            break;            break;
55          }          }
56        }        }
57        break;        break;
58      case 'audio':      case 'audio':
59        //TODO: audio attachments        if (!module_exists('audio') OR !module_exists('audio_getid3')) {
60            watchdog('mmb', t('Install and setup !audio and !audio_getid3 to post audio files.', array('!audio' => l('audio.module',  'http://drupal.org/project/audio', array(), NULL, NULL, TRUE), '!audio_getid3' => l('audio_getid3.module',  'http://drupal.org/project/audio', array(), NULL, NULL, TRUE),)), WATCHDOG_WARNING);
61            break;
62          }
63          //Get the first attached audio file
64          foreach($node->files as $key => $file) {
65            $mime = explode('/', $file['filemime']);
66            if (strtolower($mime[0]) == 'audio') {
67              //Prepare for audio.module
68              $node = audio_api_insert($node->files[$key]['filepath'], $title_format = NULL, $tags = array());
69              //TODO: Check what was replaced by audio_api_insert and restore it
70              break;
71            }
72          }
73        break;        break;
74      case 'video':      case 'video':
75        //TODO: video attachments        //TODO: video attachments

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.2