Index: trunk/phpwiki/newcodebase/LanguageDe.php |
— | — | @@ -38,7 +38,8 @@ |
39 | 39 | "numberheadings" => "�berschriften automatisch numerieren", |
40 | 40 | "rememberpassword" => "Passwort merken", |
41 | 41 | "editwidth" => "Text-Eingabefeld mit voller Breite", |
42 | | - "editondblclick" => "Seiten mit Doppelklick bearbeiten (JavaScript)" |
| 42 | + "editondblclick" => "Seiten mit Doppelklick bearbeiten (JavaScript)", |
| 43 | + "watchdefault" => "Neue und ge�nderte Seiten beobachten" |
43 | 44 | ); |
44 | 45 | |
45 | 46 | /* private */ $wgLanguageNamesDe = array( |
— | — | @@ -294,6 +295,7 @@ |
295 | 296 | # |
296 | 297 | "summary" => "Zusammenfassung", |
297 | 298 | "minoredit" => "Nur Kleinigkeiten wurden ver�ndert.", |
| 299 | +"watchthis" => "Diesen Artikel beobachten", |
298 | 300 | "savearticle" => "Artikel speichern", |
299 | 301 | "preview" => "Vorschau", |
300 | 302 | "showpreview" => "Vorschau zeigen", |
Index: trunk/phpwiki/newcodebase/LanguagePl.php |
— | — | @@ -31,7 +31,9 @@ |
32 | 32 | "justify" => "Wyrównuj tekst artykułu w kolumnie", |
33 | 33 | "hideminor" => "Ukryj drobne zmiany w \"Ostatnich zmianach\"", |
34 | 34 | "numberheadings" => "Automatyczna numeracja nagłówków", |
35 | | - "rememberpassword" => "Pamiętaj hasło między sesjami" |
| 35 | + "rememberpassword" => "Pamiętaj hasło między sesjami", |
| 36 | + "editondblclick" => "Edit pages on doubleclick (JavaScript)", |
| 37 | + "watchdefault" => "Watch new and modified articles" |
36 | 38 | ); |
37 | 39 | |
38 | 40 | /* private */ $wgLanguageNamesPl = array( |
Index: trunk/phpwiki/newcodebase/Article.php |
— | — | @@ -329,7 +329,8 @@ |
330 | 330 | function editForm( $formtype ) |
331 | 331 | { |
332 | 332 | global $wgOut, $wgUser, $wgTitle; |
333 | | - global $wpTextbox1, $wpSummary, $wpSave, $wpPreview; |
| 333 | + global $wpTextbox1, $wpSummary, $wpWatchthis; |
| 334 | + global $wpSave, $wpPreview; |
334 | 335 | global $wpMinoredit, $wpEdittime, $wpTextbox2, $wpCountable; |
335 | 336 | global $oldid, $redirect; |
336 | 337 | |
— | — | @@ -362,7 +363,7 @@ |
363 | 364 | return; |
364 | 365 | } |
365 | 366 | $this->mCountAdjustment = $this->isCountable( $wpTextbox1 ); |
366 | | - $this->insertNewArticle( $wpTextbox1, $wpSummary, $wpMinoredit ); |
| 367 | + $this->insertNewArticle( $wpTextbox1, $wpSummary, $wpMinoredit, $wpWatchthis ); |
367 | 368 | return; |
368 | 369 | } |
369 | 370 | # Article exists. Check for edit conflict. |
— | — | @@ -381,7 +382,7 @@ |
382 | 383 | |
383 | 384 | $this->mCountAdjustment = $this->isCountable( $wpTextbox1 ) - |
384 | 385 | $wpCountable; |
385 | | - $this->updateArticle( $wpTextbox1, $wpSummary, $wpMinoredit ); |
| 386 | + $this->updateArticle( $wpTextbox1, $wpSummary, $wpMinoredit, $wpWatchthis ); |
386 | 387 | return; |
387 | 388 | } |
388 | 389 | } |
— | — | @@ -425,8 +426,9 @@ |
426 | 427 | if ( "no" == $redirect ) { $q .= "&redirect=no"; } |
427 | 428 | $action = wfEscapeHTML( wfLocalUrl( $wgTitle->getPrefixedURL(), $q ) ); |
428 | 429 | |
429 | | - $summary = wfMsg( "summary" ); |
| 430 | + $summary = wfMsg( "summary" ); |
430 | 431 | $minor = wfMsg( "minoredit" ); |
| 432 | + $watchthis = wfMsg ("watchthis"); |
431 | 433 | $save = wfMsg( "savearticle" ); |
432 | 434 | $prev = wfMsg( "showpreview" ); |
433 | 435 | |
— | — | @@ -440,6 +442,21 @@ |
441 | 443 | $wpTextbox1 = wfEscapeHTML( $wpTextbox1 ); |
442 | 444 | $wpTextbox2 = wfEscapeHTML( $wpTextbox2 ); |
443 | 445 | $wpSummary = wfEscapeHTML( $wpSummary ); |
| 446 | + |
| 447 | + // activate checkbox if user wants it to be always active |
| 448 | + if ($wgUser->getOption("watchdefault")) $wpWatchthis=1; |
| 449 | + |
| 450 | + // activate checkbox also if user is already watching the page, |
| 451 | + // require wpWatchthis to be unset so that second condition is not |
| 452 | + // checked unnecessarily |
| 453 | + if (!$wpWatchthis && !$wpPreview && $wgTitle->userIsWatching()) $wpWatchthis=1; |
| 454 | + |
| 455 | + if ( 0 != $wgUser->getID() ) { |
| 456 | + |
| 457 | + $watchhtml="<input tabindex=4 type=checkbox name='wpWatchthis'".($wpWatchthis?" checked":"").">{$watchthis}<br>"; |
| 458 | + } else { |
| 459 | + $watchhtml="<br>"; |
| 460 | + } |
444 | 461 | |
445 | 462 | $wgOut->addHTML( " |
446 | 463 | <form method=post action=\"$action\" |
— | — | @@ -448,9 +465,10 @@ |
449 | 466 | {$wpTextbox1} |
450 | 467 | </textarea><br> |
451 | 468 | {$summary}: <input tabindex=2 type=text value=\"{$wpSummary}\" name='wpSummary' maxlength=200> |
452 | | -<input tabindex=3 type=checkbox value=1 name='wpMinoredit'".($wpMinoredit?" checked":"").">{$minor}<br> |
453 | | -<input tabindex=4 type=submit value=\"{$save}\" name='wpSave'> |
454 | | -<input tabindex=5 type=submit value=\"{$prev}\" name='wpPreview'> |
| 469 | +<input tabindex=3 type=checkbox value=1 name='wpMinoredit'".($wpMinoredit?" checked":"").">{$minor} |
| 470 | +{$watchhtml} |
| 471 | +<input tabindex=5 type=submit value=\"{$save}\" name='wpSave'> |
| 472 | +<input tabindex=6 type=submit value=\"{$prev}\" name='wpPreview'> |
455 | 473 | <em>{$cancel}</em> | <em>{$edithelp}</em> |
456 | 474 | <br><br>{$copywarn} |
457 | 475 | <input type=hidden value=\"{$wpEdittime}\" name='wpEdittime'> |
— | — | @@ -486,7 +504,7 @@ |
487 | 505 | # leap of faith, and I want to be able to report database |
488 | 506 | # errors at some point. |
489 | 507 | |
490 | | - /* private */ function insertNewArticle( $text, $summary, $isminor ) |
| 508 | + /* private */ function insertNewArticle( $text, $summary, $isminor, $watchthis ) |
491 | 509 | { |
492 | 510 | global $wgOut, $wgUser, $wgTitle, $wgLinkCache; |
493 | 511 | $fname = "Article::insertNewArticle"; |
— | — | @@ -521,17 +539,24 @@ |
522 | 540 | wfStrencode( $wgUser->getName() ) . "','" . |
523 | 541 | wfStrencode( $summary ) . "',0,0)"; |
524 | 542 | wfQuery( $sql, $fname ); |
525 | | - |
| 543 | + if ($watchthis ) { |
| 544 | + $this->watch(); |
| 545 | + } else { |
| 546 | + if ( $wgTitle->userIsWatching() ) { |
| 547 | + $this->unwatch(); |
| 548 | + } |
| 549 | + } |
| 550 | + |
526 | 551 | $this->showArticle( $text, wfMsg( "newarticle" ) ); |
527 | 552 | } |
528 | 553 | |
529 | | - function updateArticle( $text, $summary, $minor ) |
| 554 | + function updateArticle( $text, $summary, $minor, $watchthis ) |
530 | 555 | { |
531 | 556 | global $wgOut, $wgUser, $wgTitle, $wgLinkCache; |
532 | 557 | $fname = "Article::updateArticle"; |
533 | 558 | |
534 | 559 | if ( $this->mMinorEdit ) { $me1 = 1; } else { $me1 = 0; } |
535 | | - if ( $minor ) { $me2 = 1; } else { $me2 = 0; } |
| 560 | + if ( $minor ) { $me2 = 1; } else { $me2 = 0; } |
536 | 561 | if ( preg_match( "/^(#redirect[^\\n]+)/i", $text, $m ) ) { |
537 | 562 | $redir = 1; |
538 | 563 | $text = $m[1] . "\n"; # Remove all content but redirect |
— | — | @@ -587,7 +612,16 @@ |
588 | 613 | "WHERE rc_cur_id=" . $this->getID(); |
589 | 614 | wfQuery( $sql, $fname ); |
590 | 615 | } |
591 | | - $this->showArticle( $text, wfMsg( "updated" ) ); |
| 616 | + |
| 617 | + if ($watchthis ) { |
| 618 | + $this->watch(); |
| 619 | + } else { |
| 620 | + if ( $wgTitle->userIsWatching() ) { |
| 621 | + $this->unwatch(); |
| 622 | + } |
| 623 | + } |
| 624 | + |
| 625 | + $this->showArticle( $text, wfMsg( "updated" ) ); |
592 | 626 | } |
593 | 627 | |
594 | 628 | # After we've either updated or inserted the article, update |
Index: trunk/phpwiki/newcodebase/LanguageEo.php |
— | — | @@ -37,7 +37,8 @@ |
38 | 38 | "numberheadings" => "Aŭtomate nombrigu sekciojn", |
39 | 39 | "rememberpassword" => "Rememoru mian pasvorton de seanco al seanco", |
40 | 40 | "editwidth" => "Redaktilo estu plenlarĝa", |
41 | | - "editondblclick" => "Redaktu per duobla alklako (JavaScript)" |
| 41 | + "editondblclick" => "Redaktu per duobla alklako (JavaScript)", |
| 42 | + "watchdefault" => "Watch new and modified articles" |
42 | 43 | ); |
43 | 44 | |
44 | 45 | # Se eble, trovu Esperantajn libroservoj traserĉeblaj laŭ ISBN |
Index: trunk/phpwiki/newcodebase/LanguageEs.php |
— | — | @@ -36,7 +36,8 @@ |
37 | 37 | "numberheadings" => "Auto-numerar encabezados", |
38 | 38 | "rememberpassword" => "Recordar la contrase�a entre sesiones", |
39 | 39 | "editwidth" => "La caja de edici�n tiene el ancho m�ximo", |
40 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 40 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 41 | + "watchdefault" => "Watch new and modified articles" |
41 | 42 | ); |
42 | 43 | |
43 | 44 | /* Please customize this with some Spanish-language bookshops |
Index: trunk/phpwiki/newcodebase/LanguageJa.php |
— | — | @@ -33,7 +33,8 @@ |
34 | 34 | "numberheadings" => "Auto-number headings", |
35 | 35 | "rememberpassword" => "Remember password across sessions", |
36 | 36 | "editwidth" => "Edit box has full width", |
37 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 37 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 38 | + "watchdefault" => "Watch new and modified articles" |
38 | 39 | ); |
39 | 40 | |
40 | 41 | /* Native/local names should be available where known for consistency |
Index: trunk/phpwiki/newcodebase/LanguageFr.php |
— | — | @@ -38,7 +38,8 @@ |
39 | 39 | "numberheadings" => "Num�rotation automatique des titres", |
40 | 40 | "rememberpassword" => "Se souvenir de mon mot de passe (cookie)", |
41 | 41 | "editwidth" => "La fenetre d'�dition est en pleine largeur", |
42 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 42 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 43 | + "watchdefault" => "Watch new and modified articles" |
43 | 44 | ); |
44 | 45 | |
45 | 46 | /* Replace these with some French bookshops/lookup places */ |
Index: trunk/phpwiki/newcodebase/LanguageNl.php |
— | — | @@ -40,8 +40,9 @@ |
41 | 41 | "hideminor" => "Kleine wijzigingen verbergen in recente wijzigingen", |
42 | 42 | "numberheadings" => "Koppen automatisch nummeren", |
43 | 43 | "rememberpassword" => "Wachtwoord onthouden", |
44 | | - "editwidth" => "Edit box has full width", |
45 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 44 | + "editwidth" => "Edit box has full width", |
| 45 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 46 | + "watchdefault" => "Watch new and modified articles" |
46 | 47 | ); |
47 | 48 | |
48 | 49 | /* private */ $wgLanguageNamesNl = array( |
Index: trunk/phpwiki/newcodebase/Language.php |
— | — | @@ -44,7 +44,8 @@ |
45 | 45 | "numberheadings" => "Auto-number headings", |
46 | 46 | "rememberpassword" => "Remember password across sessions", |
47 | 47 | "editwidth" => "Edit box has full width", |
48 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 48 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 49 | + "watchdefault" => "Watch new and modified articles" |
49 | 50 | ); |
50 | 51 | |
51 | 52 | /* private */ $wgBookstoreListEn = array( |
— | — | @@ -425,7 +426,8 @@ |
426 | 427 | # Edit pages |
427 | 428 | # |
428 | 429 | "summary" => "Summary", |
429 | | -"minoredit" => "This is a minor edit.", |
| 430 | +"minoredit" => "This is a minor edit", |
| 431 | +"watchthis" => "Watch this article", |
430 | 432 | "savearticle" => "Save page", |
431 | 433 | "preview" => "Preview", |
432 | 434 | "showpreview" => "Show preview", |
Index: trunk/phpwiki/newcodebase/LanguageZh.php |
— | — | @@ -49,7 +49,8 @@ |
50 | 50 | "numberheadings" => "Auto-number headings", |
51 | 51 | "rememberpassword" => "Remember password across sessions", |
52 | 52 | "editwidth" => "Edit box has full width", |
53 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 53 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 54 | + "watchdefault" => "Watch new and modified articles" |
54 | 55 | ); |
55 | 56 | |
56 | 57 | /* private */ $wgBookstoreListZh = array( |
Index: trunk/phpwiki/newcodebase/LanguageKo.php |
— | — | @@ -53,7 +53,8 @@ |
54 | 54 | "numberheadings" => "머릿글 번호 매기기", |
55 | 55 | "rememberpassword" => "세션동안 암호 기억", |
56 | 56 | "editwidth" => "편집상자 너비 최대", |
57 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 57 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 58 | + "watchdefault" => "Watch new and modified articles" |
58 | 59 | ); |
59 | 60 | |
60 | 61 | /* private */ $wgBookstoreListKo = array( |
Index: trunk/phpwiki/newcodebase/LanguageDa.php |
— | — | @@ -41,7 +41,8 @@ |
42 | 42 | "numberheadings" => "Automatisk nummerering af overskrifter", |
43 | 43 | "rememberpassword" => "Husk password til n�ste bes�g", |
44 | 44 | "editwidth" => "Redigeringsboksen har fuld bredde", |
45 | | - "editondblclick" => "Edit pages on double click (JavaScript)" |
| 45 | + "editondblclick" => "Edit pages on double click (JavaScript)", |
| 46 | + "watchdefault" => "Watch new and modified articles" |
46 | 47 | ); |
47 | 48 | |
48 | 49 | /* private */ $wgBookstoreListDa = array( |