Index: trunk/tools/ToolserverI18N/public_html/sandbox.php |
— | — | @@ -0,0 +1,19 @@ |
| 2 | +<?php |
| 3 | +/* Load Toolserver Intuition */ |
| 4 | +require_once( '/home/krinkle/TsIntuition/ToolStart.php' ); |
| 5 | + |
| 6 | + |
| 7 | +// Output-header |
| 8 | +echo '<h3 style="margin: 8px 0px 5px 0px; border-bottom: 1px solid #AAA;">Output</h3>'; |
| 9 | + |
| 10 | + |
| 11 | +// Source |
| 12 | +function view_source( $file ) { |
| 13 | + echo '<h3 style="margin: 8px 0px 5px 0px; border-bottom: 1px solid #AAA;">Source</h3>' |
| 14 | + . '<pre style="background: #f2f2f2; padding: 5px 8px; border: 1px solid #CCC;">' |
| 15 | + . htmlspecialchars( file_get_contents( $file ) ) |
| 16 | + . '</pre>'; |
| 17 | +} |
| 18 | + |
| 19 | + |
| 20 | +if(basename($_SERVER['SCRIPT_NAME'])=='sandbox.php') view_source( __FILE__ ); |
\ No newline at end of file |
Property changes on: trunk/tools/ToolserverI18N/public_html/sandbox.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 21 | + native |
Index: trunk/tools/ToolserverI18N/public_html/sandbox1.php |
— | — | @@ -0,0 +1,15 @@ |
| 2 | +<?php |
| 3 | +/* Config */ |
| 4 | +require_once( 'sandbox.php' ); |
| 5 | + |
| 6 | + |
| 7 | +/* Demonstration */ |
| 8 | +// 1) Init $I18N |
| 9 | +$I18N = new TsIntuition( 'general' /* name of textdomain here */ ); |
| 10 | + |
| 11 | +// 2) Get message |
| 12 | +echo $I18N->msg( 'welcome' ); |
| 13 | + |
| 14 | + |
| 15 | +/* View source */ |
| 16 | +view_source( __FILE__ ); |
\ No newline at end of file |
Property changes on: trunk/tools/ToolserverI18N/public_html/sandbox1.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 17 | + native |
Index: trunk/tools/ToolserverI18N/public_html/sandbox2.php |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?php |
| 3 | +/* Config */ |
| 4 | +require_once( 'sandbox.php' ); |
| 5 | + |
| 6 | + |
| 7 | +/* Demonstration */ |
| 8 | + |
| 9 | +// 1) Init TsIntuition |
| 10 | +$options = array( |
| 11 | + 'domain' => 'tsintuition', |
| 12 | + |
| 13 | + // Show notices |
| 14 | + 'suppressnotices' => false, |
| 15 | +); |
| 16 | +$I18N = new TsIntuition( $options ); |
| 17 | + |
| 18 | +// 2) Request an undefined message |
| 19 | +// Because 'suppressnotices' is false, |
| 20 | +// this will trigger a Notice: 'r4nd0mstr1n9' undefined |
| 21 | +echo $I18N->msg( 'r4nd0mstr1n9' ); |
| 22 | + |
| 23 | + |
| 24 | +/* View source */ |
| 25 | +view_source( __FILE__ ); |
\ No newline at end of file |
Property changes on: trunk/tools/ToolserverI18N/public_html/sandbox2.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 26 | + native |
Index: trunk/tools/ToolserverI18N/public_html/sandbox3.php |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?php |
| 3 | +/* Config */ |
| 4 | +require_once( 'sandbox.php' ); |
| 5 | + |
| 6 | + |
| 7 | +/* Demonstration */ |
| 8 | + |
| 9 | +// 1) Init TsIntuition |
| 10 | +$options = array( |
| 11 | + 'domain' => 'tsintuition', |
| 12 | + |
| 13 | + // Hide any kind of warning sign, errors, fatals and never call die |
| 14 | + 'suppresserrors' => true, |
| 15 | +); |
| 16 | +$I18N = new TsIntuition( $options ); |
| 17 | + |
| 18 | +// 2) Request an undefined message |
| 19 | +// Because 'suppresserrors' is true, |
| 20 | +// this will display "R4nd0mstr1n9" instead of [r4nd0mstr1n9] |
| 21 | +echo $I18N->msg( 'r4nd0mstr1n9' ); |
| 22 | + |
| 23 | + |
| 24 | +/* View source */ |
| 25 | +view_source( __FILE__ ); |
Property changes on: trunk/tools/ToolserverI18N/public_html/sandbox3.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 26 | + native |
Index: trunk/tools/ToolserverI18N/public_html/sandbox4.php |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +<?php |
| 3 | +/* Config */ |
| 4 | +require_once( 'sandbox.php' ); |
| 5 | +$I18N = new TsIntuition( 'general' ); |
| 6 | + |
| 7 | + |
| 8 | +/* Demonstration */ |
| 9 | +echo $I18N->dashboardBacklink(); |
| 10 | +echo $I18N->getPromoBox(); |
| 11 | +echo $I18N->getFooterLine(); |
| 12 | + |
| 13 | + |
| 14 | +/* View source */ |
| 15 | +view_source( __FILE__ ); |
Property changes on: trunk/tools/ToolserverI18N/public_html/sandbox4.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |