Index: Article.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/Article.php,v
retrieving revision 1.101
diff -c -r1.101 Article.php
*** Article.php	1 Nov 2002 13:35:31 -0000	1.101
--- Article.php	7 Nov 2002 11:41:44 -0000
***************
*** 329,335 ****
  	function editForm( $formtype )
  	{
  		global $wgOut, $wgUser, $wgTitle;
! 		global $wpTextbox1, $wpSummary, $wpSave, $wpPreview;
  		global $wpMinoredit, $wpEdittime, $wpTextbox2, $wpCountable;
  		global $oldid, $redirect;
  
--- 329,336 ----
  	function editForm( $formtype )
  	{
  		global $wgOut, $wgUser, $wgTitle;
! 		global $wpTextbox1, $wpSummary, $wpWatchthis;
! 		global $wpSave, $wpPreview;
  		global $wpMinoredit, $wpEdittime, $wpTextbox2, $wpCountable;
  		global $oldid, $redirect;
  
***************
*** 362,368 ****
  					return;
  				}
  				$this->mCountAdjustment = $this->isCountable( $wpTextbox1 );
! 				$this->insertNewArticle( $wpTextbox1, $wpSummary, $wpMinoredit );
  				return;
  			}
  			# Article exists. Check for edit conflict.
--- 363,369 ----
  					return;
  				}
  				$this->mCountAdjustment = $this->isCountable( $wpTextbox1 );
! 				$this->insertNewArticle( $wpTextbox1, $wpSummary, $wpMinoredit, $wpWatchthis );
  				return;
  			}
  			# Article exists. Check for edit conflict.
***************
*** 381,387 ****
  
  				$this->mCountAdjustment = $this->isCountable( $wpTextbox1 ) -
  				  $wpCountable;
! 				$this->updateArticle( $wpTextbox1, $wpSummary, $wpMinoredit );
  				return;
  			}
  		}
--- 382,388 ----
  
  				$this->mCountAdjustment = $this->isCountable( $wpTextbox1 ) -
  				  $wpCountable;
! 				$this->updateArticle( $wpTextbox1, $wpSummary, $wpMinoredit, $wpWatchthis );
  				return;
  			}
  		}
***************
*** 425,432 ****
  		if ( "no" == $redirect ) { $q .= "&redirect=no"; }
  		$action = wfEscapeHTML( wfLocalUrl( $wgTitle->getPrefixedURL(), $q ) );
  
! 		$summary = wfMsg( "summary" );
  		$minor = wfMsg( "minoredit" );
  		$save = wfMsg( "savearticle" );
  		$prev = wfMsg( "showpreview" );
  
--- 426,434 ----
  		if ( "no" == $redirect ) { $q .= "&redirect=no"; }
  		$action = wfEscapeHTML( wfLocalUrl( $wgTitle->getPrefixedURL(), $q ) );
  
! 		$summary = wfMsg( "summary" );		
  		$minor = wfMsg( "minoredit" );
+ 		$watchthis = wfMsg ("watchthis");
  		$save = wfMsg( "savearticle" );
  		$prev = wfMsg( "showpreview" );
  
***************
*** 440,445 ****
--- 442,462 ----
  		$wpTextbox1 = wfEscapeHTML( $wpTextbox1 );
  		$wpTextbox2 = wfEscapeHTML( $wpTextbox2 );
  		$wpSummary = wfEscapeHTML( $wpSummary );
