Assembla home | Assembla project page
 

Changeset 1003

Show
Ignore:
Timestamp:
06/22/08 01:23:03 (5 months ago)
Author:
Pernod
Message:

Fixed bug where loading a playlist would append the existing playlist. This was caused by the parameter 'replace' being lost from the URL. Fixes #130
Added a message listing any invalid tracks when loading a playlist. Fixes #27
Added the option to delete a playlist. Fixes #145
Fixed the slideshow background music where selecting None would still play the current playlist. Fixes #121

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/swisscenter/base/browse.php

    r977 r1003  
    246246 
    247247    if ($up) 
    248       $menu->add_up($url.'?page='.($page-1).'&DIR='.rawurlencode($dir)); 
     248      $menu->add_up(url_add_params($url,array('page'=>($page-1), 'DIR'=>rawurlencode($dir)))); 
    249249 
    250250    if ($down) 
    251       $menu->add_down($url.'?page='.($page+1).'&DIR='.rawurlencode($dir)); 
     251      $menu->add_down(url_add_params($url,array('page'=>($page+1),'DIR'=>rawurlencode($dir)))); 
    252252 
    253253    for ($i=$start; $i<$end; $i++) 
     
    256256      { 
    257257        // Output a link to call this page again, but passing in the selected directory. 
    258         $menu->add_item($dir_list[$i]["filename"],$url.'?DIR='.rawurlencode($dir.$dir_list[$i]["filename"].'/'), true); 
     258        $menu->add_item($dir_list[$i]["filename"], url_add_param($url,'DIR',rawurlencode($dir.$dir_list[$i]["filename"].'/')), true); 
    259259      } 
    260260      else 
     
    332332        // Directory Icon or thumbnail for the directory if one exists 
    333333        $image = file_thumbnail($dir_list[$i]["dirname"].$dir_list[$i]["filename"]); 
    334         $tlist->add_item($image, $dir_list[$i]["filename"], $url.'?DIR='.rawurlencode($dir.$dir_list[$i]["filename"].'/') ); 
     334        $tlist->add_item($image, $dir_list[$i]["filename"], url_add_param($url,'DIR',rawurlencode($dir.$dir_list[$i]["filename"].'/')) ); 
    335335      } 
    336336      else 
     
    350350 
    351351    if ($up)    
    352       $tlist->set_up( $url.'?page='.($page-1).'&DIR='.rawurlencode($dir) );  
     352      $tlist->set_up( url_add_params($url, array('page'=>($page-1),'DIR'=>rawurlencode($dir)) ) );  
    353353 
    354354    if ($down)  
    355       $tlist->set_down( $url.'?page='.($page+1).'&DIR='.rawurlencode($dir) );  
     355      $tlist->set_down( url_add_params($url, array('page'=>($page+1),'DIR'=>rawurlencode($dir)) ) ) ;  
    356356 
    357357    $tlist->display(); 
     
    373373     
    374374    // Page settings 
    375     $url         = $_SERVER["PHP_SELF"]
     375    $url         = url_remove_param(current_url(),'thumbs')
    376376    $page        = ( !isset($_REQUEST["page"]) ? 0 : $_REQUEST["page"]); 
    377377    $dir         = ( empty($_REQUEST["DIR"]) ? '' : un_magic_quote(rawurldecode($_REQUEST["DIR"]))); 
     
    383383      page_header( $heading, substr($dir,0,-1),'',1,false,'','PAGE_KEYBOARD'); 
    384384      display_thumbs ($url, $dir, $dir_list, $file_list, $page, $media_type); 
    385       $buttons[] = array('text'=>str('COMPACT_VIEW'), 'url'=>$url.'?thumbs=COMPACT&DIR='.rawurlencode($dir) ); 
     385      $buttons[] = array('text'=>str('COMPACT_VIEW'), 'url'=>url_add_params($url, array('thumbs'=>'COMPACT','DIR'=>rawurlencode($dir))) ); 
    386386    } 
    387387    elseif ( get_user_pref("DISPLAY_THUMBS") == "COMPACT" ) 
     
    389389      page_header( $heading, substr($dir,0,-1),'',1,false,style_value("PAGE_FOCUS_IMAGES")); 
    390390      display_thumbs ($url, $dir, $dir_list, $file_list, $page, $media_type); 
    391       $buttons[] = array('text'=>str('LIST_VIEW'), 'url'=>$url.'?thumbs=NO&DIR='.rawurlencode($dir) ); 
     391      $buttons[] = array('text'=>str('LIST_VIEW'), 'url'=>url_add_params($url, array('thumbs'=>'NO','DIR'=>rawurlencode($dir))) ); 
    392392    } 
    393393    else 
     
    395395      page_header( $heading, substr($dir,0,-1),'',1,false,'',$media_type); 
    396396      display_names ($url, $dir, $dir_list, $file_list, $page, $media_type); 
    397       $buttons[] = array('text'=>str('THUMBNAIL_VIEW'), 'url'=>$url.'?thumbs=FULL&DIR='.rawurlencode($dir) ); 
     397      $buttons[] = array('text'=>str('THUMBNAIL_VIEW'), 'url'=>url_add_params($url, array('thumbs'=>'FULL','DIR'=>rawurlencode($dir))) ); 
    398398    } 
    399399     
     
    414414      page_footer( $back_url, $buttons ); 
    415415    else 
    416       page_footer( $url.'?DIR='.rawurlencode(parent_dir($dir)), $buttons ); 
     416      page_footer( url_add_param($url, 'DIR', rawurlencode(parent_dir($dir))), $buttons ); 
    417417  } 
    418418   
  • trunk/swisscenter/base/playlist.php

    r955 r1003  
    3636  { 
    3737    case 'musicip': 
    38           $tracks = load_pl( $_SESSION["musicip_playlist"]); // URL of the playlist generated by MusicIP 
     38          $tracks = load_pl( $_SESSION["musicip_playlist"], $failed ); // URL of the playlist generated by MusicIP 
    3939          break; 
    4040       
     
    103103  if (is_hardware_player()) 
    104104  { 
    105     $bg_music_spec = nvl($_SESSION["background_music"],'*')
     105    $bg_music_spec = isset($_SESSION["background_music"]) ? $_SESSION["background_music"] : '*'
    106106     
    107107    // At the moment we only support the current playlist. However, in the future we will allow the 
     
    504504//------------------------------------------------------------------------------------------------- 
    505505 
    506 function load_pl ($file
     506function load_pl ($file, &$failed
    507507{ 
    508508  send_to_log(5,'Attempting to load playlist : '.$file); 
     
    519519  // Search through the list of filenames and try to load them into the playlist.     
    520520  $tracks = array(); 
     521  $failed = array(); 
    521522  foreach( $filelist as $fsp ) 
    522523  { 
     
    524525    if ($info !== false) 
    525526      $tracks[] = $info;     
     527    else 
     528      $failed[] = basename($fsp); 
    526529  } 
    527530 
  • trunk/swisscenter/lang/en/en.xml

    r994 r1003  
    26042604      </string> 
    26052605      <string> 
     2606        <id>PLAYLIST_DELETE</id> 
     2607        <text>Delete a playlist</text> 
     2608        <version>1.20.1</version> 
     2609      </string> 
     2610      <string> 
     2611        <id>PLAYLIST_DELETED</id> 
     2612        <text>Playlist Deleted</text> 
     2613        <version>1.20.1</version> 
     2614      </string> 
     2615      <string> 
     2616        <id>PLAYLIST_DELETE_CONFIRM</id> 
     2617        <text>Delete playlist?</text> 
     2618        <version>1.20.1</version> 
     2619      </string> 
     2620      <string> 
    26062621        <id>PLAYLIST_EDIT</id> 
    26072622        <text>Edit the playlist</text> 
     
    26122627        <text>Load playlist</text> 
    26132628        <version>1.19</version> 
     2629      </string> 
     2630      <string> 
     2631        <id>PLAYLIST_LOAD_FAIL</id> 
     2632        <text>Playlist loaded %s tracks, %s were not found in the database.</text> 
     2633        <version>1.20.1</version> 
    26142634      </string> 
    26152635      <string> 
  • trunk/swisscenter/load_pl.php

    r923 r1003  
    2222  if (!empty($fsp)) 
    2323  { 
    24     $tracks = load_pl($fsp); 
     24    $tracks = load_pl($fsp, $failed); 
    2525 
    2626    // Either replace the existing playlist or merge the two together. 
     
    3030      set_current_playlist( $custom, array_merge($_SESSION["playlist"], $tracks) ); 
    3131 
    32     page_inform(2,"manage_pl.php",str('PLAYLIST_LOAD'),str('PLAYLIST_LOAD_OK')); 
     32    if (count($failed) > 0) 
     33      page_inform(5,"manage_pl.php",str('PLAYLIST_LOAD'),str('PLAYLIST_LOAD_FAIL', count($tracks), count($failed)). 
     34                                        '<p>'.implode('<br>', array_slice($failed,0,8))); 
     35    else 
     36      page_inform(2,"manage_pl.php",str('PLAYLIST_LOAD'),str('PLAYLIST_LOAD_OK')); 
    3337  } 
    3438  else  
  • trunk/swisscenter/manage_pl.php

    r820 r1003  
    1919    save_pl($_REQUEST['save']); 
    2020 
    21   if ( isset($_REQUEST["clear"]) && !empty($_REQUEST["clear"])) 
    22     clear_pl(); 
    23  
    2421  // Clear the Playlist 
    25  
    2622  if ( isset($_REQUEST["clear"]) && !empty($_REQUEST["clear"])) 
    2723    clear_pl(); 
     
    4743    $menu->add_item(str('PLAYLIST_APPEND'),'load_pl.php?action=append', true); 
    4844    $menu->add_item( str('PLAYLIST_SAVE_CURRENT'),'save_pl.php', true); 
     45    if (is_user_admin()) 
     46      $menu->add_item( str('PLAYLIST_DELETE'),'delete_pl.php', true); 
    4947  } 
    5048  else 
    5149  { 
    5250    $menu->add_item(str('PLAYLIST_LOAD_NEW'),'load_pl.php?action=replace',true); 
     51    if (is_user_admin()) 
     52      $menu->add_item(str('PLAYLIST_DELETE'),'delete_pl.php', true); 
    5353  } 
    5454 
  • trunk/swisscenter/photo_selected.php

    r1001 r1003  
    2525  $play_order = get_user_pref('PHOTO_PLAY_ORDER','filename'); 
    2626  $delay      = get_user_pref('PHOTO_PLAY_TIME',5); 
    27   $music      = nvl($_SESSION["background_music"],'*'); // default to the current playlist 
     27  $music      = isset($_SESSION["background_music"]) ? $_SESSION["background_music"] : '*'; // default to the current playlist 
    2828   
    2929  // What do we output to the user when it comes to describing the currently selected background music?