playlist.php
author Dan
Sun, 23 Mar 2008 22:03:57 -0400
changeset 4 cde92f6ec29f
parent 3 e7447a6044ec
child 5 9b96265b5918
permissions -rw-r--r--
Should be completely iPhone/iPod Touch-friendly now :)

<?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');
}