+ 		
+ 		// activate checkbox if user wants it to be always active
+ 		if ($wgUser->getOption("watchdefault")) $wpWatchthis=1;
+ 		
+ 		// activate checkbox also if user is already watching the page,
+ 		// require wpWatchthis to be unset so that second condition is not
+ 		// checked unnecessarily
+ 		if (!$wpWatchthis && !$wpPreview && $wgTitle->userIsWatching()) $wpWatchthis=1;
+ 		
+ 		if ( 0 != $wgUser->getID() ) {
+ 		
+ 			$watchhtml="<input tabindex=4 type=checkbox name='wpWatchthis'".($wpWatchthis?" checked":"").">{$watchthis}<br>";
+ 		} else {
+ 			$watchhtml="<br>";
+ 		}
  
  		$wgOut->addHTML( "
  <form method=post action=\"$action\"
***************
*** 448,456 ****
  {$wpTextbox1}
  </textarea><br>
  {$summary}: <input tabindex=2 type=text value=\"{$wpSummary}\" name='wpSummary' maxlength=200>
! <input tabindex=3 type=checkbox value=1 name='wpMinoredit'".($wpMinoredit?" checked":"").">{$minor}<br>
! <input tabindex=4 type=submit value=\"{$save}\" name='wpSave'>
! <input tabindex=5 type=submit value=\"{$prev}\" name='wpPreview'>
  <em>{$cancel}</em> | <em>{$edithelp}</em>
  <br><br>{$copywarn}
  <input type=hidden value=\"{$wpEdittime}\" name='wpEdittime'>
--- 465,474 ----
  {$wpTextbox1}
  </textarea><br>
  {$summary}: <input tabindex=2 type=text value=\"{$wpSummary}\" name='wpSummary' maxlength=200>
! <input tabindex=3 type=checkbox value=1 name='wpMinoredit'".($wpMinoredit?" checked":"").">{$minor}
! {$watchhtml}
! <input tabindex=5 type=submit value=\"{$save}\" name='wpSave'>
! <input tabindex=6 type=submit value=\"{$prev}\" name='wpPreview'>
  <em>{$cancel}</em> | <em>{$edithelp}</em>
  <br><br>{$copywarn}
  <input type=hidden value=\"{$wpEdittime}\" name='wpEdittime'>
***************
*** 486,492 ****
  	# leap of faith, and I want to be able to report database
  	# errors at some point.
  
! 	/* private */ function insertNewArticle( $text, $summary, $isminor )
  	{
  		global $wgOut, $wgUser, $wgTitle, $wgLinkCache;
  		$fname = "Article::insertNewArticle";
--- 504,510 ----
  	# leap of faith, and I want to be able to report database
  	# errors at some point.
  
! 	/* private */ function insertNewArticle( $text, $summary, $isminor, $watchthis )
  	{
  		global $wgOut, $wgUser, $wgTitle, $wgLinkCache;
  		$fname = "Article::insertNewArticle";
***************
*** 521,537 ****
  		  wfStrencode( $wgUser->getName() ) . "','" .
  		  wfStrencode( $summary ) . "',0,0)";
  		wfQuery( $sql, $fname );
! 
  		$this->showArticle( $text, wfMsg( "newarticle" ) );
  	}
  
! 	function updateArticle( $text, $summary, $minor )
  	{
  		global $wgOut, $wgUser, $wgTitle, $wgLinkCache;
  		$fname = "Article::updateArticle";
  
  		if ( $this->mMinorEdit ) { $me1 = 1; } else { $me1 = 0; }
! 		if ( $minor ) { $me2 = 1; } else { $me2 = 0; }
  		if ( preg_match( "/^(#redirect[^\\n]+)/i", $text, $m ) ) {
  			$redir = 1;
  			$text = $m[1] . "\n"; # Remove all content but redirect
--- 539,562 ----
  		  wfStrencode( $wgUser->getName() ) . "','" .
  		  wfStrencode( $summary ) . "',0,0)";
  		wfQuery( $sql, $fname );
! 		if ($watchthis ) { 
! 			$this->watch(); 
! 		} else {
! 			if ( $wgTitle->userIsWatching() ) {
! 				$this->unwatch();
! 			}
! 		}
! 		
  		$this->showArticle( $text, wfMsg( "newarticle" ) );
  	}
  
! 	function updateArticle( $text, $summary, $minor, $watchthis )
  	{
  		global $wgOut, $wgUser, $wgTitle, $wgLinkCache;
  		$fname = "Article::updateArticle";
  
  		if ( $this->mMinorEdit ) { $me1 = 1; } else { $me1 = 0; }
! 		if ( $minor ) { $me2 = 1; } else { $me2 = 0; }		
  		if ( preg_match( "/^(#redirect[^\\n]+)/i", $text, $m ) ) {
  			$redir = 1;
  			$text = $m[1] . "\n"; # Remove all content but redirect
***************
*** 587,593 ****
  			  "WHERE rc_cur_id=" . $this->getID();
  			wfQuery( $sql, $fname );
  		}
! 		$this->showArticle( $text, wfMsg( "updated" ) );
  	}
  
  	# After we've either updated or inserted the article, update
--- 612,627 ----
  			  "WHERE rc_cur_id=" . $this->getID();
  			wfQuery( $sql, $fname );
  		}
! 		
! 		if ($watchthis ) { 
! 			$this->watch();
! 		} else {
! 			if ( $wgTitle->userIsWatching() ) {
! 				$this->unwatch();
! 			}
! 		}
! 
! 		$this->showArticle( $text, wfMsg( "updated" ) ); 
  	}
  
  	# After we've either updated or inserted the article, update
Index: Language.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/Language.php,v
retrieving revision 1.154
diff -c -r1.154 Language.php
*** Language.php	29 Oct 2002 07:25:41 -0000	1.154
--- Language.php	7 Nov 2002 11:41:44 -0000
***************
*** 44,50 ****
  	"numberheadings" => "Auto-number headings",
  	"rememberpassword" => "Remember password across sessions",
  	"editwidth" => "Edit box has full width",
! 	"editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  /* private */ $wgBookstoreListEn = array(
--- 44,51 ----
  	"numberheadings" => "Auto-number headings",
  	"rememberpassword" => "Remember password across sessions",
  	"editwidth" => "Edit box has full width",
! 	"editondblclick" => "Edit pages on double click (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  /* private */ $wgBookstoreListEn = array(
***************
*** 425,431 ****
  # Edit pages
  #
  "summary"		=> "Summary",
! "minoredit"		=> "This is a minor edit.",
  "savearticle"	=> "Save page",
  "preview"		=> "Preview",
  "showpreview"	=> "Show preview",
--- 426,433 ----
  # Edit pages
  #
  "summary"		=> "Summary",
! "minoredit"		=> "This is a minor edit",
! "watchthis"		=> "Watch this article",
  "savearticle"	=> "Save page",
  "preview"		=> "Preview",
  "showpreview"	=> "Show preview",
Index: LanguageDa.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageDa.php,v
retrieving revision 1.7
diff -c -r1.7 LanguageDa.php
*** LanguageDa.php	29 Oct 2002 07:25:41 -0000	1.7
--- LanguageDa.php	7 Nov 2002 11:41:44 -0000
***************
*** 41,47 ****
  	"numberheadings" => "Automatisk nummerering af overskrifter",
  	"rememberpassword" => "Husk password til n�ste bes�g",
  	"editwidth" => "Redigeringsboksen har fuld bredde",
! 	"editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  /* private */ $wgBookstoreListDa = array(
--- 41,48 ----
  	"numberheadings" => "Automatisk nummerering af overskrifter",
  	"rememberpassword" => "Husk password til n�ste bes�g",
  	"editwidth" => "Redigeringsboksen har fuld bredde",
! 	"editondblclick" => "Edit pages on double click (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  /* private */ $wgBookstoreListDa = array(
Index: LanguageDe.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageDe.php,v
retrieving revision 1.47
diff -c -r1.47 LanguageDe.php
*** LanguageDe.php	29 Oct 2002 07:25:41 -0000	1.47
--- LanguageDe.php	7 Nov 2002 11:41:44 -0000
***************
*** 38,44 ****
  	"numberheadings" => "�berschriften automatisch numerieren",
  	"rememberpassword" => "Passwort merken",
  	"editwidth" => "Text-Eingabefeld mit voller Breite",
! 	"editondblclick" => "Seiten mit Doppelklick bearbeiten (JavaScript)"
  );
  
  /* private */ $wgLanguageNamesDe = array(
--- 38,45 ----
  	"numberheadings" => "�berschriften automatisch numerieren",
  	"rememberpassword" => "Passwort merken",
  	"editwidth" => "Text-Eingabefeld mit voller Breite",
! 	"editondblclick" => "Seiten mit Doppelklick bearbeiten (JavaScript)",
! 	"watchdefault" => "Neue und ge�nderte Seiten beobachten"
  );
  
  /* private */ $wgLanguageNamesDe = array(
***************
*** 294,299 ****
--- 295,301 ----
  #
  "summary"		=> "Zusammenfassung",
  "minoredit"		=> "Nur Kleinigkeiten wurden ver�ndert.",
+ "watchthis" => "Diesen Artikel beobachten",
  "savearticle"	=> "Artikel speichern",
  "preview"		=> "Vorschau",
  "showpreview"	=> "Vorschau zeigen",
Index: LanguageEo.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageEo.php,v
retrieving revision 1.6
diff -c -r1.6 LanguageEo.php
*** LanguageEo.php	29 Oct 2002 07:25:41 -0000	1.6
--- LanguageEo.php	7 Nov 2002 11:41:44 -0000
***************
*** 35,41 ****
  	"numberheadings" => "Aŭtomate nombrigu sekciojn",
  	"rememberpassword" => "Rememoru mian pasvorton de seanco al seanco",
  	"editwidth" => "Redaktilo estu plenlarĝa",
! 	"editondblclick" => "Redaktu per duobla alklako (JavaScript)"
  );
  
  # El listo de Landoj kaj Lingvoj ce http://www.bertilow.com/lanlin/isoling.php
--- 35,42 ----
  	"numberheadings" => "Aŭtomate nombrigu sekciojn",
  	"rememberpassword" => "Rememoru mian pasvorton de seanco al seanco",
  	"editwidth" => "Redaktilo estu plenlarĝa",
! 	"editondblclick" => "Redaktu per duobla alklako (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  # El listo de Landoj kaj Lingvoj ce http://www.bertilow.com/lanlin/isoling.php
Index: LanguageEs.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageEs.php,v
retrieving revision 1.7
diff -c -r1.7 LanguageEs.php
*** LanguageEs.php	29 Oct 2002 07:25:41 -0000	1.7
--- LanguageEs.php	7 Nov 2002 11:41:45 -0000
***************
*** 36,42 ****
  	"numberheadings" => "Auto-numerar encabezados",
  	"rememberpassword" => "Recordar la contrase�a entre sesiones",
  	"editwidth" => "La caja de edici�n tiene el ancho m�ximo",
! 	"editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  /* Please customize this with some Spanish-language bookshops
--- 36,43 ----
  	"numberheadings" => "Auto-numerar encabezados",
  	"rememberpassword" => "Recordar la contrase�a entre sesiones",
  	"editwidth" => "La caja de edici�n tiene el ancho m�ximo",
! 	"editondblclick" => "Edit pages on double click (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  /* Please customize this with some Spanish-language bookshops
Index: LanguageFr.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageFr.php,v
retrieving revision 1.15
diff -c -r1.15 LanguageFr.php
*** LanguageFr.php	5 Nov 2002 03:13:58 -0000	1.15
--- LanguageFr.php	7 Nov 2002 11:41:45 -0000
***************
*** 38,44 ****
  	"numberheadings" => "Num�rotation automatique des titres",
  	"rememberpassword" => "Se souvenir de mon mot de passe (cookie)",
  	"editwidth" => "La fenetre d'�dition est en pleine largeur",
