CC-3174 : showbuilder

fixing some css/js for display.
This commit is contained in:
Naomi Aro 2012-02-01 23:33:20 +01:00
parent f5b2a23eb1
commit 3aab811a3e
11 changed files with 89 additions and 22 deletions

View file

@ -642,6 +642,34 @@ class Application_Model_StoredFile {
return $res;
}
/*
* @param DateInterval $p_interval
*
* @return string $runtime
*/
private static function formatDuration($dt){
$hours = $dt->format("H");
$min = $dt->format("i");
$sec = $dt->format("s");
$time = "PT{$hours}H{$min}M{$sec}S";
$p_interval = new DateInterval($time);
$hours = $p_interval->format("%h");
$mins = $p_interval->format("%i");
if( $hours == 0) {
$runtime = $p_interval->format("%i:%S");
}
else {
$runtime = $p_interval->format("%h:%I:%S");
}
return $runtime;
}
public static function searchFilesForPlaylistBuilder($datatables)
{
global $CC_CONFIG;
@ -691,6 +719,9 @@ class Application_Model_StoredFile {
$row['id'] = intval($row['id']);
$length = new DateTime($row['length']);
$row['length'] = self::formatDuration($length);
// add checkbox row
$row['checkbox'] = "<input type='checkbox' name='cb_".$row['id']."'>";
@ -701,7 +732,7 @@ class Application_Model_StoredFile {
$type = substr($row['ftype'], 0, 2);
$row['row_id'] = "{$type}_{$row['id']}";
$row['tr_id'] = "{$type}_{$row['id']}";
//TODO url like this to work on both playlist/showbuilder screens.
//datatable stuff really needs to be pulled out and generalized within the project