r85398 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85397‎ | r85398 | r85399 >
Date:23:40, 4 April 2011
Author:krinkle
Status:deferred
Tags:
Comment:
clean up index.php
Modified paths:
  • /trunk/tools/ToolserverI18N/public_html/index.php (modified) (history)

Diff [purge]

Index: trunk/tools/ToolserverI18N/public_html/index.php
@@ -13,21 +13,23 @@
1414 */
1515
1616 /**
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.
2018 */
2119
2220
2321 /**
24 - * Localization
 22+ * Configuration
2523 * -------------------------------------------------
2624 */
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 */
2829 $opts = array(
29 - 'domain' => 'tsintuition',
30 - 'suppressnotices' => true, // DEBUG
 30+ 'domain' => 'TsIntuition',
 31+ //'suppressnotices' => false, // DEBUG
3132 );
 33+
3234 $I18N = new TsIntuition( $opts );
3335
3436 // Load all domains so can get some statistics later on and
@@ -36,39 +38,45 @@
3739 $I18N->loadTextdomain( $domainKey );
3840 }
3941
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 );
4545
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(
4949 'displayTitle' => _( 'fullname' ),
5050 'krinklePrefix' => false,
5151 '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>)",
5353 'revisionDate' => $I18N->dateFormatted( $svninfo['directory-up-date'] ),
5454 'styles' => array( 'main.css' ),
5555 );
5656
57 -$Tool = BaseTool::newFromArray( $toolConfig );
 57+$Tool = BaseTool::newFromArray( $opts );
5858
59 -$toolSettings = array(
60 - 'tabs' => array(),
61 -);
 59+/* Load Scripts & Styles */
6260
6361 // jQuery UI
6462 $jqueryui = $kgConf->getJQueryUI();
6563 $Tool->addScripts( $jqueryui['scripts'] );
6664 $Tool->addStyles( $jqueryui['styles'] );
6765
 66+/* Add initial stuff to <head> and <body> */
6867 $Tool->doHtmlHead();
6968 $Tool->doStartBodyWrapper();
7069
7170
7271 /**
 72+ * Tool settings
 73+ * -------------------------------------------------
 74+ */
 75+$toolSettings = array(
 76+ 'tabs' => array(),
 77+);
 78+
 79+
 80+/**
7381 * Post actions
7482 * -------------------------------------------------
7583 */
@@ -126,7 +134,7 @@
127135 $I18N->doRedirect();
128136
129137 /**
130 - * Body (Just a quick hack for proof-of-concept)
 138+ * Main content output
131139 * -------------------------------------------------
132140 */
133141 $Tool->addOut( _g( 'welcome' ), 'h2' );
@@ -257,6 +265,7 @@
258266
259267 $Tool->addOut( '</div><!-- #tsint-dashboard -->' );
260268
 269+
261270 /**
262271 * JavaScript init
263272 * -------------------------------------------------

Status & tagging log