Index: trunk/extensions/ABC/ABC.php |
— | — | @@ -20,14 +20,16 @@ |
21 | 21 | # Example: $abcURL = "/wiki/abc"; |
22 | 22 | $abcURL = false; |
23 | 23 | |
24 | | -# Path to the abcm2ps executable. |
| 24 | +# Path to the abcm2ps executable. Required. |
25 | 25 | $abcm2ps = "/usr/bin/abcm2ps"; |
26 | 26 | |
27 | | -# Path to the ps2pdf executable. |
| 27 | +# Path to the ps2pdf executable. Required. |
28 | 28 | $abcps2pdf = "/usr/bin/ps2pdf14"; |
29 | 29 | |
30 | | -# Path to the abc2midi executable. |
31 | | -$abc2midi = "/usr/bin/abc2midi"; |
| 30 | +# Path to the abc2midi executable. Optional; set this if you |
| 31 | +# want to enable MIDI rendering. |
| 32 | +#$abc2midi = "/usr/bin/abc2midi"; |
| 33 | +$abc2midi = false; |
32 | 34 | |
33 | 35 | $wgExtensionCredits['parserhooks'][] = array( |
34 | 36 | 'name' => 'ABC', |
— | — | @@ -88,8 +90,9 @@ |
89 | 91 | return str_replace("\n", "<br />", htmlspecialchars($error)); |
90 | 92 | if (!abcCreatePDF($abc, $hash, $error)) |
91 | 93 | return str_replace("\n", "<br />", htmlspecialchars($error)); |
92 | | - if (!abcCreateMIDI($abc, $hash, $error)) |
93 | | - return str_replace("\n", "<br />", htmlspecialchars($error)); |
| 94 | + if ($abc2midi) |
| 95 | + if (!abcCreateMIDI($abc, $hash, $error)) |
| 96 | + return str_replace("\n", "<br />", htmlspecialchars($error)); |
94 | 97 | |
95 | 98 | /* |
96 | 99 | * Succeeded to create all the output formats, return the |
— | — | @@ -103,14 +106,15 @@ |
104 | 107 | $e_pdfpath = htmlspecialchars("$abcURL/$hash.pdf"); |
105 | 108 | $e_midipath = htmlspecialchars("$abcURL/$hash.mid"); |
106 | 109 | |
107 | | - $e_abclink = "<a href=\"$e_abcpath\">" . wfMsg('abcabc') . "</a>"; |
108 | | - $e_pslink = "<a href=\"$e_pspath\">" . wfMsg('abcps') . "</a>"; |
109 | | - $e_pdflink = "<a href=\"$e_pdfpath\">" . wfMsg('abcpdf') . "</a>"; |
110 | | - $e_midilink = "<a href=\"$e_midipath\">" . wfMsg('abcmidi') . "</a>"; |
| 110 | + $links = array(); |
| 111 | + $links[] = "<a href=\"$e_abcpath\">" . wfMsg('abcabc') . "</a>"; |
| 112 | + $links[] = "<a href=\"$e_pspath\">" . wfMsg('abcps') . "</a>"; |
| 113 | + $links[] = "<a href=\"$e_pdfpath\">" . wfMsg('abcpdf') . "</a>"; |
| 114 | + if ($abc2midi) |
| 115 | + $links[] = "<a href=\"$e_midipath\">" . wfMsg('abcmidi') . "</a>"; |
111 | 116 | |
112 | 117 | $e_dllinks = wfMsg('abcdownload') . " " . |
113 | | - join(" " . wfMsg('abcsep') . " ", |
114 | | - array($e_abclink, $e_pslink, $e_pdflink, $e_midilink)); |
| 118 | + join(" " . wfMsg('abcsep') . " ", $links); |
115 | 119 | |
116 | 120 | $output = <<<EOF |
117 | 121 | <div style="float: $float; border: solid 1px #aaaaaa; margin: 0.2em;" class="abc-music"> |