r106512 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106511‎ | r106512 | r106513 >
Date:18:18, 17 December 2011
Author:mah
Status:ok
Tags:
Comment:
* Use Html::rawElement instead of <pre>
* Explained directory creation in README
* Added two message descriptions

Author: Alexander Klauer <Graf.Zahl@gmx.net>
Modified paths:
  • /trunk/extensions/Score/README (modified) (history)
  • /trunk/extensions/Score/Score.body.php (modified) (history)
  • /trunk/extensions/Score/Score.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Score/Score.i18n.php
@@ -57,6 +57,8 @@
5858 'score-compilererr' => 'Displayed if the LilyPond code could not be compiled. $1 is the error (generally big block of text in a pre tag)',
5959 'score-desc' => '{{desc}}',
6060 'score-getcwderr' => 'Displayed if the extension cannot obtain the CWD.',
 61+ 'score-nooutput' => 'Displayed if the LilyPond image/midi dir cannot be created.',
 62+ 'score-nofactory' => 'Displayed if the LilyPond/ImageMagick working directory cannot be created.',
6163 'score-noinput' => 'Displayed if the LilyPond input file cannot be created.',
6264 'score-page' => 'The word "Page" as used in pagination. $1 is the page number',
6365 'score-renameerr' => 'Displayed if moving the resultant files from the working environment to the upload directory fails.',
Index: trunk/extensions/Score/README
@@ -19,7 +19,9 @@
2020 subdirectory. Make sure they are readable by your webserver.
2121 4. Create a subdirectory named "lilypond" in your $wgUploadDirectory (usually
2222 the directory named "images" in in your MediaWiki directory). Make sure
23 - the directory is writable by your webserver.
 23+ the directory is writable by your webserver. If you do not create this
 24+ directory, the Score extension will attempt to create it for you with the
 25+ rights available to it.
2426 5. Add the lines
2527
2628 require_once("$IP/extensions/Score/Score.php");
Index: trunk/extensions/Score/Score.body.php
@@ -163,7 +163,7 @@
164164 throw new ScoreException( 'score-cleanerr' );
165165 }
166166
167 - /* create working environment */
 167+ /* create output directory if necessary */
168168 if ( !file_exists( "$wgUploadDirectory/$lilypondDir" ) ) {
169169 $rc = wfMkdirParents( "$wgUploadDirectory/$lilypondDir", null, __METHOD__ );
170170 if ( !$rc ) {
@@ -209,7 +209,7 @@
210210 $msg = wfMessage( 'score-compilererr' )
211211 ->inContentLanguage()
212212 ->rawParams(
213 - ' <pre>' . strip_tags( $output ) . "\n</pre>\n"
 213+ ' ' . Html::rawElement( 'pre', array(), strip_tags( $output ) ) . "\n"
214214 );
215215 return $msg;
216216 }
@@ -336,6 +336,9 @@
337337 if( file_exists( $dir ) ) {
338338 array_map( 'unlink', glob( "$dir/*", GLOB_NOSORT ) );
339339 return rmdir( $dir );
 340+ } else {
 341+ /* Nothing to do */
 342+ return true;
340343 }
341344 }
342345

Status & tagging log