You are here

function scald_scald_prerender in Scald: Media Management made easy 6

Same name and namespace in other branches
  1. 7 scald.module \scald_scald_prerender()

Implementation of hook_scald_prerender().

Scald Core implements this hook for its role as a Scald Atom Provider of Atoms of Scald Unified Type 'composite', for its role as a Scald Context Provider of Scald Contexts 'debug', 'no-access', 'invalid-id', 'deleted', 'title', and for its role as a Scald Transcoder Provider of Scald Transcoder 'passthrough'.

Parameters

$atom: The Scald Atom object to prepare for rendering.

$mode: A string indicating which mode the prerender function is being called in ( 'type', 'atom', 'context', or 'transcoder').

$context: The Scald Context slug. Must be optional since Scald Core implements multiple Providers which require hook_scald_prerender().

$options: A string which represents any Context options. Must be optional since Scald Core implements multiple Providers which require hook_scald_prerender().

Return value

None; $atom->rendered should be adjusted as appropriate

File

./scald.module, line 2516

Code

function scald_scald_prerender(&$atom, $mode, $context = NULL, $options = NULL) {
  switch ($mode) {
    case 'type':
      break;

    // end 'type'
    case 'context':
      switch ($context) {
        case 'no-access':
          break;
        case 'invalid-id':
          break;
        case 'deleted':
          break;
        case 'title':
          break;
      }
      break;

    // end 'context'
    case 'transcoder':
      $atom->rendered->file_transcoded_url = url($atom->file_source);
      break;
  }
}