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

Diff of /contributions/modules/transcription/transcription.module

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

revision 1.9, Wed Nov 19 17:14:37 2008 UTC revision 1.10, Wed Nov 19 19:20:44 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: transcription.module,v 1.8 2008/11/12 15:14:55 grndlvl Exp $  // $Id: transcription.module,v 1.9 2008/11/19 17:14:37 grndlvl Exp $
3    
4  // Initial code by Jonathan DeLaigle (grndlvl).  // Initial code by Jonathan DeLaigle (grndlvl).
5  // Modified by Aaron Winborn for the Media Transcriptions module.  // Modified by Aaron Winborn for the Media Transcriptions module.
# Line 18  function transcription_menu($maycache) { Line 18  function transcription_menu($maycache) {
18      if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'transcription' && !is_null(arg(3))) {      if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'transcription' && !is_null(arg(3))) {
19        $node = node_load(arg(1));        $node = node_load(arg(1));
20        if ($node->nid) {        if ($node->nid) {
21          $items[] = array('path' => 'node/'. arg(1) .'/transcription/'. arg(3), 'title' => t('View'),          $items[] = array('path' => 'node/'. arg(1) .'/transcription/'. arg(3), 'title' => t('Transcription'),
22            'callback' => 'transcription_handler',            'callback' => 'transcription_handler',
23            'callback arguments' => array($node, arg(3)),            'callback arguments' => array($node, arg(3)),
24            'access' => node_access('view', $node),            'access' => node_access('view', $node),
# Line 40  function transcription_handler($node, $t Line 40  function transcription_handler($node, $t
40        break;        break;
41      }      }
42    }    }
43      if (!empty($transcription_field)) {
44        $handlers = module_invoke_all('transcription_type', $type, $transcription_field, $node);
45        if (empty($handlers[$type])) {
46          $default_handler = transcription_default_type($type, $transcription_field, $node);
47          $output = $default_handler[$type];
48        }
49        else {
50          $output = $handlers[$type];
51        }
52    
53    $handlers = module_invoke_all('transcription_type', $type, $transcription_field, $node);      print $output;
54    if (empty($handlers[$type])) {      exit;
     $default_handler = transcription_default_type($type, $transcription_field, $node);  
     $output = $default_handler[$type];  
55    }    }
56    else {    return t('There are no transcription fields assigned to this node.');
     $output = $handlers[$type];  
   }  
   
   print $output;  
   exit;  
57  }  }
58    
59  function transcription_default_type($type, $transcriptions, $node) {  function transcription_default_type($type, $transcriptions, $node) {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.2