You are here

function _flashnode_php_flashvars in Flash Node 5.3

Same name and namespace in other branches
  1. 5.6 flashnode.module \_flashnode_php_flashvars()
  2. 5.2 flashnode.module \_flashnode_php_flashvars()
  3. 6.3 flashnode.module \_flashnode_php_flashvars()
  4. 6.2 flashnode.module \_flashnode_php_flashvars()

Check to see if PHP is allowed in this format, and if it is process the flashvars string through the PHP filter in case there is some code to be handled. Then the string for safe handling, but turn & back in to & as that is what flash needs to define the variables in a flashvars string. Return the result.

2 calls to _flashnode_php_flashvars()
flashnode_content in ./flashnode.module
Return the HTML string required to generate flash content, based on an array of user supplied arguments.
flashnode_view in ./flashnode.module
Implementation of hook_view

File

./flashnode.module, line 1052

Code

function _flashnode_php_flashvars($flashvars, $format = -1) {

  // Get the list of filters for this node
  $filters = filter_list_format($format);

  // Look for module == filter and delta == 1
  // If found that means we have PHP allowed for this node so process it
  foreach ($filters as $filter) {
    if ($filter->module == 'filter' && $filter->delta == 1) {
      $flashvars = module_invoke($filter->module, 'filter', 'process', $filter->delta, $format, $flashvars);
    }
  }

  // Encode flashvars to make it safe for inclusion on the page
  $flashvars = check_plain($flashvars);

  // But we need to undo conversion of & to &
  $flashvars = str_replace('&', '&', $flashvars);
  return $flashvars;
}