r102207 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102206‎ | r102207 | r102208 >
Date:23:11, 6 November 2011
Author:krinkle
Status:deferred
Tags:
Comment:
[TsIntuition] demoBase fixes + wrap demo-output into <div style="white-space: pre;" />
* Because of the closing div decided to restructure the close_demo function. It includes a call to view_source now. Making close_demo() the only function call needed from a demo
* Making timezone explicitly default to UTC for demos to suppress PHP's warning about how we should not assume the default timezone.
Modified paths:
  • /trunk/tools/ToolserverI18N/public_html/demo/demo1.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demo2.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demo3.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demo4.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demo5.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demo6.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demo7.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demo8.php (modified) (history)
  • /trunk/tools/ToolserverI18N/public_html/demo/demoBase.php (modified) (history)

Diff [purge]

Index: trunk/tools/ToolserverI18N/public_html/demo/demo5.php
@@ -13,5 +13,4 @@
1414 echo $I18N->getFooterLine( TSINT_HELP_ALL );
1515
1616 /* View source */
17 -view_source( __FILE__ );
18 -close_demo();
 17+close_demo( __FILE__ );
Index: trunk/tools/ToolserverI18N/public_html/demo/demo6.php
@@ -68,5 +68,4 @@
6969
7070
7171 /* View source */
72 -view_source( __FILE__ );
73 -close_demo();
\ No newline at end of file
 72+close_demo( __FILE__ );
Index: trunk/tools/ToolserverI18N/public_html/demo/demo7.php
@@ -18,5 +18,4 @@
1919
2020
2121 /* View source */
22 -view_source( __FILE__ );
23 -close_demo();
\ No newline at end of file
 22+close_demo( __FILE__ );
Index: trunk/tools/ToolserverI18N/public_html/demo/demo8.php
@@ -37,5 +37,4 @@
3838
3939
4040 /* View source */
41 -view_source( __FILE__ );
42 -close_demo();
\ No newline at end of file
 41+close_demo( __FILE__ );
Index: trunk/tools/ToolserverI18N/public_html/demo/demoBase.php
@@ -1,5 +1,5 @@
22 <?php
3 -error_reporting(E_ALL); ini_set('display_errors', 1);
 3+error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); date_default_timezone_set( 'UTC' );
44
55 /* Load Toolserver Intuition from the main directory */
66 require_once( dirname(dirname( __DIR__ )) . '/ToolStart.php' );
@@ -71,7 +71,9 @@
7272 $descr = htmlspecialchars( $descr );
7373 echo "<li><a href=\"$demoFilename.php\" title=\"$descr\">$demoFilename</a><br /><small>$descr</small></li>";
7474 }
75 -echo "</ul>$outputHead";
 75+echo '</ul>';
 76+echo $outputHead;
 77+echo '<div style="white-space: pre;">';
7678
7779
7880 // Output source-heading and source code
@@ -83,11 +85,13 @@
8486 }
8587
8688 // End of track
87 -function close_demo(){
 89+function close_demo( $file ) {
 90+ echo '</div>';
 91+ view_source( $file );
8892 echo '</body></html>';
8993 }
9094
9195 // Make this file viewable as well
9296 if( $thisFile == 'demoBase' ){
93 - view_source( __FILE__ );
 97+ close_demo( __FILE__ );
9498 }
\ No newline at end of file
Index: trunk/tools/ToolserverI18N/public_html/demo/demo1.php
@@ -11,5 +11,4 @@
1212
1313
1414 /* View source */
15 -view_source( __FILE__ );
16 -close_demo();
\ No newline at end of file
 15+close_demo( __FILE__ );
Index: trunk/tools/ToolserverI18N/public_html/demo/demo2.php
@@ -18,5 +18,4 @@
1919
2020
2121 /* View source */
22 -view_source( __FILE__ );
23 -close_demo();
\ No newline at end of file
 22+close_demo( __FILE__ );
Index: trunk/tools/ToolserverI18N/public_html/demo/demo3.php
@@ -21,5 +21,4 @@
2222
2323
2424 /* View source */
25 -view_source( __FILE__ );
26 -close_demo();
\ No newline at end of file
 25+close_demo( __FILE__ );
Index: trunk/tools/ToolserverI18N/public_html/demo/demo4.php
@@ -21,5 +21,4 @@
2222
2323
2424 /* View source */
25 -view_source( __FILE__ );
26 -close_demo();
 25+close_demo( __FILE__ );

Status & tagging log