function kaltura_format_known_fields in Kaltura 6
Same name and namespace in other branches
- 5 plugins/kaltura_playlist/kaltura_playlist.module \kaltura_format_known_fields()
- 6.2 plugins/kaltura_playlist/kaltura_playlist.module \kaltura_format_known_fields()
1 call to kaltura_format_known_fields()
- kaltura_playlist_format_value in plugins/
kaltura_playlist/ kaltura_playlist.module
File
- plugins/
kaltura_playlist/ kaltura_playlist.module, line 312
Code
function kaltura_format_known_fields($attr, $value) {
switch ($attr) {
case 'node_kaltura_kaltura_thumbnail_url':
$return = '<img src="' . $value . '/width/74/height/55" />';
break;
case 'node_kaltura_kaltura_entryId':
return FALSE;
break;
case 'node_changed':
$return = format_date($value, 'small');
break;
case 'node_kaltura_kaltura_duration':
$secs = $value;
if ($secs > 60 * 60) {
$hr = (int) ($secs / 60);
$hr = $hr < 10 ? '0' . $hr : $hr;
$min = (int) ($secs / 60 / 60);
$min = $min < 10 ? '0' . $min : $min;
$sec = (int) ($secs / 60 % 60);
$sec = $sec < 10 ? '0' . $sec : $sec;
$return = $hr . ':' . $min . ':' . $sec;
}
else {
$min = (int) ($secs / 60);
$min = $min < 10 ? '0' . $min : $min;
$sec = (int) ($secs % 60);
$sec = $sec < 10 ? '0' . $sec : $sec;
$return = $min . ':' . $sec;
}
break;
default:
$return = $value;
}
return $return;
}