Changeset 1025
- Timestamp:
- 07/19/08 15:14:38 (4 months ago)
- Files:
-
- trunk/swisscenter/config/config_playlists.php (modified) (5 diffs)
- trunk/swisscenter/index.php (modified) (1 diff)
- trunk/swisscenter/lang/en/en.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swisscenter/config/config_playlists.php
r849 r1025 4 4 *************************************************************************************************/ 5 5 6 require_once( realpath(dirname(__FILE__).'/../base/browse.php')); 7 6 8 // ---------------------------------------------------------------------------------- 7 9 // Display current config … … 10 12 function playlists_display( $message = '' ) 11 13 { 14 // Get list of available playlists 15 $dir_list = array(); 16 $file_list = array(); 17 dir_contents_FS(str_suffix(get_sys_pref('PLAYLISTS'),'/'), media_exts_playlists(), $dir_list, $file_list); 18 $playlists = array(); 19 foreach ($file_list as $file) 20 $playlists[file_noext($file["filename"])] = $file["dirname"].$file["filename"]; 21 12 22 echo '<p><h1>'.str('PLAYLISTS').'<p>'; 13 23 message($message); … … 19 29 form_input('itunes',str('ITUNES_LIBRARY'),50,'',get_sys_pref('ITUNES_LIBRARY')); 20 30 form_label(str('ITUNES_CONFIG_PROMPT')); 31 form_list_static('autoload',str('PLAYLIST_AUTOLOAD'),$playlists,get_sys_pref('PLAYLIST_AUTOLOAD',''),false,false); 32 form_label(str('PLAYLIST_AUTOLOAD_PROMPT')); 21 33 form_submit(str('SAVE_SETTINGS'),2); 22 34 form_end(); … … 31 43 $dir = rtrim(str_replace('\\','/',un_magic_quote($_REQUEST["location"])),'/'); 32 44 $itunes_library = rtrim(str_replace('\\','/',un_magic_quote($_REQUEST["itunes"])),'/'); 45 $autoload = $_REQUEST["autoload"]; 33 46 34 47 if (empty($_REQUEST["location"])) … … 46 59 set_sys_pref('PLAYLISTS',$dir); 47 60 set_sys_pref('ITUNES_LIBRARY',$itunes_library); 61 if (!empty($autoload)) 62 set_sys_pref('PLAYLIST_AUTOLOAD',$autoload); 63 else 64 delete_sys_pref('PLAYLIST_AUTOLOAD'); 48 65 playlists_display(str('SAVE_SETTINGS_OK')); 49 66 } trunk/swisscenter/index.php
r990 r1025 75 75 76 76 /** 77 * Automatically load playlist 78 */ 79 80 if ( !isset($_SESSION["playlist_autoloaded"]) && get_sys_pref('PLAYLIST_AUTOLOAD','')!=='' ) 81 { 82 $fsp = get_sys_pref('PLAYLIST_AUTOLOAD'); 83 $name = file_noext(basename($fsp)); 84 $tracks = load_pl($fsp, $failed); 85 set_current_playlist($name, $tracks); 86 $_SESSION["playlist_autoloaded"] = 'yes'; 87 } 88 89 /** 77 90 * Output the page header immediately, as it performs the authentication check and will redirect 78 91 * the user to the "change_user" screen if there are multiple users to choose from or a password trunk/swisscenter/lang/en/en.xml
r1024 r1025 2664 2664 </string> 2665 2665 <string> 2666 <id>PLAYLIST_AUTOLOAD</id> 2667 <text>Playlist to autoload</text> 2668 <version>1.20.1</version> 2669 </string> 2670 <string> 2671 <id>PLAYLIST_AUTOLOAD_PROMPT</id> 2672 <text>Select a playlist to be automatically loaded at startup. This is useful if you find yourself always having to select the same playlist for background music before viewing photos.</text> 2673 <version>1.20.1</version> 2674 </string> 2675 <string> 2666 2676 <id>PLAYLIST_CLEAR</id> 2667 2677 <text>Clear the playlist</text>