Changeset 1003
- Timestamp:
- 06/22/08 01:23:03 (5 months ago)
- Files:
-
- trunk/swisscenter/base/browse.php (modified) (9 diffs)
- trunk/swisscenter/base/playlist.php (modified) (5 diffs)
- trunk/swisscenter/delete_pl.php (added)
- trunk/swisscenter/lang/en/en.xml (modified) (2 diffs)
- trunk/swisscenter/load_pl.php (modified) (2 diffs)
- trunk/swisscenter/manage_pl.php (modified) (2 diffs)
- trunk/swisscenter/photo_selected.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swisscenter/base/browse.php
r977 r1003 246 246 247 247 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)))); 249 249 250 250 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)))); 252 252 253 253 for ($i=$start; $i<$end; $i++) … … 256 256 { 257 257 // 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); 259 259 } 260 260 else … … 332 332 // Directory Icon or thumbnail for the directory if one exists 333 333 $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"].'/')) ); 335 335 } 336 336 else … … 350 350 351 351 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)) ) ); 353 353 354 354 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)) ) ) ; 356 356 357 357 $tlist->display(); … … 373 373 374 374 // Page settings 375 $url = $_SERVER["PHP_SELF"];375 $url = url_remove_param(current_url(),'thumbs'); 376 376 $page = ( !isset($_REQUEST["page"]) ? 0 : $_REQUEST["page"]); 377 377 $dir = ( empty($_REQUEST["DIR"]) ? '' : un_magic_quote(rawurldecode($_REQUEST["DIR"]))); … … 383 383 page_header( $heading, substr($dir,0,-1),'',1,false,'','PAGE_KEYBOARD'); 384 384 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))) ); 386 386 } 387 387 elseif ( get_user_pref("DISPLAY_THUMBS") == "COMPACT" ) … … 389 389 page_header( $heading, substr($dir,0,-1),'',1,false,style_value("PAGE_FOCUS_IMAGES")); 390 390 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))) ); 392 392 } 393 393 else … … 395 395 page_header( $heading, substr($dir,0,-1),'',1,false,'',$media_type); 396 396 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))) ); 398 398 } 399 399 … … 414 414 page_footer( $back_url, $buttons ); 415 415 else 416 page_footer( $url.'?DIR='.rawurlencode(parent_dir($dir)), $buttons );416 page_footer( url_add_param($url, 'DIR', rawurlencode(parent_dir($dir))), $buttons ); 417 417 } 418 418 trunk/swisscenter/base/playlist.php
r955 r1003 36 36 { 37 37 case 'musicip': 38 $tracks = load_pl( $_SESSION["musicip_playlist"] ); // URL of the playlist generated by MusicIP38 $tracks = load_pl( $_SESSION["musicip_playlist"], $failed ); // URL of the playlist generated by MusicIP 39 39 break; 40 40 … … 103 103 if (is_hardware_player()) 104 104 { 105 $bg_music_spec = nvl($_SESSION["background_music"],'*');105 $bg_music_spec = isset($_SESSION["background_music"]) ? $_SESSION["background_music"] : '*'; 106 106 107 107 // At the moment we only support the current playlist. However, in the future we will allow the … … 504 504 //------------------------------------------------------------------------------------------------- 505 505 506 function load_pl ($file )506 function load_pl ($file, &$failed) 507 507 { 508 508 send_to_log(5,'Attempting to load playlist : '.$file); … … 519 519 // Search through the list of filenames and try to load them into the playlist. 520 520 $tracks = array(); 521 $failed = array(); 521 522 foreach( $filelist as $fsp ) 522 523 { … … 524 525 if ($info !== false) 525 526 $tracks[] = $info; 527 else 528 $failed[] = basename($fsp); 526 529 } 527 530 trunk/swisscenter/lang/en/en.xml
r994 r1003 2604 2604 </string> 2605 2605 <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> 2606 2621 <id>PLAYLIST_EDIT</id> 2607 2622 <text>Edit the playlist</text> … … 2612 2627 <text>Load playlist</text> 2613 2628 <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> 2614 2634 </string> 2615 2635 <string> trunk/swisscenter/load_pl.php
r923 r1003 22 22 if (!empty($fsp)) 23 23 { 24 $tracks = load_pl($fsp );24 $tracks = load_pl($fsp, $failed); 25 25 26 26 // Either replace the existing playlist or merge the two together. … … 30 30 set_current_playlist( $custom, array_merge($_SESSION["playlist"], $tracks) ); 31 31 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')); 33 37 } 34 38 else trunk/swisscenter/manage_pl.php
r820 r1003 19 19 save_pl($_REQUEST['save']); 20 20 21 if ( isset($_REQUEST["clear"]) && !empty($_REQUEST["clear"]))22 clear_pl();23 24 21 // Clear the Playlist 25 26 22 if ( isset($_REQUEST["clear"]) && !empty($_REQUEST["clear"])) 27 23 clear_pl(); … … 47 43 $menu->add_item(str('PLAYLIST_APPEND'),'load_pl.php?action=append', true); 48 44 $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); 49 47 } 50 48 else 51 49 { 52 50 $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); 53 53 } 54 54 trunk/swisscenter/photo_selected.php
r1001 r1003 25 25 $play_order = get_user_pref('PHOTO_PLAY_ORDER','filename'); 26 26 $delay = get_user_pref('PHOTO_PLAY_TIME',5); 27 $music = nvl($_SESSION["background_music"],'*'); // default to the current playlist27 $music = isset($_SESSION["background_music"]) ? $_SESSION["background_music"] : '*'; // default to the current playlist 28 28 29 29 // What do we output to the user when it comes to describing the currently selected background music?