function _swftools_admin_file_handling_option in SWF Tools 5
Same name and namespace in other branches
- 6 swftools.admin.inc \_swftools_admin_file_handling_option()
- 6.2 swftools.admin.inc \_swftools_admin_file_handling_option()
1 call to _swftools_admin_file_handling_option()
File
- ./
swftools.admin.inc, line 302
Code
function _swftools_admin_file_handling_option($type, $player_directory, $description) {
$list[0] = 'None';
$methods = swftools_methods_available($type);
if (count($methods)) {
foreach ($methods as $method => $info) {
if (!file_exists($player_directory . $info['shared_file'])) {
$list[$method] = $info['title'] . ' - <span class="error">Missing</span>';
}
else {
$list[$method] = $info['title'];
}
}
}
// Determine the appropriate default based on $type
$default = swftools_get_player($type);
// swftools_get_player() returns FALSE for nothing configured, change to 0
if (!$default) {
$default = 0;
}
return array(
'#type' => 'radios',
'#title' => t($description),
'#default_value' => $default,
'#options' => $list,
);
}