<?php
/**
* Playlist displayer
*
* Web control interface script for Amarok
* Written by Dan Fuhry - 2008
*
* This script is in the public domain. Use it for good, not evil.
*/
function amarok_playlist($server)
{
global $theme, $playlist, $allowcontrol;
$iphone = ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') ||
strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') ||
strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') ||
isset($_GET['m'])
);
$theme_id = ( $iphone ) ? 'iphone' : $theme;
$smarty = load_theme($theme_id);
$active = dcop_action('playlist', 'getActiveIndex');
$smarty->assign('theme', $theme_id);
$smarty->assign('playlist', $playlist);
$smarty->assign('active', $active);
$smarty->assign('scripts', array(
'ajax.js',
'domutils.js',
'volume.js'
));
$smarty->assign('allow_control', $allowcontrol);
$smarty->display('playlist.tpl');
}