playlist.php
author Dan
Wed, 26 Mar 2008 10:24:20 -0400
changeset 12 b3fcc21e557f
parent 10 d3059e20b0fa
child 21 74edc873234f
permissions -rw-r--r--
Backend improvement to webserver that causes interrupts to work properly; made pcntl_signal only be called if it's supported

<?php

/**
 * Playlist displayer
 *
 * Greyhound - real web management for Amarok
 * Copyright (C) 2008 Dan Fuhry
 *
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
 */

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']) )
       && !isset($_GET['f'])
       );
  $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',
      'dom-drag.js',
      'position.js'
    ));
  $smarty->assign('allow_control', $allowcontrol);
  $smarty->display('playlist.tpl');
}