Index: trunk/tools/ToolserverI18N/public_html/index.php |
— | — | @@ -13,21 +13,23 @@ |
14 | 14 | */ |
15 | 15 | |
16 | 16 | /** |
17 | | - * This file outputs the interface to set settings for TsIntuition |
18 | | - * @TODO: Make this nicer, for now just a quick hack to make |
19 | | - * setting cookies work. |
| 17 | + * This file outputs the interface to set settings for TsIntuition. |
20 | 18 | */ |
21 | 19 | |
22 | 20 | |
23 | 21 | /** |
24 | | - * Localization |
| 22 | + * Configuration |
25 | 23 | * ------------------------------------------------- |
26 | 24 | */ |
27 | | -require_once( '/home/krinkle/TsIntuition/ToolStart.php' ); // to be moved to p_i18n |
| 25 | +require_once( '/home/krinkle/common/InitTool.php' ); // BaseTool |
| 26 | +require_once( '/home/krinkle/TsIntuition/ToolStart.php' ); // TsIntuition |
| 27 | + |
| 28 | +/* Initialize TsIntuition */ |
28 | 29 | $opts = array( |
29 | | - 'domain' => 'tsintuition', |
30 | | - 'suppressnotices' => true, // DEBUG |
| 30 | + 'domain' => 'TsIntuition', |
| 31 | + //'suppressnotices' => false, // DEBUG |
31 | 32 | ); |
| 33 | + |
32 | 34 | $I18N = new TsIntuition( $opts ); |
33 | 35 | |
34 | 36 | // Load all domains so can get some statistics later on and |
— | — | @@ -36,39 +38,45 @@ |
37 | 39 | $I18N->loadTextdomain( $domainKey ); |
38 | 40 | } |
39 | 41 | |
40 | | -/** |
41 | | - * Configuration |
42 | | - * ------------------------------------------------- |
43 | | - */ |
44 | | -require_once( '/home/krinkle/common/InitTool.php' ); |
| 42 | +$svninfo = kfGetSvnInfo( TS_INTUITION ); // parses .svn/entries |
| 43 | +$revUrlQuery = array( 'path' => $svninfo['directory-path'] ); |
| 44 | +$revUrl = $svninfo['directory-cr-rev'] . '?' . http_build_query( $revUrlQuery ); |
45 | 45 | |
46 | | -$svninfo = kfGetSvnInfo( '/home/krinkle/TsIntuition/' ); // parses .svn/entries |
47 | | -$revUrlQuery = array( 'path' => $svninfo['directory-path'] ); |
48 | | -$toolConfig = array( |
| 46 | + |
| 47 | +/* Initialize BaseTool */ |
| 48 | +$opts = array( |
49 | 49 | 'displayTitle' => _( 'fullname' ), |
50 | 50 | 'krinklePrefix' => false, |
51 | 51 | 'simplePath' => '/TsIntuition/', |
52 | | - 'revisionId' => "0.1.1 (<a target=\"blank\" href=\"{$svninfo['directory-cr-rev']}?" . http_build_query($revUrlQuery) . "\">r{$svninfo['directory-rev']}</a>)", |
| 52 | + 'revisionId' => "0.1.1 (<a target=\"blank\" href=\"$revUrl\">r{$svninfo['directory-rev']}</a>)", |
53 | 53 | 'revisionDate' => $I18N->dateFormatted( $svninfo['directory-up-date'] ), |
54 | 54 | 'styles' => array( 'main.css' ), |
55 | 55 | ); |
56 | 56 | |
57 | | -$Tool = BaseTool::newFromArray( $toolConfig ); |
| 57 | +$Tool = BaseTool::newFromArray( $opts ); |
58 | 58 | |
59 | | -$toolSettings = array( |
60 | | - 'tabs' => array(), |
61 | | -); |
| 59 | +/* Load Scripts & Styles */ |
62 | 60 | |
63 | 61 | // jQuery UI |
64 | 62 | $jqueryui = $kgConf->getJQueryUI(); |
65 | 63 | $Tool->addScripts( $jqueryui['scripts'] ); |
66 | 64 | $Tool->addStyles( $jqueryui['styles'] ); |
67 | 65 | |
| 66 | +/* Add initial stuff to <head> and <body> */ |
68 | 67 | $Tool->doHtmlHead(); |
69 | 68 | $Tool->doStartBodyWrapper(); |
70 | 69 | |
71 | 70 | |
72 | 71 | /** |
| 72 | + * Tool settings |
| 73 | + * ------------------------------------------------- |
| 74 | + */ |
| 75 | +$toolSettings = array( |
| 76 | + 'tabs' => array(), |
| 77 | +); |
| 78 | + |
| 79 | + |
| 80 | +/** |
73 | 81 | * Post actions |
74 | 82 | * ------------------------------------------------- |
75 | 83 | */ |
— | — | @@ -126,7 +134,7 @@ |
127 | 135 | $I18N->doRedirect(); |
128 | 136 | |
129 | 137 | /** |
130 | | - * Body (Just a quick hack for proof-of-concept) |
| 138 | + * Main content output |
131 | 139 | * ------------------------------------------------- |
132 | 140 | */ |
133 | 141 | $Tool->addOut( _g( 'welcome' ), 'h2' ); |
— | — | @@ -257,6 +265,7 @@ |
258 | 266 | |
259 | 267 | $Tool->addOut( '</div><!-- #tsint-dashboard -->' ); |
260 | 268 | |
| 269 | + |
261 | 270 | /** |
262 | 271 | * JavaScript init |
263 | 272 | * ------------------------------------------------- |