MediaWiki SVN Patch: Difference between revisions

From BlueM
Jump to navigation Jump to search
(MediaWiki SVN Patch)
 
mNo edit summary
Line 61: Line 61:
  'rfcurl' =>  'http://www.ietf.org/rfc/rfc$1.txt',
  'rfcurl' =>  'http://www.ietf.org/rfc/rfc$1.txt',
+'bugurl' => '/bugzilla/show_bug.cgi?id=$1',
+'bugurl' => '/bugzilla/show_bug.cgi?id=$1',
+'revurl' => '/viewvc/viewvc.cgi/BlauesModell/BlauesModell/trunk/?pathrev=$1',
+'revurl' => '/viewvc/BlueM/trunk/?pathrev=$1',
  'pubmedurl' =>  'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=$1',
  'pubmedurl' =>  'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=$1',
  'alphaindexline' => "$1 to $2",
  'alphaindexline' => "$1 to $2",
  'version' => 'Version',
  'version' => 'Version',
</diff>
</diff>

Revision as of 06:45, 11 May 2007

Patch für die registrierung der magischen Wörter Bug (→ Bugzilla) und Rev oder Rev. (→ ViewVC) in der MediaWiki-Installation (Idee von hier).

<diff> Index: includes/Parser.php

=======================================================

--- includes/Parser.php (revision 20837) +++ includes/Parser.php (working copy) @@ -1050,7 +1050,9 @@

                                     (?: 97[89] [\ \-]? )?   # optional 13-digit ISBN prefix
                                     (?: [0-9]  [\ \-]? ){9} # 9 digits with opt. delimiters
                                     [0-9Xx]                 # check digit

- \b) + \b) | + Bug\s+(\d+) | # Bug numbers as m[3] + Rev\.?\s+(\d+) # Rev numbers as m[4]

			)!x', array( &$this, 'magicLinkCallback' ), $text );
		wfProfileOut( __METHOD__ );
		return $text;

@@ -1060,7 +1062,8 @@

		if ( substr( $m[0], 0, 1 ) == '<' ) {
			# Skip HTML element
			return $m[0];

- } elseif ( substr( $m[0], 0, 4 ) == 'ISBN' ) { + } + elseif ( substr( $m[0], 0, 4 ) == 'ISBN' ) {

			$isbn = $m[2];
			$num = strtr( $isbn, array(
				'-' => ,

@@ -1071,7 +1074,8 @@

			$text = '<a href="' .
				$titleObj->escapeLocalUrl( "isbn=$num" ) .
				"\" class=\"internal\">ISBN $isbn</a>";

- } else { + } + else {

			if ( substr( $m[0], 0, 3 ) == 'RFC' ) {
				$keyword = 'RFC';
				$urlmsg = 'rfcurl';

@@ -1080,6 +1084,14 @@

				$keyword = 'PMID';
				$urlmsg = 'pubmedurl';
				$id = $m[1];

+ } else if ( substr( $m[0], 0, 3 ) == 'Bug' ) { + $keyword = 'Bug'; + $urlmsg = 'bugurl'; + $id = $m[3]; + } else if ( substr( $m[0], 0, 3 ) == 'Rev' ) { + $keyword = 'Rev'; + $urlmsg = 'revurl'; + $id = $m[4];

			} else {
				throw new MWException( __METHOD__.': unrecognised match type "' .
					substr($m[0], 0, 20 ) . '"' );

Index: languages/messages/MessagesEn.php

=======================================================

--- languages/messages/MessagesEn.php (revision 20837) +++ languages/messages/MessagesEn.php (working copy) @@ -1544,6 +1544,8 @@

'isbn'	=> 'ISBN',
'rfcurl' =>  'http://www.ietf.org/rfc/rfc$1.txt',

+'bugurl' => '/bugzilla/show_bug.cgi?id=$1', +'revurl' => '/viewvc/BlueM/trunk/?pathrev=$1',

'pubmedurl' =>  'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=$1',
'alphaindexline' => "$1 to $2",
'version'		=> 'Version',

</diff>