r42952 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42951‎ | r42952 | r42953 >
Date:22:07, 31 October 2008
Author:btongminh
Status:old
Tags:
Comment:
* Add some quick i18n (please improve)
* Parse wikitext to html
Modified paths:
  • /trunk/extensions/CodeBrowse/CodeBrowse.i18n.php (added) (history)
  • /trunk/extensions/CodeBrowse/CodeBrowse.php (modified) (history)
  • /trunk/extensions/CodeBrowse/CodeBrowseItemView.php (modified) (history)
  • /trunk/extensions/CodeBrowse/CodeBrowseRepoListView.php (modified) (history)
  • /trunk/extensions/CodeBrowse/SpecialCodeBrowse.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeBrowse/CodeBrowseRepoListView.php
@@ -2,7 +2,9 @@
33
44 class CodeBrowseRepoListView extends CodeBrowseView {
55 function getContent() {
6 - return self::reallyGetContent();
 6+ global $wgOut;
 7+ return $wgOut->parse( self::reallyGetContent() );
 8+
79 }
810 static function reallyGetContent() {
911 $repos = CodeRepository::getRepoList();
Index: trunk/extensions/CodeBrowse/CodeBrowse.i18n.php
@@ -0,0 +1,17 @@
 2+<?php
 3+
 4+$messages = array();
 5+
 6+$messages['en'] = array(
 7+ 'code-log' => 'log', // Might want to move this to CodeReview
 8+
 9+ 'codebrowse' => 'CodeBrowse',
 10+ 'codebrowse-not-found' => 'Could not find file $1.',
 11+ 'codebrowse-dir-listing' => 'Directory index of $1',
 12+ 'codebrowse-name' => 'Name',
 13+ 'codebrowse-revision' => 'Revision',
 14+ 'codebrowse-lastchange' => 'Last modified date',
 15+ 'codebrowse-size' => 'Size',
 16+);
 17+
 18+
\ No newline at end of file
Property changes on: trunk/extensions/CodeBrowse/CodeBrowse.i18n.php
___________________________________________________________________
Added: svn:eol-style
119 + native
Index: trunk/extensions/CodeBrowse/CodeBrowse.php
@@ -16,3 +16,4 @@
1717 $wgAutoloadClasses['SpecialCodeBrowse'] = $dir.'/SpecialCodeBrowse.php';
1818 $wgSpecialPages['CodeBrowse'] = 'SpecialCodeBrowse';
1919
 20+$wgExtensionMessagesFiles['CodeBrowse'] = $dir . '/CodeBrowse.i18n.php';
Index: trunk/extensions/CodeBrowse/SpecialCodeBrowse.php
@@ -5,6 +5,8 @@
66 parent::__construct( 'CodeBrowse', 'codebrowse' );
77 }
88 function execute( $par = '' ) {
 9+ wfLoadExtensionMessages( 'CodeBrowse' );
 10+
911 $this->setHeaders();
1012
1113 global $wgRequest;
Index: trunk/extensions/CodeBrowse/CodeBrowseItemView.php
@@ -16,7 +16,7 @@
1717 $contents = $this->svn->getDirList( $this->mBasePath );
1818
1919 if ( !is_array( $contents ) )
20 - return ''; // FIXME
 20+ return wfMsgHtml( 'codebrowse-not-found', $this->mPath ); // FIXME
2121 if ( count( $contents ) == 1 && $contents[0]['type'] == 'file' ) {
2222 return $this->showFile();
2323 } else {
@@ -61,9 +61,14 @@
6262 function contentLine( $item ) {
6363 global $wgUser, $wgLang;
6464 $sk = $wgUser->getSkin();
 65+
 66+ $name = $item['name'];
 67+ if ( $item['type'] == 'dir' && substr( $name, -1 ) != '/' )
 68+ $name .= '/';
 69+
6570 return
6671 "\t<tr><td>".$sk->link( SpecialPage::getTitleFor( 'CodeBrowse' ),
67 - $item['name'], array(), array( 'path' => $this->mPath.$item['name'] )
 72+ $name, array(), array( 'path' => $this->mPath.$name )
6873 ).
6974 "</td><td>".$item['created_rev'].
7075 "</td><td>".$sk->link( SpecialPage::getTitleFor(

Status & tagging log