playlist.php
author Dan
Fri, 25 Apr 2008 14:48:23 -0400
changeset 19 75dd71fe35b2
parent 10 d3059e20b0fa
child 21 74edc873234f
permissions -rw-r--r--
Added the "powered by" link and rebranded as 0.1 alpha 1

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