197
197
if (isset ($ _GET ['path ' ])) $ path = urldecode ($ _GET ['path ' ]);
198
198
else $ path = '' ;
199
199
200
- $ text_help_file = $ bp_application_path ."BP2_help.txt " ;
200
+ $ text_help_file = $ bp_application_path ."BP2_help.txt " ; // Name should be updated to BP3
201
201
202
202
if ($ test ) {
203
203
echo "<small> " ;
@@ -596,8 +596,10 @@ function compile_help($text_help_file,$html_help_file) {
596
596
}
597
597
$ title [$ i ] = $ thetitle ;
598
598
$ item [$ i ] = '' ;
599
- for ($ j = 1 ; $ j < count ($ table2 ); $ j ++)
600
- $ item [$ i ] .= $ table2 [$ j ]."<br /> " ;
599
+ for ($ j = 1 ; $ j < count ($ table2 ); $ j ++) {
600
+ $ item_line = make_links_clickable ($ table2 [$ j ]);
601
+ $ item [$ i ] .= $ item_line ."<br /> " ;
602
+ }
601
603
}
602
604
fwrite ($ handle ,$ file_header ."\n" );
603
605
$ table_of_contents = "<table style= \"border-spacing: 2px; \" cellpadding= \"2px; \"><tr> " ;
@@ -638,7 +640,7 @@ function compile_help($text_help_file,$html_help_file) {
638
640
function link_to_help () {
639
641
global $ html_help_file ;
640
642
$ console_link = "produce.php?instruction=help " ;
641
- $ link = "<p>➡ <a onclick= \"window.open(' " .$ html_help_file ."','Help ','width=800,height=500 '); return false; \" href= \"" . $ html_help_file . "\" >Display complete help file </a> or the console's <a href= \"" . $ console_link . "\" onclick= \"window.open(' " .$ console_link ."','help ','width=800,height=800,left=200 '); return false; \"> help file</a></p> " ;
643
+ $ link = "<p>➡ Display <a href= \"" . $ console_link . "\" onclick= \"window.open(' " .$ console_link ."','help ','width=800,height=800,left=200 '); return false; \">console's </a> instructions or the <a onclick= \"window.open(' " .$ html_help_file ."','Help ','width=800,height=500 '); return false; \" href= \"" . $ html_help_file . "\" >complete help file</a></p> " ;
642
644
return $ link ;
643
645
}
644
646
@@ -3723,7 +3725,7 @@ function filter_form_output($i) {
3723
3725
global $ NoteOffFilter_out , $ NoteOnFilter_out , $ KeyPressureFilter_out , $ ControlChangeFilter_out , $ ProgramChangeFilter_out , $ ChannelPressureFilter_out , $ PitchBendFilter_out , $ SystemExclusiveFilter_out , $ TimeCodeFilter_out , $ SongPositionFilter_out , $ SongSelectFilter_out , $ TuneRequestFilter_out , $ EndSysExFilter_out , $ TimingClockFilter_out , $ StartFilter_out , $ ContinueFilter_out , $ ActiveSensingFilter_out , $ SystemResetFilter_out ;
3724
3726
global $ url_this_page , $ MIDIoutput ;
3725
3727
echo "<div id= \"showhide_output " .$ i ."\" style= \"background-color: Snow; width:300px; \"> " ;
3726
- echo "<input style= \"background-color:yellow; \" type= \"submit \" onclick= \" clearsave(); \" formaction= \"" .$ url_this_page ."\" name= \"savemidiport \" value= \"SAVE MIDI ports \"> " ;
3728
+ echo "<input style= \"background-color:yellow; \" type= \"submit \" formaction= \"" .$ url_this_page ."\" name= \"savemidiport \" value= \"SAVE MIDI ports \"> " ;
3727
3729
echo "<p style= \"margin-left:12px; \"><b>Filter for MIDI output " .$ MIDIoutput [$ i ]."</b></p> " ;
3728
3730
echo "<table style= \"background-color:azure; \"> " ;
3729
3731
echo "<tr> " ;
@@ -3884,12 +3886,13 @@ function display_midi_ports($filename) {
3884
3886
echo "MIDI output <input type= \"text \" title= \"" .$ text_over_number ."\" onchange= \"tellsave() \" name= \"MIDIoutput_ " .$ i ."\" size= \"2 \" value= \"" .$ value ."\"> " ;
3885
3887
echo " <input type= \"text \" title= \"" .$ text_over_name ."\" style= \"margin-bottom:6px; \" onchange= \"tellsave() \" name= \"MIDIoutputname_ " .$ i ."\" size= \"15 \" value= \"" .$ MIDIoutputname [$ i ]."\"> " ;
3886
3888
echo " <input type= \"text \" title= \"" .$ text_over_comment ."\" name= \"MIDIoutputcomment_ " .$ i ."\" size= \"15 \" value= \"" .$ comment ."\"> " ;
3889
+ echo " <button type= \"button \" onclick= \"clearFields('MIDIoutput_ " .$ i ."','MIDIoutputname_ " .$ i ."','MIDIoutputcomment_ " .$ i ."') \">Delete</button> " ;
3887
3890
echo " <button style= \"background-color:azure; border-radius: 6px; \" onclick= \"toggledisplay_output( " .$ i ."); return false; \">FILTER</button> " ;
3888
3891
filter_form_output ($ i );
3889
3892
echo "<br /> " ;
3890
3893
}
3891
- echo "<input style= \"float:right; color:DarkBlue; backgroundsave_-color:yellow; \" onclick= \" tellsave() \" type= \"submit \" name= \"create_output \" value= \"Add an output \"><br /> " ;
3892
- echo "<input style= \"background-color:yellow; \" type= \"submit \" onclick= \" clearsave(); \" formaction= \"" .$ url_this_page ."\" name= \"savemidiport \" value= \"SAVE MIDI ports \"> " ;
3894
+ echo "<input style= \"float:right; color:DarkBlue; backgroundsave_-color:yellow; \" type= \"submit \" name= \"create_output \" value= \"Add an output \"><br /> " ;
3895
+ echo "<input style= \"background-color:yellow; \" type= \"submit \" formaction= \"" .$ url_this_page ."\" name= \"savemidiport \" value= \"SAVE MIDI ports \"> " ;
3893
3896
echo str_replace (' ' ," " ," 👉 Delete name if changing number " )."<br /><br /> " ;
3894
3897
for ($ i = 0 ; $ i < $ NumberMIDIinputs ; $ i ++) {
3895
3898
if ($ MIDIinput [$ i ] == -1 ) $ value = '' ;
@@ -3899,11 +3902,12 @@ function display_midi_ports($filename) {
3899
3902
echo "MIDI input <input type= \"text \" title= \"" .$ text_over_number ."\" onchange= \"tellsave() \" name= \"MIDIinput_ " .$ i ."\" size= \"2 \" value= \"" .$ value ."\"> " ;
3900
3903
echo " <input type= \"text \" title= \"" .$ text_over_name ."\" style= \"margin-bottom:6px; \" onchange= \"tellsave() \" name= \"MIDIinputname_ " .$ i ."\" size= \"15 \" value= \"" .$ MIDIinputname [$ i ]."\"> " ;
3901
3904
echo " <input type= \"text \" title= \"" .$ text_over_comment ."\" name= \"MIDIinputcomment_ " .$ i ."\" size= \"15 \" value= \"" .$ comment ."\"> " ;
3905
+ echo " <button type= \"button \" onclick= \"clearFields('MIDIinput_ " .$ i ."', 'MIDIinputname_ " .$ i ."', 'MIDIinputcomment_ " .$ i ."') \">Delete</button> " ;
3902
3906
echo " <button style= \"background-color:azure; border-radius: 6px; \" onclick= \"toggledisplay_input( " .$ i ."); return false; \">FILTER</button> " ;
3903
3907
filter_form_input ($ i );
3904
3908
echo "<br /> " ;
3905
3909
}
3906
- echo "<input style= \"float:right; color:DarkBlue; backgroundsave_-color:yellow; \" onclick= \" tellsave() \" type= \"submit \" name= \"create_input \" value= \"Add an input \"> " ;
3910
+ echo "<input style= \"float:right; color:DarkBlue; backgroundsave_-color:yellow; \" type= \"submit \" name= \"create_input \" value= \"Add an input \"> " ;
3907
3911
return ;
3908
3912
}
3909
3913
@@ -4111,4 +4115,14 @@ function update_scale_with_kbm($scl_name,$scale_file,$kbm_content) {
4111
4115
$ kbm_error = '' ;
4112
4116
return $ kbm_error ;
4113
4117
}
4118
+
4119
+ function make_links_clickable ($ text ) {
4120
+ $ pattern = '/\b(?:https?|ftp):\/\/[a-zA-Z0-9-_.]+(?:\.[a-zA-Z0-9-_.]+)+(?:\/[^\s]*)?/ ' ;
4121
+ $ text_with_links = preg_replace_callback ($ pattern , function ($ matches ) {
4122
+ $ url = $ matches [0 ];
4123
+ return '<a href=" ' .$ url .'" target="_blank"> ' .$ url .'</a> ' ;
4124
+ }, $ text );
4125
+ return $ text_with_links ;
4126
+ }
4127
+
4114
4128
?>
0 commit comments