mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-06 11:59:56 +02:00
fixed admin prefs, flushed out localplay stuff, tweaked filters on browse
This commit is contained in:
parent
15c56f21f2
commit
f64a2f4d00
17 changed files with 119 additions and 99 deletions
|
@ -41,30 +41,35 @@ echo '<div id="browse_content">';
|
||||||
switch($_REQUEST['action']) {
|
switch($_REQUEST['action']) {
|
||||||
case 'file':
|
case 'file':
|
||||||
case 'album':
|
case 'album':
|
||||||
|
Browse::reset_filters();
|
||||||
Browse::set_type('album');
|
Browse::set_type('album');
|
||||||
Browse::set_sort('name','ASC');
|
Browse::set_sort('name','ASC');
|
||||||
$album_ids = Browse::get_objects();
|
$album_ids = Browse::get_objects();
|
||||||
Browse::show_objects($album_ids);
|
Browse::show_objects($album_ids);
|
||||||
break;
|
break;
|
||||||
case 'artist':
|
case 'artist':
|
||||||
|
Browse::reset_filters();
|
||||||
Browse::set_type('artist');
|
Browse::set_type('artist');
|
||||||
Browse::set_sort('name','ASC');
|
Browse::set_sort('name','ASC');
|
||||||
$artist_ids = Browse::get_objects();
|
$artist_ids = Browse::get_objects();
|
||||||
Browse::show_objects($artist_ids);
|
Browse::show_objects($artist_ids);
|
||||||
break;
|
break;
|
||||||
case 'genre':
|
case 'genre':
|
||||||
|
Browse::reset_filters();
|
||||||
Browse::set_type('genre');
|
Browse::set_type('genre');
|
||||||
Browse::set_sort('name','ASC');
|
Browse::set_sort('name','ASC');
|
||||||
$genre_ids = Browse::get_objects();
|
$genre_ids = Browse::get_objects();
|
||||||
Browse::show_objects($genre_ids);
|
Browse::show_objects($genre_ids);
|
||||||
break;
|
break;
|
||||||
case 'song':
|
case 'song':
|
||||||
|
Browse::reset_filters();
|
||||||
Browse::set_type('song');
|
Browse::set_type('song');
|
||||||
Browse::set_sort('title','ASC');
|
Browse::set_sort('title','ASC');
|
||||||
$song_ids = Browse::get_objects();
|
$song_ids = Browse::get_objects();
|
||||||
Browse::show_objects($song_ids);
|
Browse::show_objects($song_ids);
|
||||||
break;
|
break;
|
||||||
case 'live_stream':
|
case 'live_stream':
|
||||||
|
Browse::reset_filters();
|
||||||
Browse::set_type('live_stream');
|
Browse::set_type('live_stream');
|
||||||
Browse::set_sort('name','ASC');
|
Browse::set_sort('name','ASC');
|
||||||
$live_stream_ids = Browse::get_objects();
|
$live_stream_ids = Browse::get_objects();
|
||||||
|
@ -74,6 +79,7 @@ switch($_REQUEST['action']) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'playlist':
|
case 'playlist':
|
||||||
|
Browse::reset_filters();
|
||||||
Browse::set_type('playlist');
|
Browse::set_type('playlist');
|
||||||
Browse::set_sort('name','ASC');
|
Browse::set_sort('name','ASC');
|
||||||
$playlist_ids = Browse::get_objects();
|
$playlist_ids = Browse::get_objects();
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
v.3.4-Alpha3
|
v.3.4-Alpha3
|
||||||
|
- Added reset of filters when switching between browse types this
|
||||||
|
may be removed in the future...
|
||||||
|
- Fixed LastFM submitting even when there was no username/password
|
||||||
|
- Put Catalog 'All' Functions back onto catalog view
|
||||||
|
- Fixed Admin Preferences reverting to user after first update
|
||||||
|
- Fixed Localplay playlist
|
||||||
- Updated Ajax Load icon (Thx Spocky)
|
- Updated Ajax Load icon (Thx Spocky)
|
||||||
- Replaced Flash Player with Lacy Morrow's (http://blog.lacymorrow.com/)
|
- Replaced Flash Player with Lacy Morrow's (http://blog.lacymorrow.com/)
|
||||||
(Thx Hugoh)
|
(Thx Hugoh)
|
||||||
|
|
|
@ -82,12 +82,6 @@ class Ajax {
|
||||||
$source_txt = "'$source'";
|
$source_txt = "'$source'";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
Replaces ampersand with & for w3c conformance.
|
|
||||||
Fixme: ajax doesn't seem to work anymore with this...
|
|
||||||
*/
|
|
||||||
//$url = htmlspecialchars($url);
|
|
||||||
|
|
||||||
if ($post) {
|
if ($post) {
|
||||||
$ajax_string = "ajaxPost('$url','$post',$source_txt)";
|
$ajax_string = "ajaxPost('$url','$post',$source_txt)";
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,20 @@ class Browse {
|
||||||
|
|
||||||
} // set_filter
|
} // set_filter
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reset_filter
|
||||||
|
* This is a wrapper function that resets the filters
|
||||||
|
*/
|
||||||
|
public static function reset_filters() {
|
||||||
|
|
||||||
|
if (!is_array($_SESSION['browse']['filter'])) { return true; }
|
||||||
|
|
||||||
|
foreach ($_SESSION['browse']['filter'] AS $key=>$value) {
|
||||||
|
self::set_filter($key,'');
|
||||||
|
}
|
||||||
|
|
||||||
|
} // reset_filters
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get_filter
|
* get_filter
|
||||||
* returns the specified filter value
|
* returns the specified filter value
|
||||||
|
|
|
@ -26,7 +26,7 @@ abstract class localplay_controller {
|
||||||
|
|
||||||
// Required Functions
|
// Required Functions
|
||||||
abstract public function add($objects); // Takes an array of song_ids
|
abstract public function add($objects); // Takes an array of song_ids
|
||||||
abstract public function delete($objects); // Takes an array of song_ids
|
abstract public function delete_track($object_id); // Takes a single object_id and removes it from the playlist
|
||||||
abstract public function play();
|
abstract public function play();
|
||||||
abstract public function stop();
|
abstract public function stop();
|
||||||
abstract public function get();
|
abstract public function get();
|
||||||
|
|
|
@ -119,22 +119,6 @@ class Localplay {
|
||||||
|
|
||||||
} // _load_player
|
} // _load_player
|
||||||
|
|
||||||
/**
|
|
||||||
* has_function
|
|
||||||
* This is used to check the function map and see if the current
|
|
||||||
* player type supports the indicated function.
|
|
||||||
*/
|
|
||||||
public function has_function($function_name) {
|
|
||||||
|
|
||||||
/* Check the function map, if it's got a value it must
|
|
||||||
* be possible
|
|
||||||
*/
|
|
||||||
if (strlen($this->_function_map[$function_name]) > 0) { return true; }
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
} // has_function
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* format_name
|
* format_name
|
||||||
* This function takes the track name and checks to see if 'skip'
|
* This function takes the track name and checks to see if 'skip'
|
||||||
|
@ -144,13 +128,7 @@ class Localplay {
|
||||||
public function format_name($name,$id) {
|
public function format_name($name,$id) {
|
||||||
|
|
||||||
$name = scrub_out($name);
|
$name = scrub_out($name);
|
||||||
|
$name = Ajax::text('?page=localplay&action=command&command=skip&id=' . $id,$name,'localplay_skip_' . $id);
|
||||||
if ($this->has_function('skip')) {
|
|
||||||
$url = conf('ajax_url') . "?action=localplay&cmd=skip&value=$id" . conf('ajax_info');
|
|
||||||
|
|
||||||
$name = "<span style=\"cursor:pointer;text-decoration:underline;\" onclick=\"ajaxPut('$url');return true;\">$name</span>";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $name;
|
return $name;
|
||||||
|
|
||||||
} // format_name
|
} // format_name
|
||||||
|
@ -385,10 +363,8 @@ class Localplay {
|
||||||
*/
|
*/
|
||||||
public function get() {
|
public function get() {
|
||||||
|
|
||||||
$function = $this->_function_map['get'];
|
$data = $this->_player->get();
|
||||||
|
|
||||||
$data = $this->_player->$function();
|
|
||||||
|
|
||||||
if (!count($data) OR !is_array($data)) {
|
if (!count($data) OR !is_array($data)) {
|
||||||
debug_event('localplay','Error Unable to get song info, check ' . $this->type . ' controller','1');
|
debug_event('localplay','Error Unable to get song info, check ' . $this->type . ' controller','1');
|
||||||
return array();
|
return array();
|
||||||
|
@ -481,9 +457,9 @@ class Localplay {
|
||||||
* skip
|
* skip
|
||||||
* This isn't a required function, it tells the daemon to skip to the specified song
|
* This isn't a required function, it tells the daemon to skip to the specified song
|
||||||
*/
|
*/
|
||||||
public function skip($song_id) {
|
public function skip($track_id) {
|
||||||
|
|
||||||
if (!$this->_player->$function($song_id)) {
|
if (!$this->_player->skip($track_id)) {
|
||||||
debug_event('localplay','Error: Unable to skip to next song, check ' . $this->type . ' controller','1');
|
debug_event('localplay','Error: Unable to skip to next song, check ' . $this->type . ' controller','1');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -608,14 +584,13 @@ class Localplay {
|
||||||
} // set_active_instance
|
} // set_active_instance
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* delete
|
* delete_track
|
||||||
* This removes songs from the players playlist as defined get function
|
* This removes songs from the players playlist it takes a single ID as provided
|
||||||
|
* by the get command
|
||||||
*/
|
*/
|
||||||
public function delete($songs) {
|
public function delete_track($object_id) {
|
||||||
|
|
||||||
$function = $this->_function_map['delete'];
|
if (!$this->_player->delete_track($object_id)) {
|
||||||
|
|
||||||
if (!$this->_player->$function($songs)) {
|
|
||||||
debug_event('localplay','Error: Unable to remove songs, check ' . $this->type . ' controller','1');
|
debug_event('localplay','Error: Unable to remove songs, check ' . $this->type . ' controller','1');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1004,8 +1004,12 @@ function get_user_icon($name,$title='',$id='') {
|
||||||
* primarly by the ajax mojo
|
* primarly by the ajax mojo
|
||||||
*/
|
*/
|
||||||
function xml_from_array($array,$callback=0,$type='') {
|
function xml_from_array($array,$callback=0,$type='') {
|
||||||
|
|
||||||
|
// If we weren't passed an array then return a blank string
|
||||||
|
if (!is_array($array)) { return ''; }
|
||||||
|
|
||||||
|
// The type is used for the different XML docs we pass
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
|
|
||||||
case 'itunes':
|
case 'itunes':
|
||||||
foreach ($array as $key=>$value) {
|
foreach ($array as $key=>$value) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
|
@ -1025,7 +1029,7 @@ function xml_from_array($array,$callback=0,$type='') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // end foreach
|
||||||
|
|
||||||
return $string;
|
return $string;
|
||||||
break;
|
break;
|
||||||
|
@ -1046,7 +1050,7 @@ function xml_from_array($array,$callback=0,$type='') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // end foreach
|
||||||
|
|
||||||
return $string;
|
return $string;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -54,9 +54,14 @@ switch ($_REQUEST['action']) {
|
||||||
$fields = $localplay->get_instance_fields();
|
$fields = $localplay->get_instance_fields();
|
||||||
require_once Config::get('prefix') . '/templates/show_localplay_instances.inc.php';
|
require_once Config::get('prefix') . '/templates/show_localplay_instances.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'show_songs':
|
case 'show_playlist':
|
||||||
|
// Init and then connect to our localplay instance
|
||||||
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
|
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
|
||||||
|
$localplay->connect();
|
||||||
|
|
||||||
|
// Pull the current playlist and require the template
|
||||||
|
$objects = $localplay->get();
|
||||||
|
require_once Config::get('prefix') . '/templates/show_localplay_playlist.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'delete_song':
|
case 'delete_song':
|
||||||
$song_id = scrub_in($_REQUEST['song_id']);
|
$song_id = scrub_in($_REQUEST['song_id']);
|
||||||
|
|
|
@ -277,30 +277,17 @@ class AmpacheMpd extends localplay_controller {
|
||||||
} // add_songs
|
} // add_songs
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* delete_songs
|
* delete_track
|
||||||
* This must take an array of ID's (as passed by get function) from Ampache
|
* This must take a single ID (as passed by get function) from Ampache
|
||||||
* and delete them from MPD
|
* and delete it from the current playlist
|
||||||
*/
|
*/
|
||||||
public function delete($objects) {
|
public function delete_track($object_id) {
|
||||||
|
|
||||||
/* Default to true */
|
if (is_null($this->_mpd->PLRemove($object_id))) { return false; }
|
||||||
$return = true;
|
|
||||||
|
|
||||||
/* This should be an array of UID's as returned by
|
return true;
|
||||||
* the get function so that we can just call the class based
|
|
||||||
* functions to remove them or if there isn't a uid for
|
|
||||||
* the songs, then however ya'll have stored them
|
|
||||||
* in this controller
|
|
||||||
*/
|
|
||||||
foreach ($songs as $uid) {
|
|
||||||
|
|
||||||
if (is_null($this->_mpd->PLRemove($uid))) { $return = false; }
|
} // delete_track
|
||||||
|
|
||||||
} // foreach of songs
|
|
||||||
|
|
||||||
return $return;
|
|
||||||
|
|
||||||
} // delete_songs
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear_playlist
|
* clear_playlist
|
||||||
|
@ -456,6 +443,11 @@ class AmpacheMpd extends localplay_controller {
|
||||||
*/
|
*/
|
||||||
public function get() {
|
public function get() {
|
||||||
|
|
||||||
|
// If we don't have the playlist yet, pull it
|
||||||
|
if (!isset($this->_mpd->playlist)) {
|
||||||
|
$this->_mpd->GetPlaylist();
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the Current Playlist */
|
/* Get the Current Playlist */
|
||||||
$playlist = $this->_mpd->playlist;
|
$playlist = $this->_mpd->playlist;
|
||||||
|
|
||||||
|
@ -474,10 +466,10 @@ class AmpacheMpd extends localplay_controller {
|
||||||
|
|
||||||
/* If we don't know it, look up by filename */
|
/* If we don't know it, look up by filename */
|
||||||
if (!$song->title) {
|
if (!$song->title) {
|
||||||
$filename = sql_escape($entry['file']);
|
$filename = Dba::escape($entry['file']);
|
||||||
$sql = "SELECT id FROM song WHERE file LIKE '%$filename'";
|
$sql = "SELECT `id` FROM `song` WHERE `file` LIKE '%$filename'";
|
||||||
$db_results = mysql_query($sql, dbh());
|
$db_results = Dba::query($sql);
|
||||||
if ($r = mysql_fetch_assoc($db_results)) {
|
if ($r = Dba::fetch_assoc($db_results)) {
|
||||||
$song = new Song($r['id']);
|
$song = new Song($r['id']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -486,7 +478,7 @@ class AmpacheMpd extends localplay_controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make the name pretty */
|
/* Make the name pretty */
|
||||||
$song->format_song();
|
$song->format();
|
||||||
$data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;
|
$data['name'] = $song->f_title . ' - ' . $song->f_album . ' - ' . $song->f_artist;
|
||||||
|
|
||||||
/* Optional Elements */
|
/* Optional Elements */
|
||||||
|
@ -499,7 +491,7 @@ class AmpacheMpd extends localplay_controller {
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
||||||
} // get_songs
|
} // get
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get_status
|
* get_status
|
||||||
|
|
|
@ -467,16 +467,15 @@ class mpd {
|
||||||
*
|
*
|
||||||
* Removes track <id> from the playlist.
|
* Removes track <id> from the playlist.
|
||||||
*/
|
*/
|
||||||
function PLRemove($id) {
|
public function PLRemove($id) {
|
||||||
if ( $this->debugging ) echo "mpd->PLRemove()\n";
|
|
||||||
if ( ! is_numeric($id) ) {
|
if ( ! is_numeric($id) ) {
|
||||||
$this->errStr = "PLRemove() : argument 1 must be a numeric value";
|
$this->errStr = "PLRemove() : argument 1 must be a numeric value";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ( ! is_null($resp = $this->SendCommand(MPD_CMD_PLREMOVE,$id))) $this->RefreshInfo();
|
if ( ! is_null($resp = $this->SendCommand(MPD_CMD_PLREMOVE,$id))) $this->RefreshInfo();
|
||||||
if ( $this->debugging ) echo "mpd->PLRemove() / return\n";
|
debug_event('MPD',"mpd->PLRemove() / return",'5');
|
||||||
return $resp;
|
return $resp;
|
||||||
}
|
} // PLRemove
|
||||||
|
|
||||||
/* SetRepeat()
|
/* SetRepeat()
|
||||||
*
|
*
|
||||||
|
@ -970,13 +969,14 @@ class mpd {
|
||||||
* NOTE: This function really should not be used. Instead, use $this->playlist. The function
|
* NOTE: This function really should not be used. Instead, use $this->playlist. The function
|
||||||
* will most likely be deprecated in future releases.
|
* will most likely be deprecated in future releases.
|
||||||
*/
|
*/
|
||||||
function GetPlaylist() {
|
public function GetPlaylist() {
|
||||||
if ( $this->debugging ) echo "mpd->GetPlaylist()\n";
|
|
||||||
$resp = $this->SendCommand(MPD_CMD_PLLIST);
|
$resp = $this->SendCommand(MPD_CMD_PLLIST);
|
||||||
$playlist = $this->_parseFileListResponse($resp);
|
$playlist = $this->_parseFileListResponse($resp);
|
||||||
if ( $this->debugging ) echo "mpd->GetPlaylist() / return ".print_r($playlist)."\n";
|
debug_event('MPD',"mpd->GetPlaylist() / return ".print_r($playlist,1),'5');
|
||||||
return $playlist;
|
return $playlist;
|
||||||
}
|
|
||||||
|
} // GetPlaylist
|
||||||
|
|
||||||
/* ClearPLIfStopped()
|
/* ClearPLIfStopped()
|
||||||
*
|
*
|
||||||
|
|
|
@ -101,6 +101,9 @@ class AmpacheLastfm {
|
||||||
debug_event('LastFM','Song less then 30 seconds not queueing','3');
|
debug_event('LastFM','Song less then 30 seconds not queueing','3');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure there's actually a username and password before we keep going
|
||||||
|
if (!$this->username || !$this->password) { return false; }
|
||||||
|
|
||||||
// Create our scrobbler with everything this time and then queue it
|
// Create our scrobbler with everything this time and then queue it
|
||||||
$scrobbler = new scrobbler($this->username,$this->password,$this->hostname,$this->port,$this->path,$this->challenge);
|
$scrobbler = new scrobbler($this->username,$this->password,$this->hostname,$this->port,$this->path,$this->challenge);
|
||||||
|
|
|
@ -21,9 +21,6 @@
|
||||||
|
|
||||||
require 'lib/init.php';
|
require 'lib/init.php';
|
||||||
|
|
||||||
/* Scrub in the needed mojo */
|
|
||||||
if (!$_REQUEST['tab']) { $_REQUEST['tab'] = 'interface'; }
|
|
||||||
|
|
||||||
// Switch on the action
|
// Switch on the action
|
||||||
switch($_REQUEST['action']) {
|
switch($_REQUEST['action']) {
|
||||||
case 'update_preferences':
|
case 'update_preferences':
|
||||||
|
@ -36,6 +33,7 @@ switch($_REQUEST['action']) {
|
||||||
if ($_REQUEST['method'] == 'admin') {
|
if ($_REQUEST['method'] == 'admin') {
|
||||||
$user_id = '-1';
|
$user_id = '-1';
|
||||||
$fullname = _('Server');
|
$fullname = _('Server');
|
||||||
|
$_REQUEST['action'] = 'admin';
|
||||||
}
|
}
|
||||||
elseif ($_REQUEST['method'] == 'user') {
|
elseif ($_REQUEST['method'] == 'user') {
|
||||||
$user_id = $_REQUEST['user_id'];
|
$user_id = $_REQUEST['user_id'];
|
||||||
|
|
|
@ -61,12 +61,27 @@ switch ($_REQUEST['action']) {
|
||||||
$command = scrub_in($_REQUEST['command']);
|
$command = scrub_in($_REQUEST['command']);
|
||||||
$localplay->$command();
|
$localplay->$command();
|
||||||
break;
|
break;
|
||||||
|
case 'skip':
|
||||||
|
$localplay->skip(intval($_REQUEST['id']));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// Nothing
|
// Nothing
|
||||||
break;
|
break;
|
||||||
} // end whitelist
|
} // end whitelist
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case 'delete_track':
|
||||||
|
// Load Connect... yada yada
|
||||||
|
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
|
||||||
|
$localplay->connect();
|
||||||
|
|
||||||
|
// Scrub in the delete request
|
||||||
|
$id = intval($_REQUEST['id']);
|
||||||
|
|
||||||
|
$localplay->delete_track($id);
|
||||||
|
|
||||||
|
$results['localplay_playlist_' . $id] = '';
|
||||||
|
break;
|
||||||
case 'delete_instance':
|
case 'delete_instance':
|
||||||
// Make sure that you have access to do this... again I really
|
// Make sure that you have access to do this... again I really
|
||||||
// don't know what that means so I'm just going to do nothing fo now
|
// don't know what that means so I'm just going to do nothing fo now
|
||||||
|
|
|
@ -51,5 +51,17 @@
|
||||||
<th><?php echo _('Last Add'); ?></th>
|
<th><?php echo _('Last Add'); ?></th>
|
||||||
<th><?php echo _('Actions'); ?></th>
|
<th><?php echo _('Actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr class="<?php echo flip_class(); ?>">
|
||||||
|
<td colspan="3">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td align="right" colspan="2">
|
||||||
|
<a href="<?php echo Config::get('web_path'); ?>/admin/catalog.php?action=gather_album_art"><?php echo _('Gather All Art'); ?></a>
|
||||||
|
| <a href="<?php echo Config::get('web_path'); ?>/admin/catalog.php?action=add_to_all_catalogs"><?php echo _('Add to All'); ?></a>
|
||||||
|
| <a href="<?php echo Config::get('web_path'); ?>/admin/catalog.php?action=update_all_catalogs"><?php echo _('Verify All'); ?></a>
|
||||||
|
| <a href="<?php echo Config::get('web_path'); ?>/admin/catalog.php?action=clean_all_catalogs"><?php echo _('Clean All'); ?></a>
|
||||||
|
| <a href="<?php echo Config::get('web_path'); ?>/admin/catalog.php?action=full_service"><?php echo _('Update All'); ?></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?php require Config::get('prefix') . '/templates/list_header.inc.php'; ?>
|
<?php require Config::get('prefix') . '/templates/list_header.inc.php'; ?>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2001 - 2006 Ampache.org
|
Copyright (c) 2001 - 2007 Ampache.org
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
|
@ -18,37 +18,34 @@
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$songs = $localplay->get();
|
|
||||||
$status = $localplay->status();
|
|
||||||
?>
|
?>
|
||||||
<table cellspacing="0">
|
<?php show_box_top(_('Current Playlist')); ?>
|
||||||
|
<table class="table-data" cellspacing="0">
|
||||||
<tr class="table-header">
|
<tr class="table-header">
|
||||||
<th><?php echo _('Track'); ?></th>
|
<th><?php echo _('Track'); ?></th>
|
||||||
<th><?php echo _('Name'); ?></th>
|
<th><?php echo _('Name'); ?></th>
|
||||||
<th><?php echo _('Action'); ?></th>
|
<th><?php echo _('Action'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
foreach ($songs as $song) {
|
foreach ($objects as $object) {
|
||||||
$class = '';
|
$class = '';
|
||||||
if ($status['track'] == $song['track']) { $class=' class="lp_current"'; }
|
if ($status['track'] == $object['track']) { $class=' class="lp_current"'; }
|
||||||
?>
|
?>
|
||||||
<tr class="<?php echo flip_class(); ?>">
|
<tr class="<?php echo flip_class(); ?>" id="localplay_playlist_<?php echo $object['id']; ?>">
|
||||||
<td>
|
<td>
|
||||||
<?php echo scrub_out($song['track']); ?>
|
<?php echo scrub_out($object['track']); ?>
|
||||||
</td>
|
</td>
|
||||||
<td<?php echo $class; ?>>
|
<td<?php echo $class; ?>>
|
||||||
<?php echo $localplay->format_name($song['name'],$song['id']); ?>
|
<?php echo $localplay->format_name($object['name'],$object['id']); ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?php echo $web_path; ?>/localplay.php?action=delete_song&song_id=<?php echo scrub_out($song['id']); ?>">
|
<?php echo Ajax::button('?page=localplay&action=delete_track&id=' . intval($object['id']),'delete',_('Delete'),'localplay_delete_' . intval($object['id'])); ?>
|
||||||
<?php echo get_user_icon('delete'); ?>
|
|
||||||
</a>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } if (!count($songs)) { ?>
|
<?php } if (!count($objects)) { ?>
|
||||||
<tr class="<?php echo flip_class(); ?>">
|
<tr class="<?php echo flip_class(); ?>">
|
||||||
<td colspan="3"><span class="error"><?php echo _('No Records Found'); ?></span></td>
|
<td colspan="3"><span class="error"><?php echo _('No Records Found'); ?></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
|
<?php show_box_bottom(); ?>
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
<ul class="sb3" id="sb_admin_ot">
|
<ul class="sb3" id="sb_admin_ot">
|
||||||
<li id="sb_admin_ot_ClearNowPlaying"><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_now_playing"><?php echo _('Clear Now Playing'); ?></a></li>
|
<li id="sb_admin_ot_ClearNowPlaying"><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_now_playing"><?php echo _('Clear Now Playing'); ?></a></li>
|
||||||
<li id="sb_admin_ot_ClearCatStats"><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_stats"><?php echo _('Clear Catalog Stats'); ?></a></li>
|
<li id="sb_admin_ot_ClearCatStats"><a href="<?php echo $web_path; ?>/admin/catalog.php?action=clear_stats"><?php echo _('Clear Catalog Stats'); ?></a></li>
|
||||||
<li id="sb_admin_ot_GatherArt"><a href="<?php echo $web_path; ?>/admin/catalog.php?action=gather_album_art"><?php echo _('Gather Album Art'); ?></a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<ul class="sb3" id="sb_localplay_info">
|
<ul class="sb3" id="sb_localplay_info">
|
||||||
<li id="sb_localplay_info_add_instance"><a href="<?php echo $web_path; ?>/localplay.php?action=show_add_instance"><?php echo _('Add Instance'); ?></a></li>
|
<li id="sb_localplay_info_add_instance"><a href="<?php echo $web_path; ?>/localplay.php?action=show_add_instance"><?php echo _('Add Instance'); ?></a></li>
|
||||||
<li id="sb_localplay_info_show_instances"><a href="<?php echo $web_path; ?>/localplay.php?action=show_instances"><?php echo _('Show instances'); ?></a></li>
|
<li id="sb_localplay_info_show_instances"><a href="<?php echo $web_path; ?>/localplay.php?action=show_instances"><?php echo _('Show instances'); ?></a></li>
|
||||||
<li id="sb_localplay_info_show"><a href="<?php echo $web_path; ?>/localplay.php?action=show_songs"><?php echo _('Show Playlist'); ?></a></li>
|
<li id="sb_localplay_info_show"><a href="<?php echo $web_path; ?>/localplay.php?action=show_playlist"><?php echo _('Show Playlist'); ?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue