/** * Displays a table of the given video tracks. * * @author Ross Carlson * @version 2.26.06 * @since 2.26.06 * @param array $tracks The array of objects of each track * @param $purpose The type of this track table. One of: * generic|album|search|sample|sample-all */ function videoTable($tracks, $purpose = false) { global $web_root, $root_dir, $row_colors; $display = new jzDisplay(); // Let's setup Smarty $smarty = smartySetup(); // Let's define our variables $i = 0; foreach ($tracks as $child) { $metaData = $child->getMeta(); $tArr[$i]['name'] = $display->returnShortName($child->getName(), 25); $tArr[$i]['length'] = convertSecMins($metaData['length']); $tArr[$i]['playlink'] = $display->playlink($child, $child->getName(), false, false, true, false, true); $tArr[$i]['downloadlink'] = $display->downloadButton($child, true, false, false, true); $tArr[$i]['i'] = $i; $art = $child->getMainArt("125x125", true, "video"); if ($art) { $tArr[$i]['art'] = $art; } else { $tArr[$i]['art'] = false; } $tArr[$i]['playcount'] = $child->getPlayCount(); $i++; } $smarty->assign('tracks', $tArr); $smarty->assign('i', 0); $smarty->assign('cols', 3); $smarty->assign('jz_row1', $row_colors[1]); $smarty->assign('jz_row2', $row_colors[2]); $smarty->assign('word_watch_now', word("Watch Now")); $smarty->assign('word_download', word("Download")); $smarty->assign('word_viewed', word("Viewed")); // Now let's include the template $smarty->display(SMARTY_ROOT . 'templates/slick/videotable.tpl'); }