9 * This script is in the public domain. Use it for good, not evil. |
9 * This script is in the public domain. Use it for good, not evil. |
10 */ |
10 */ |
11 |
11 |
12 function amarok_playlist($server) |
12 function amarok_playlist($server) |
13 { |
13 { |
14 global $smarty, $theme, $playlist, $allowcontrol; |
14 global $theme, $playlist, $allowcontrol; |
|
15 |
|
16 $iphone = ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || |
|
17 strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') || |
|
18 strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') || |
|
19 isset($_GET['m']) |
|
20 ); |
|
21 $theme_id = ( $iphone ) ? 'iphone' : $theme; |
|
22 $smarty = load_theme($theme_id); |
15 |
23 |
16 $active = dcop_action('playlist', 'getActiveIndex'); |
24 $active = dcop_action('playlist', 'getActiveIndex'); |
17 $smarty->assign('theme', $theme); |
25 $smarty->assign('theme', $theme_id); |
18 $smarty->assign('playlist', $playlist); |
26 $smarty->assign('playlist', $playlist); |
19 $smarty->assign('active', $active); |
27 $smarty->assign('active', $active); |
20 $smarty->assign('scripts', array( |
28 $smarty->assign('scripts', array( |
21 'ajax.js', |
29 'ajax.js', |
22 'domutils.js', |
30 'domutils.js', |