Assembla home | Assembla project page
 

Changeset 1024

Show
Ignore:
Timestamp:
07/19/08 15:00:05 (4 months ago)
Author:
Pernod
Message:

Moved the MusicIP settings to their own page in a new 'Other Components' section.

Fixes #55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/swisscenter/config/config_audio.php

    r820 r1024  
    44 *************************************************************************************************/ 
    55 
    6 require_once( realpath(dirname(__FILE__).'/../base/musicip.php')); 
    7  
    86  // ---------------------------------------------------------------------------------- 
    97  // Display current config 
    108  // ---------------------------------------------------------------------------------- 
    119 
    12   function audio_display( $message_audio = '', $message_musicip = ''
     10  function audio_display( $message = ''
    1311  { 
    14     $opts2_vals  = array( str('ENABLED')=>'YES',str('DISABLED')=>'NO'); 
    15     $opts3_vals = array( str('ENABLED')=>'YES',str('DISABLED')=>'NO',str('AUTOMATIC')=>'AUTO'); 
     12    $opts_vals = array( str('ENABLED')=>'YES',str('DISABLED')=>'NO',str('AUTOMATIC')=>'AUTO'); 
    1613 
    1714    echo "<h1>".str('CONFIG_AUDIO_OPTIONS')."</h1>"; 
    18     message($message_audio); 
     15    message($message); 
    1916    form_start('index.php'); 
    2017    form_hidden('section','AUDIO'); 
    2118    form_hidden('action','UPDATE'); 
    22     form_radio_static('style',str('NOW_PLAYING_SUPPORT'),$opts3_vals, get_sys_pref('SUPPORT_NOW_PLAYING','AUTO') ,false,true); 
     19    form_radio_static('style',str('NOW_PLAYING_SUPPORT'),$opts_vals, get_sys_pref('SUPPORT_NOW_PLAYING','AUTO') ,false,true); 
    2320    form_label(str('NOW_PLAYING_PROMPT'));     
    2421    form_submit(str('SAVE_SETTINGS'));   
    2522    form_end(); 
    26      
    27     echo "<h1>".str('CONFIG_MIP_OPTIONS')."</h1>"; 
    28     $opts_type = array( str('TRACKS')=>'tracks',str('MINUTES')=>'min'); 
    29  
    30     // Display any messages to the user regarding the state of the MusicIP service 
    31     if ( ! empty($message_musicip) ) 
    32       message($message_musicip);   
    33     elseif ( ! musicip_available() ) 
    34       message('!'.str('MIP_NOT_FOUND'));   
    35  
    36     echo '<b>'.str('MIP_WHATIS').'</b>'; 
    37     echo '<p>'.str('MIP_DESC','<a href="http://www.musicip.com">www.musicip.com</a>'); 
    38  
    39     form_start('index.php'); 
    40     form_hidden('section','AUDIO'); 
    41     form_hidden('action','UPDATE_MUSICIP'); 
    42      
    43     form_input('port',str('MIP_PORT'),3,'', get_sys_pref('MUSICIP_PORT')); 
    44     form_label(str('MIP_PORT_PROMPT'));     
    45        
    46     form_slider('size',str('MIP_SIZE'),5,500,3, get_sys_pref('MUSICIP_SIZE',20));   
    47     form_radio_static('size_type','',$opts_type, get_sys_pref('MUSICIP_SIZE_TYPE','tracks') ,false,true); 
    48     form_label(str('MIP_SIZE_PROMPT'));     
    49      
    50     form_slider('reject',str('MIP_REJECT'),1,100,3, get_sys_pref('MUSICIP_REJECT',5));   
    51     form_radio_static('reject_type','',$opts_type, get_sys_pref('MUSICIP_REJECT_TYPE','tracks') ,false,true); 
    52     form_label(str('MIP_REJECT_PROMPT'));     
    53      
    54     form_slider('style',str('MIP_STYLE'),0,200,3, get_sys_pref('MUSICIP_STYLE',20));   
    55     form_label(str('MIP_STYLE_PROMPT'));     
    56      
    57     form_slider('variety',str('MIP_VARIETY'),0,9,3, get_sys_pref('MUSICIP_VARIETY',0));   
    58     form_label(str('MIP_VARIETY_PROMPT'));     
    59      
    60     form_submit(str('SAVE_SETTINGS'));   
    61     form_end();     
    6223  } 
    63  
    64   // ---------------------------------------------------------------------------------- 
    65   // Saves the MusicIP settings 
    66   // ---------------------------------------------------------------------------------- 
    67  
    68   function audio_update_musicip() 
    69   { 
    70     $port = $_REQUEST["port"]; 
    71  
    72     if (empty($port) || (int)$port < 1 || (int)$port > 65535) 
    73       audio_display('',"!".str('MIP_INVALID_PORT')); 
    74     else 
    75     { 
    76       if ( musicip_check($port) ) 
    77       { 
    78         set_sys_pref('MUSICIP_PORT',$port); 
    79         set_sys_pref('MUSICIP_STYLE',$_REQUEST["style"]); 
    80         set_sys_pref('MUSICIP_VARIETY',$_REQUEST["variety"]); 
    81         set_sys_pref('MUSICIP_REJECT',$_REQUEST["reject"]); 
    82         set_sys_pref('MUSICIP_REJECT_TYPE',$_REQUEST["reject_type"]); 
    83         set_sys_pref('MUSICIP_SIZE',$_REQUEST["size"]); 
    84         set_sys_pref('MUSICIP_SIZE_TYPE',$_REQUEST["size_type"]); 
    85         audio_display('',str('SAVE_SETTINGS_OK')); 
    86       } 
    87       else  
    88       { 
    89         audio_display('',"!".str('MIP_INVALID_PORT',$port)); 
    90       } 
    91     } 
    92   }   
    9324   
    9425  // ---------------------------------------------------------------------------------- 
  • trunk/swisscenter/config/index.php

    r1021 r1024  
    101101          $menu->add_item(str('MISC_TITLE')             ,'section=MISC&action=DISPLAY'); 
    102102 
     103          $menu->add_menu(str('ADDITIONAL_COMPONENTS')); 
     104          $menu->add_item(str('CONFIG_MUSICIP')         ,'section=MUSICIP&action=DISPLAY'); 
     105           
    103106      $menu->add_menu(str('EXPERT_OPTIONS')); 
    104107          $menu->add_item(str('LANG_EDITOR')            ,'section=LANGUAGE&action=DISPLAY'); 
  • trunk/swisscenter/lang/en/en.xml

    r1021 r1024  
    1414      </string> 
    1515      <string> 
     16        <id>ADDITIONAL_COMPONENTS</id> 
     17        <text>Other Components</text> 
     18        <version>1.20.1</version> 
     19      </string> 
     20      <string> 
    1621        <id>ADD_PLAYLIST</id> 
    1722        <text>Add to your playlist</text> 
     
    554559      </string> 
    555560      <string> 
     561        <id>CONFIG_MUSICIP</id> 
     562        <text>MusicIP Settings</text> 
     563        <version>1.20.1</version> 
     564      </string> 
     565      <string> 
    556566        <id>CONFIG_RADIO_OPTIONS</id> 
    557567        <text>Internet Radio</text> 
     
    18151825      <string> 
    18161826        <id>MEDIA_MANAGEMENT</id> 
    1817         <text>Media management</text> 
    1818         <version>1.19</version> 
     1827        <text>Media Management</text> 
     1828        <version>1.20.1</version> 
    18191829      </string> 
    18201830      <string>