! 	"editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  /* Replace these with some French bookshops/lookup places */
--- 38,45 ----
  	"numberheadings" => "Num�rotation automatique des titres",
  	"rememberpassword" => "Se souvenir de mon mot de passe (cookie)",
  	"editwidth" => "La fenetre d'�dition est en pleine largeur",
! 	"editondblclick" => "Edit pages on double click (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  /* Replace these with some French bookshops/lookup places */
Index: LanguageJa.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageJa.php,v
retrieving revision 1.7
diff -c -r1.7 LanguageJa.php
*** LanguageJa.php	6 Nov 2002 10:15:47 -0000	1.7
--- LanguageJa.php	7 Nov 2002 11:41:45 -0000
***************
*** 33,39 ****
  	"numberheadings" => "Auto-number headings",
  	"rememberpassword" => "Remember password across sessions",
  	"editwidth" => "Edit box has full width",
! 	"editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  
--- 33,40 ----
  	"numberheadings" => "Auto-number headings",
  	"rememberpassword" => "Remember password across sessions",
  	"editwidth" => "Edit box has full width",
! 	"editondblclick" => "Edit pages on double click (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  
Index: LanguageKo.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageKo.php,v
retrieving revision 1.8
diff -c -r1.8 LanguageKo.php
*** LanguageKo.php	29 Oct 2002 07:25:41 -0000	1.8
--- LanguageKo.php	7 Nov 2002 11:41:46 -0000
***************
*** 53,59 ****
  	"numberheadings" => "머릿글 번호 매기기",
  	"rememberpassword" => "세션동안 암호 기억",
  	"editwidth" => "편집상자 너비 최대",
! 	"editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  /* private */ $wgBookstoreListKo = array(
--- 53,60 ----
  	"numberheadings" => "머릿글 번호 매기기",
  	"rememberpassword" => "세션동안 암호 기억",
  	"editwidth" => "편집상자 너비 최대",
! 	"editondblclick" => "Edit pages on double click (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  /* private */ $wgBookstoreListKo = array(
Index: LanguageNl.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageNl.php,v
retrieving revision 1.14
diff -c -r1.14 LanguageNl.php
*** LanguageNl.php	29 Oct 2002 07:35:34 -0000	1.14
--- LanguageNl.php	7 Nov 2002 11:41:47 -0000
***************
*** 40,47 ****
   "hideminor" => "Kleine wijzigingen verbergen in recente wijzigingen",
   "numberheadings" => "Koppen automatisch nummeren",
   "rememberpassword" => "Wachtwoord onthouden",
! 	"editwidth" => "Edit box has full width",
!     "editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  /* private */ $wgLanguageNamesNl = array(
--- 40,48 ----
   "hideminor" => "Kleine wijzigingen verbergen in recente wijzigingen",
   "numberheadings" => "Koppen automatisch nummeren",
   "rememberpassword" => "Wachtwoord onthouden",
!  "editwidth" => "Edit box has full width",
!  "editondblclick" => "Edit pages on double click (JavaScript)",
!  "watchdefault" => "Watch new and modified articles"
  );
  
  /* private */ $wgLanguageNamesNl = array(
Index: LanguagePl.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguagePl.php,v
retrieving revision 1.7
diff -c -r1.7 LanguagePl.php
*** LanguagePl.php	10 Oct 2002 10:32:54 -0000	1.7
--- LanguagePl.php	7 Nov 2002 11:41:47 -0000
***************
*** 31,37 ****
  	"justify"	=> "Wyrównuj tekst artykułu w kolumnie",
  	"hideminor" => "Ukryj drobne zmiany w \"Ostatnich zmianach\"",
  	"numberheadings" => "Automatyczna numeracja nagłówków",
! 	"rememberpassword" => "Pamiętaj hasło między sesjami"
  );
  
  /* private */ $wgLanguageNamesPl = array(
--- 31,39 ----
  	"justify"	=> "Wyrównuj tekst artykułu w kolumnie",
  	"hideminor" => "Ukryj drobne zmiany w \"Ostatnich zmianach\"",
  	"numberheadings" => "Automatyczna numeracja nagłówków",
! 	"rememberpassword" => "Pamiętaj hasło między sesjami",
! 	"editondblclick" => "Edit pages on doubleclick (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  /* private */ $wgLanguageNamesPl = array(
Index: LanguageZh.php
===================================================================
RCS file: /cvsroot/wikipedia/phpwiki/newcodebase/LanguageZh.php,v
retrieving revision 1.3
diff -c -r1.3 LanguageZh.php
*** LanguageZh.php	6 Nov 2002 01:43:35 -0000	1.3
--- LanguageZh.php	7 Nov 2002 11:41:48 -0000
***************
*** 49,55 ****
  	"numberheadings" => "Auto-number headings",
  	"rememberpassword" => "Remember password across sessions",
  	"editwidth" => "Edit box has full width",
! 	"editondblclick" => "Edit pages on double click (JavaScript)"
  );
  
  /* private */ $wgBookstoreListZh = array(
--- 49,56 ----
  	"numberheadings" => "Auto-number headings",
  	"rememberpassword" => "Remember password across sessions",
  	"editwidth" => "Edit box has full width",
! 	"editondblclick" => "Edit pages on double click (JavaScript)",
! 	"watchdefault" => "Watch new and modified articles"
  );
  
  /* private */ $wgBookstoreListZh = array(
