function theme_flashnode in Flash Node 5.3
Same name and namespace in other branches
- 5.6 flashnode.module \theme_flashnode()
- 6.3 flashnode.module \theme_flashnode()
- 6.2 flashnode.module \theme_flashnode()
Create the HTML for insertion of Flash using SWFTools to do the work if available
Parameters
$flashnode: A structured array that defines an item of Flash content. Must include keys filepath (path to the file), width, height, substitution (string containing HTML mark up for the substitution content), and optionally flashvars. Other keys may be included and they will be passed through to SWFTools. Key Comment filepath path to an swf file to theme width display width of the swf file height display height of the movie substitution substitution content to use if using JavaScript insertion flashvars flashvars string to pass to the swf file base base parameter to pass to the swf file
$teaser: Flag to indicate whether teaser content is being generated. Not used by flash node but could be used by other themers to provide different output depending on mode
$options: Optional array of other parameters that will passed through to swf tools theme function
Return value
An HTML string for rendering the flash content
2 theme calls to theme_flashnode()
- 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 1098
Code
function theme_flashnode($flashnode, $teaser = FALSE, $options = array()) {
// Modify height and width to comply with limits, if required
$max_width = variable_get('flashnode_max_width', 0);
$max_height = variable_get('flashnode_max_height', 0);
// Check width first
if ($max_width) {
if ($flashnode['width'] > $max_width) {
$scale = $max_width / $flashnode['width'];
$flashnode['width'] = $flashnode['width'] * $scale;
$flashnode['height'] = $flashnode['height'] * $scale;
}
}
// Then check height
if ($max_height) {
if ($flashnode['height'] > $max_height) {
$scale = $max_height / $flashnode['height'];
$flashnode['width'] = $flashnode['width'] * $scale;
$flashnode['height'] = $flashnode['height'] * $scale;
}
}
// Generate output
$output .= theme('flashnode_markup', $flashnode, $options);
// Return the HTML
return $output;
}