Index: /MediaWiki/trunk/FCKeditor.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditor.body.php	(revision 3229)
+++ /MediaWiki/trunk/FCKeditor.body.php	(revision 3230)
@@ -373,8 +373,12 @@
 
 		$showRef = false;
-		if (isset ($wgHooks['ParserFirstCallInit']) && (in_array('wfCite',$wgHooks['ParserFirstCallInit']) )){
+		if ( (isset($wgHooks['ParserFirstCallInit']) && in_array('wfCite',$wgHooks['ParserFirstCallInit'])) || (isset($wgExtensionFunctions) && in_array('wfCite',$wgExtensionFunctions)) ) {
 			$showRef = true;
-		}else if (isset ($wgExtensionFunctions) && (in_array('wfCite',$wgExtensionFunctions) )){
-			$showRef = true;
+		}
+
+		$showSource = false;
+		if ( (isset ($wgHooks['ParserFirstCallInit']) && in_array('efSyntaxHighlight_GeSHiSetup', $wgHooks['ParserFirstCallInit']))
+			|| (isset ($wgExtensionFunctions) && in_array('efSyntaxHighlight_GeSHiSetup', $wgExtensionFunctions)) ) {
+			$showSource = true;
 		}
 
@@ -401,4 +405,5 @@
 oFCKeditor.ready = true;
 oFCKeditor.Config["showreferences"] = '.(($showRef)?'true':'false').';
+oFCKeditor.Config["showsource"] = '.(($showSource)?'true':'false').';
 ';
 		$script .= '</script>';
Index: /MediaWiki/trunk/FCKeditorParser.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditorParser.body.php	(revision 3229)
+++ /MediaWiki/trunk/FCKeditorParser.body.php	(revision 3230)
@@ -65,5 +65,5 @@
 	*/
 	function fck_genericTagHook( $str, $argv, $parser ) {
-		if (in_array($this->fck_mw_taghook, array("ref", "math", "references"))) {
+		if (in_array($this->fck_mw_taghook, array("ref", "math", "references", "source"))) {
 			$class = $this->fck_mw_taghook;
 		}
@@ -107,5 +107,5 @@
 		}
 		else {
-			$ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
+			$ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\"";
 			foreach ($argv as $key=>$value) {
 				$ret .= " ".$key."=\"".$value."\"";
@@ -154,9 +154,11 @@
 		$generalItems = array();
 
-		$elements = array_merge(
-		array( 'nowiki', 'gallery', 'math' ),
-		array_keys( $this->mTagHooks ) );
-		if ((isset ($wgHooks['ParserFirstCallInit']) && (in_array('wfCite', $wgHooks['ParserFirstCallInit']) ))
-			|| (isset ($wgExtensionFunctions) && (in_array('wfCite', $wgExtensionFunctions) ))){
+		$elements = array_merge( array( 'nowiki', 'gallery', 'math' ), array_keys( $this->mTagHooks ) );
+		if ( (isset($wgHooks['ParserFirstCallInit']) && in_array('efSyntaxHighlight_GeSHiSetup', $wgHooks['ParserFirstCallInit']))
+			|| (isset($wgExtensionFunctions) && in_array('efSyntaxHighlight_GeSHiSetup', $wgExtensionFunctions)) ) {
+			$elements = array_merge( $elements, array( 'source' ) );
+		}
+		if ( (isset($wgHooks['ParserFirstCallInit']) && in_array('wfCite', $wgHooks['ParserFirstCallInit']))
+			|| (isset($wgExtensionFunctions) && in_array('wfCite', $wgExtensionFunctions)) ) {
 			$elements = array_merge( $elements, array( 'ref', 'references' ) );
 		}
@@ -202,4 +204,7 @@
 					case 'ref':
 						$output = $this->fck_wikiTag('ref', $content, $params);
+						break;
+					case 'source':
+						$output = $this->fck_wikiTag('source', $content, $params);
 						break;
 					case 'html':
Index: /MediaWiki/trunk/fckeditor_config.js
===================================================================
--- /MediaWiki/trunk/fckeditor_config.js	(revision 3229)
+++ /MediaWiki/trunk/fckeditor_config.js	(revision 3230)
@@ -13,5 +13,5 @@
 	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
 	['SpecialChar','Table','Image','Rule'],
-	['MW_Template','MW_Special','MW_Ref','MW_References','MW_Math','MW_Signature','MW_Category'],
+	['MW_Template','MW_Special','MW_Ref','MW_References','MW_Source','MW_Math','MW_Signature','MW_Category'],
 	'/',
 	['FontFormat'],
@@ -39,5 +39,5 @@
 
 FCKConfig.EditorAreaStyles = '\
-.FCK__MWTemplate, .FCK__MWRef, .FCK__MWSignature, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWMath, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude, .FCK__MWGallery \
+.FCK__MWTemplate, .FCK__MWSource, .FCK__MWRef, .FCK__MWSignature, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWMath, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude, .FCK__MWGallery \
 { \
 	border: 1px dotted #00F; \
@@ -45,4 +45,10 @@
 	background-repeat: no-repeat; \
 	vertical-align: middle; \
+} \
+.FCK__MWSource \
+{ \
+	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_source.gif); \
+	width: 59px; \
+	height: 15px; \
 } \
 .FCK__MWTemplate \
Index: /MediaWiki/trunk/plugins/mediawiki/dialogs/source.html
===================================================================
--- /MediaWiki/trunk/plugins/mediawiki/dialogs/source.html	(revision 3230)
+++ /MediaWiki/trunk/plugins/mediawiki/dialogs/source.html	(revision 3230)
@@ -0,0 +1,137 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Link dialog window.
+-->
+<html>
+<head>
+	<title>Source Properties</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<meta name="robots" content="noindex, nofollow" />
+	<script type="text/javascript">
+
+var oEditor		= window.parent.InnerDialogLoaded() ;
+var FCK			= oEditor.FCK ;
+var FCKLang		= oEditor.FCKLang ;
+var FCKConfig	= oEditor.FCKConfig ;
+var FCKRegexLib	= oEditor.FCKRegexLib ;
+var FCKTools	= oEditor.FCKTools ;
+
+document.write( '<script src="' + FCKConfig.BasePath + 'dialog/common/fck_dialog_common.js" type="text/javascript"><\/script>' ) ;
+
+	</script>
+	<script type="text/javascript">
+
+// Get the selected flash embed (if available).
+var oFakeImage = FCK.Selection.GetSelectedElement() ;
+var oSource ;
+
+if ( oFakeImage )
+{
+	if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fck_mw_source') )
+	{
+		oSource = FCK.GetRealElement( oFakeImage ) ;
+	}
+	else
+	{
+		oFakeImage = null ;
+	}
+}
+
+window.onload = function()
+{
+	// Translate the dialog box texts.
+	oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+	// Load the selected link information (if any).
+	LoadSelection() ;
+
+	// Activate the "OK" button.
+	window.parent.SetOkButton( true ) ;
+	window.parent.SetAutoSize( true ) ;
+}
+
+function LoadSelection()
+{
+	if ( !oSource ) return ;
+
+	GetE('xSourceText').value = FCKTools.HTMLDecode( oSource.innerHTML ).replace(/fckLR/g,'\r\n').replace( /&quot;/g, '"' );
+	GetE('xSourceLang').value = oSource.getAttribute( 'lang' ) ;
+}
+
+//#### The OK button was hit.
+function Ok()
+{
+	var supportedLanguages = ',abap,actionscript,actionscript3,ada,apache,applescript,apt_sources,asm,asp,autoit,avisynth,bash,basic4gl,bf,blitzbasic,bnf,boo,c,c_mac,caddcl,cadlisp,cfdg,cfm,cil,cobol,cpp,cpp-qt,csharp,css,d,delphi,diff,div,dos,dot,eiffel,email,fortran,freebasic,genero,gettext,glsl,gml,gnuplot,groovy,haskell,hq9plus,html4strict,idl,ini,inno,intercal,io,java,java5,javascript,kixtart,klonec,klonecpp,latex,lisp,lolcode,lotusformulas,lotusscript,lscript,lua,m68k,make,matlab,mirc,mpasm,mxml,mysql,nsis,objc,ocaml,ocaml-brief,oobas,oracle11,oracle8,pascal,per,perl,php,php-brief,pic16,pixelbender,plsql,povray,powershell,progress,prolog,providex,python,qbasic,rails,reg,robots,ruby,sas,scala,scheme,scilab,sdlbasic,smalltalk,smarty,sql,tcl,teraterm,text,thinbasic,tsql,typoscript,vb,vbnet,verilog,vhdl,vim,visualfoxpro,visualprolog,whitespace,winbatch,xml,xorg_conf,xpp,z80,';
+
+	if ( !oSource )
+	{
+		oSource = FCK.EditorDocument.createElement( 'SPAN' ) ;
+		oSource.className = 'fck_mw_source' ;
+	}
+
+	var sourceData = FCKTools.HTMLEncode(GetE('xSourceText').value.Trim().replace(/(\r\n|\n)/g, 'fckLR')).replace( /"/g, '&quot;' ) ;
+	var lang = GetE('xSourceLang').value.Trim().toLowerCase();
+
+	if ( lang.length && supportedLanguages.indexOf( ',' + lang + ',' ) == -1) {
+		alert( (FCKLang.wikiUnsupportedLanguage || 'Unsupported language: %1').replace(/%1/, lang) );
+		return false;
+	}
+
+	oSource.innerHTML = sourceData ;
+	oSource.setAttribute( 'lang', lang ) ;
+
+	if ( !oFakeImage )
+	{
+		oFakeImage	= oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__MWSource', oSource ) ;
+		oFakeImage.setAttribute( '_fck_mw_source', 'true', 0 ) ;
+		oFakeImage	= FCK.InsertElement( oFakeImage ) ;
+	}
+
+	return true ;
+}
+
+	</script>
+</head>
+<body style="overflow: hidden">
+	<div id="divInfo">
+		<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
+			<tr>
+				<td>
+					<span fcklang="wikiSourceCode">Source Code</span>
+				</td>
+			</tr>
+			<tr>
+				<td height="100%">
+					<textarea wrap=OFF id="xSourceText" style="width: 100%; height: 100%; font-family: Monospace"
+						cols="50" rows="5"></textarea>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					<span fcklang="wikiSourceLanguage">Source Language</span><br />
+					<input id="xSourceLang" type="text" size="15" />
+				</td>
+			</tr>
+		</table>
+	</div>
+</body>
+</html>
Index: /MediaWiki/trunk/plugins/mediawiki/fckplugin.js
===================================================================
--- /MediaWiki/trunk/plugins/mediawiki/fckplugin.js	(revision 3229)
+++ /MediaWiki/trunk/plugins/mediawiki/fckplugin.js	(revision 3230)
@@ -99,4 +99,13 @@
 FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ;
 
+tbButton = new FCKToolbarButton( 'MW_Source', 'Source', FCKLang.wikiBtnSourceCode || 'Insert/Edit Source Code' ) ;
+tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_source.gif' ;
+FCKToolbarItems.RegisterItem( 'MW_Source', tbButton ) ;
+if ( !FCKConfig.showsource ) {	//hack to disable MW_Source  button
+	tbButton.Create = function()		{return 0;}
+	tbButton.Disable  = function()	{return 0;}
+	tbButton.RefreshState  = function()	{return 0;}
+}
+
 tbButton = new FCKToolbarButton( 'MW_Special', 'Special Tag', FCKLang.wikiBtnSpecial || 'Insert/Edit Special Tag' ) ;
 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_special.gif' ;
@@ -112,4 +121,5 @@
 FCKCommands.RegisterCommand( 'MW_Math', new FCKDialogCommand( 'MW_Math', ( FCKLang.wikiCmdFormula || 'Formula' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/math.html', 400, 300 ) ) ;
 FCKCommands.RegisterCommand( 'MW_Special', new FCKDialogCommand( 'MW_Special', ( FCKLang.wikiCmdSpecial || 'Special Tag Properties' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/special.html', 400, 330 ) ) ;
+FCKCommands.RegisterCommand( 'MW_Source', new FCKDialogCommand( 'MW_Source', ( FCKLang.wikiCmdSourceCode || 'Source Code Properties' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/source.html', 720, 380 ) ) ;
 FCKCommands.RegisterCommand( 'Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/link.html', 400, 250 ) ) ;
 FCKCommands.RegisterCommand( 'MW_Category', new FCKDialogCommand( 'MW_Category', ( FCKLang.wikiCmdCategories || 'Categories' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/category.html', 400, 500 ) ) ;
@@ -602,4 +612,14 @@
 							switch ( htmlNode.className )
 							{
+								case 'fck_mw_source' :
+									var refLang = htmlNode.getAttribute( 'lang' ) ;
+
+									stringBuilder.push( '<source' ) ;
+									stringBuilder.push( ' lang="' + refLang + '"' ) ;
+									stringBuilder.push( '>' ) ;
+									stringBuilder.push( FCKTools.HTMLDecode(htmlNode.innerHTML).replace(/fckLR/g,'\r\n') ) ;
+									stringBuilder.push( '</source>' ) ;
+									return ;
+
 								case 'fck_mw_ref' :
 									var refName = htmlNode.getAttribute( 'name' ) ;
@@ -984,6 +1004,9 @@
 		switch ( eSpan.className )
 		{
+			case 'fck_mw_source' :
+				className = 'FCK__MWSource' ;
 			case 'fck_mw_ref' :
-				className = 'FCK__MWRef' ;
+				if (className == null)
+					className = 'FCK__MWRef' ;
 			case 'fck_mw_references' :
 				if ( className == null )
@@ -1095,4 +1118,9 @@
 				contextMenu.AddItem( 'MW_Special', 'Edit HTML code' ) ;
 			}
+			if ( tag.getAttribute( '_fck_mw_source' ) )
+			{
+				contextMenu.AddSeparator() ;
+				contextMenu.AddItem( 'MW_Source', FCKLang.wikiMnuSourceCode || 'Source Code Properties' ) ;
+			}
 			if ( tag.getAttribute( '_fck_mw_math' ) )
 			{
Index: /MediaWiki/trunk/plugins/mediawiki/lang/en.js
===================================================================
--- /MediaWiki/trunk/plugins/mediawiki/lang/en.js	(revision 3229)
+++ /MediaWiki/trunk/plugins/mediawiki/lang/en.js	(revision 3230)
@@ -10,7 +10,8 @@
 FCKLang.wikiBtnTemplate				= 'Insert/Edit Template';
 FCKLang.wikiBtnReference			= 'Insert/Edit Reference';
-FCKLang.wikiBtnReference			= 'Insert <references /> tag';
+FCKLang.wikiBtnReferences			= 'Insert <references /> tag';
 FCKLang.wikiBtnFormula				= 'Insert/Edit Formula';
 FCKLang.wikiBtnSpecial				= 'Insert/Edit Special Tag';
+FCKLang.wikiBtnSourceCode			= 'Insert/Edit Source Code';
 FCKLang.wikiBtnSignature			= 'Insert signature';
 FCKLang.wikiCmdTemplate				= 'Template Properties';
@@ -30,5 +31,9 @@
 FCKLang.wikiMnuFormula				= 'Edit Formula';
 FCKLang.wikiCmdSpecial				= 'Special Tag Properties';
+FCKLang.wikiCmdSourceCode			= 'Source Code Properties';
 FCKLang.wikiMnuSpecial				= 'Special Tag Properties';
+FCKLang.wikiMnuSourceCode			= 'Edit source code';
+FCKLang.wikiSourceCode				= 'Source Code';
+FCKLang.wikiSourceLanguage			= 'Source Language';
 
 FCKLang.wikiImgFileName				= 'Image file name';
@@ -79,4 +84,6 @@
 FCKLang.wikiTmpsel						= '(Pick up a template manual here)';
 
+FCKLang.wikiUnsupportedLanguage			= 'Unsupported language: %1';
+
 FCKLang.DplHelp								= 'DPL stands for Dynamic Page List, and allows to generate a formatted list of pages based on selection criteria. See %link for details';
 FCKLang.inputboxHelp					= 'Inputbox allows to create a form for users to create new pages. The new pages edit box can be pre-loaded with any template. See %link for details';
Index: /MediaWiki/trunk/plugins/mediawiki/lang/pl.js
===================================================================
--- /MediaWiki/trunk/plugins/mediawiki/lang/pl.js	(revision 3229)
+++ /MediaWiki/trunk/plugins/mediawiki/lang/pl.js	(revision 3230)
@@ -10,8 +10,9 @@
 FCKLang.wikiBtnTemplate				= 'Wstaw/edytuj szablon';
 FCKLang.wikiBtnReference			= 'Wstaw/edytuj przypis';
-FCKLang.wikiBtnReference			= 'Wstaw znacznik <references />';
+FCKLang.wikiBtnReferences			= 'Wstaw znacznik <references />';
 FCKLang.wikiBtnFormula				= 'Wstaw/edytuj formułę matematyczną';
 FCKLang.wikiBtnSpecial				= 'Wstaw/edytuj specialny znacznik';
 FCKLang.wikiBtnSignature			= 'Wstaw sygnaturkę';
+FCKLang.wikiBtnSourceCode			= 'Wstaw/edytuj kod źródłowy programu';
 FCKLang.wikiCmdTemplate				= 'Właściwości szablonu';
 FCKLang.wikiCmdReference			= 'Właściwości przypisu';
@@ -30,5 +31,9 @@
 FCKLang.wikiMnuFormula				= 'Właściwości formuły matematycznej';
 FCKLang.wikiCmdSpecial				= 'Właściwości specialnego znacznika';
+FCKLang.wikiCmdSourceCode			= 'Właściwości kodu źródłowego';
 FCKLang.wikiMnuSpecial				= 'Edytuj specialny znacznik';
+FCKLang.wikiMnuSourceCode			= 'Edytuj kod źródłowy';
+FCKLang.wikiSourceCode				= 'Kod źródłowy';
+FCKLang.wikiSourceLanguage			= 'Język programowania';
 
 FCKLang.wikiImgFileName				= 'Nazwa obrazka';
@@ -79,4 +84,6 @@
 FCKLang.wikiTmpsel						= '(Wybierz z listy)';
 
+FCKLang.wikiUnsupportedLanguage			= 'Nieprawidłowy język programowania: %1';
+
 FCKLang.DplHelp								= 'Dynamic Page List pozwala na generowanie formatowanych list stron bazując na podanych kryteriach Zobacz %link aby dowiedzieć się więcej';;
 FCKLang.inputboxHelp					= 'Inputbox pozwala na stworzenie formularza dla użytkowników do tworzenia nowych stron. Zobacz %link aby dowiedzieć się więcej';
