You are here

function _simpleviewer_vars in SWF Tools 6

Same name and namespace in other branches
  1. 5 simpleviewer/simpleviewer.module \_simpleviewer_vars()
  2. 6.2 simpleviewer/simpleviewer.module \_simpleviewer_vars()

These are the default options and flashvars.

2 calls to _simpleviewer_vars()
simpleviewer_swftools_flashvars in simpleviewer/simpleviewer.module
Implementation of swftools_flashvars hook Allows the Flash player provider to add variables to the Flashvars array. Other arrays can also be modified.
swftools_simpleviewer_playlist in simpleviewer/simpleviewer.module

File

simpleviewer/simpleviewer.module, line 83

Code

function _simpleviewer_vars() {
  include_once drupal_get_path('module', 'simpleviewer') . '/simpleviewer.admin.inc';

  // Grab the admin form and use all of the default values as settings for the flash embedding.
  $sv_vars = simpleviewer_admin_form(TRUE);
  foreach (element_children($sv_vars) as $name) {
    $name_parts = explode('_', $name);
    if ($name_parts[1] == 'xml') {

      // The last part of the Drupal variable name matches the SimpleViewer XML option name
      $return['xml'][$name_parts[2]] = $sv_vars[$name]['#default_value'];
    }
    elseif ($name_parts[1] == 'swf') {
      $return['swf'][$name_parts[2]] = $sv_vars[$name]['#default_value'];
    }
    else {
      $return['other'][$name_parts[2]] = $sv_vars[$name]['#default_value'];
    }
  }
  return $return;
}