Index: trunk/phase3/includes/Xml.php |
— | — | @@ -277,7 +277,7 @@ |
278 | 278 | * @param $attribs other attributes |
279 | 279 | * @return string HTML |
280 | 280 | */ |
281 | | - public static function check( $name, $checked=false, $attribs=array() ) { |
| 281 | + public static function check( $name, $checked=false, $attribs = array() ) { |
282 | 282 | return self::element( 'input', array_merge( |
283 | 283 | array( |
284 | 284 | 'name' => $name, |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | * @param $attribs other attributes |
297 | 297 | * @return string HTML |
298 | 298 | */ |
299 | | - public static function radio( $name, $value, $checked=false, $attribs=array() ) { |
| 299 | + public static function radio( $name, $value, $checked = false, $attribs = array() ) { |
300 | 300 | return self::element( 'input', array( |
301 | 301 | 'name' => $name, |
302 | 302 | 'type' => 'radio', |
— | — | @@ -305,11 +305,12 @@ |
306 | 306 | /** |
307 | 307 | * Convenience function to build an HTML form label |
308 | 308 | * @param $label text of the label |
309 | | - * @param $id |
| 309 | + * @param $id |
| 310 | + * @param $attribs Array: extra attributes |
310 | 311 | * @return string HTML |
311 | 312 | */ |
312 | | - public static function label( $label, $id ) { |
313 | | - return self::element( 'label', array( 'for' => $id ), $label ); |
| 313 | + public static function label( $label, $id, $attribs = array() ) { |
| 314 | + return self::element( 'label', array( 'for' => $id ) + $attribs, $label ); |
314 | 315 | } |
315 | 316 | |
316 | 317 | /** |
— | — | @@ -319,21 +320,22 @@ |
320 | 321 | * @param $id id of the input |
321 | 322 | * @param $size value of the size attribute |
322 | 323 | * @param $value value of the value attribute |
323 | | - * @param $attribs other attributes |
| 324 | + * @param $inputAttribs other attributes for the input |
| 325 | + * @param $labelAttribs other attributes for the label |
324 | 326 | * @return string HTML |
325 | 327 | */ |
326 | | - public static function inputLabel( $label, $name, $id, $size=false, $value=false, $attribs=array() ) { |
327 | | - list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $attribs ); |
| 328 | + public static function inputLabel( $label, $name, $id, $size = false, $value = false, $inputAttribs = array(), $labelAttribs = array() ) { |
| 329 | + list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $inputAttribs, $labelAttribs ); |
328 | 330 | return $label . ' ' . $input; |
329 | 331 | } |
330 | 332 | |
331 | 333 | /** |
332 | 334 | * Same as Xml::inputLabel() but return input and label in an array |
333 | 335 | */ |
334 | | - public static function inputLabelSep( $label, $name, $id, $size=false, $value=false, $attribs=array() ) { |
| 336 | + public static function inputLabelSep( $label, $name, $id, $size = false, $value = false, $inputAttribs = array(), $labelAttribs = array() ) { |
335 | 337 | return array( |
336 | | - Xml::label( $label, $id ), |
337 | | - self::input( $name, $size, $value, array( 'id' => $id ) + $attribs ) |
| 338 | + Xml::label( $label, $id, $labelAttribs ), |
| 339 | + self::input( $name, $size, $value, array( 'id' => $id ) + $inputAttribs ) |
338 | 340 | ); |
339 | 341 | } |
340 | 342 | |
— | — | @@ -341,20 +343,20 @@ |
342 | 344 | * Convenience function to build an HTML checkbox with a label |
343 | 345 | * @return string HTML |
344 | 346 | */ |
345 | | - public static function checkLabel( $label, $name, $id, $checked=false, $attribs=array() ) { |
346 | | - return self::check( $name, $checked, array( 'id' => $id ) + $attribs ) . |
| 347 | + public static function checkLabel( $label, $name, $id, $checked = false, $inputAttribs = array(), $labelAttribs = array() ) { |
| 348 | + return self::check( $name, $checked, array( 'id' => $id ) + $inputAttribs ) . |
347 | 349 | ' ' . |
348 | | - self::label( $label, $id ); |
| 350 | + self::label( $label, $id, $labelAttribs ); |
349 | 351 | } |
350 | 352 | |
351 | 353 | /** |
352 | 354 | * Convenience function to build an HTML radio button with a label |
353 | 355 | * @return string HTML |
354 | 356 | */ |
355 | | - public static function radioLabel( $label, $name, $value, $id, $checked=false, $attribs=array() ) { |
356 | | - return self::radio( $name, $value, $checked, array( 'id' => $id ) + $attribs ) . |
| 357 | + public static function radioLabel( $label, $name, $value, $id, $checked = false, $inputAttribs = array(), $labelAttribs = array() ) { |
| 358 | + return self::radio( $name, $value, $checked, array( 'id' => $id ) + $inputAttribs ) . |
357 | 359 | ' ' . |
358 | | - self::label( $label, $id ); |
| 360 | + self::label( $label, $id, $labelAttribs ); |
359 | 361 | } |
360 | 362 | |
361 | 363 | /** |
— | — | @@ -363,7 +365,7 @@ |
364 | 366 | * @param $attribs Array: optional custom attributes |
365 | 367 | * @return string HTML |
366 | 368 | */ |
367 | | - public static function submitButton( $value, $attribs=array() ) { |
| 369 | + public static function submitButton( $value, $attribs = array() ) { |
368 | 370 | return self::element( 'input', array( 'type' => 'submit', 'value' => $value ) + $attribs ); |
369 | 371 | } |
370 | 372 | |
— | — | @@ -374,7 +376,7 @@ |
375 | 377 | * @param $attribs Array: optional custom attributes |
376 | 378 | * @return string HTML |
377 | 379 | */ |
378 | | - public static function hidden( $name, $value, $attribs=array() ) { |
| 380 | + public static function hidden( $name, $value, $attribs = array() ) { |
379 | 381 | return self::element( 'input', array( |
380 | 382 | 'name' => $name, |
381 | 383 | 'type' => 'hidden', |
— | — | @@ -389,8 +391,8 @@ |
390 | 392 | * @param $attribs array: optional additional HTML attributes |
391 | 393 | * @return string HTML |
392 | 394 | */ |
393 | | - public static function option( $text, $value=null, $selected=false, |
394 | | - $attribs=array() ) { |
| 395 | + public static function option( $text, $value = null, $selected = false, |
| 396 | + $attribs = array() ) { |
395 | 397 | if( !is_null( $value ) ) { |
396 | 398 | $attribs['value'] = $value; |
397 | 399 | } |
— | — | @@ -424,7 +426,7 @@ |
425 | 427 | } elseif ( substr( $value, 0, 1) == '*' && substr( $value, 1, 1) != '*' ) { |
426 | 428 | // A new group is starting ... |
427 | 429 | $value = trim( substr( $value, 1 ) ); |
428 | | - if( $optgroup ) $options .= self::closeElement('optgroup'); |
| 430 | + if( $optgroup ) $options .= self::closeElement( 'optgroup' ); |
429 | 431 | $options .= self::openElement( 'optgroup', array( 'label' => $value ) ); |
430 | 432 | $optgroup = true; |
431 | 433 | } elseif ( substr( $value, 0, 2) == '**' ) { |
— | — | @@ -433,7 +435,7 @@ |
434 | 436 | $options .= self::option( $value, $value, $selected === $value ); |
435 | 437 | } else { |
436 | 438 | // groupless reason list |
437 | | - if( $optgroup ) $options .= self::closeElement('optgroup'); |
| 439 | + if( $optgroup ) $options .= self::closeElement( 'optgroup' ); |
438 | 440 | $options .= self::option( $value, $value, $selected === $value ); |
439 | 441 | $optgroup = false; |
440 | 442 | } |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -17,30 +17,30 @@ |
18 | 18 | * usually the same, but they are now allowed to be different. |
19 | 19 | */ |
20 | 20 | class EditPage { |
21 | | - const AS_SUCCESS_UPDATE = 200; |
22 | | - const AS_SUCCESS_NEW_ARTICLE = 201; |
23 | | - const AS_HOOK_ERROR = 210; |
24 | | - const AS_FILTERING = 211; |
25 | | - const AS_HOOK_ERROR_EXPECTED = 212; |
26 | | - const AS_BLOCKED_PAGE_FOR_USER = 215; |
27 | | - const AS_CONTENT_TOO_BIG = 216; |
28 | | - const AS_USER_CANNOT_EDIT = 217; |
29 | | - const AS_READ_ONLY_PAGE_ANON = 218; |
30 | | - const AS_READ_ONLY_PAGE_LOGGED = 219; |
31 | | - const AS_READ_ONLY_PAGE = 220; |
32 | | - const AS_RATE_LIMITED = 221; |
33 | | - const AS_ARTICLE_WAS_DELETED = 222; |
34 | | - const AS_NO_CREATE_PERMISSION = 223; |
35 | | - const AS_BLANK_ARTICLE = 224; |
36 | | - const AS_CONFLICT_DETECTED = 225; |
37 | | - const AS_SUMMARY_NEEDED = 226; |
38 | | - const AS_TEXTBOX_EMPTY = 228; |
39 | | - const AS_MAX_ARTICLE_SIZE_EXCEEDED = 229; |
40 | | - const AS_OK = 230; |
41 | | - const AS_END = 231; |
42 | | - const AS_SPAM_ERROR = 232; |
43 | | - const AS_IMAGE_REDIRECT_ANON = 233; |
44 | | - const AS_IMAGE_REDIRECT_LOGGED = 234; |
| 21 | + const AS_SUCCESS_UPDATE = 200; |
| 22 | + const AS_SUCCESS_NEW_ARTICLE = 201; |
| 23 | + const AS_HOOK_ERROR = 210; |
| 24 | + const AS_FILTERING = 211; |
| 25 | + const AS_HOOK_ERROR_EXPECTED = 212; |
| 26 | + const AS_BLOCKED_PAGE_FOR_USER = 215; |
| 27 | + const AS_CONTENT_TOO_BIG = 216; |
| 28 | + const AS_USER_CANNOT_EDIT = 217; |
| 29 | + const AS_READ_ONLY_PAGE_ANON = 218; |
| 30 | + const AS_READ_ONLY_PAGE_LOGGED = 219; |
| 31 | + const AS_READ_ONLY_PAGE = 220; |
| 32 | + const AS_RATE_LIMITED = 221; |
| 33 | + const AS_ARTICLE_WAS_DELETED = 222; |
| 34 | + const AS_NO_CREATE_PERMISSION = 223; |
| 35 | + const AS_BLANK_ARTICLE = 224; |
| 36 | + const AS_CONFLICT_DETECTED = 225; |
| 37 | + const AS_SUMMARY_NEEDED = 226; |
| 38 | + const AS_TEXTBOX_EMPTY = 228; |
| 39 | + const AS_MAX_ARTICLE_SIZE_EXCEEDED = 229; |
| 40 | + const AS_OK = 230; |
| 41 | + const AS_END = 231; |
| 42 | + const AS_SPAM_ERROR = 232; |
| 43 | + const AS_IMAGE_REDIRECT_ANON = 233; |
| 44 | + const AS_IMAGE_REDIRECT_LOGGED = 234; |
45 | 45 | |
46 | 46 | var $mArticle; |
47 | 47 | var $mTitle; |
— | — | @@ -237,7 +237,7 @@ |
238 | 238 | * To turn the feature on, set $wgUseMetadataEdit = true ; in LocalSettings |
239 | 239 | * and set $wgMetadataWhitelist to the *full* title of the template whitelist |
240 | 240 | */ |
241 | | - function extractMetaDataFromArticle () { |
| 241 | + function extractMetaDataFromArticle() { |
242 | 242 | global $wgUseMetadataEdit, $wgMetadataWhitelist, $wgContLang; |
243 | 243 | $this->mMetaData = ''; |
244 | 244 | if ( !$wgUseMetadataEdit ) return; |
— | — | @@ -546,9 +546,9 @@ |
547 | 547 | */ |
548 | 548 | function importFormData( &$request ) { |
549 | 549 | global $wgLang, $wgUser; |
550 | | - $fname = 'EditPage::importFormData'; |
551 | | - wfProfileIn( $fname ); |
552 | 550 | |
| 551 | + wfProfileIn( __METHOD__ ); |
| 552 | + |
553 | 553 | # Section edit can come from either the form or a link |
554 | 554 | $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) ); |
555 | 555 | |
— | — | @@ -572,7 +572,7 @@ |
573 | 573 | |
574 | 574 | if ( is_null( $this->edittime ) ) { |
575 | 575 | # If the form is incomplete, force to preview. |
576 | | - wfDebug( "$fname: Form data appears to be incomplete\n" ); |
| 576 | + wfDebug( __METHOD__ . ": Form data appears to be incomplete\n" ); |
577 | 577 | wfDebug( "POST DATA: " . var_export( $_POST, true ) . "\n" ); |
578 | 578 | $this->preview = true; |
579 | 579 | } else { |
— | — | @@ -589,14 +589,14 @@ |
590 | 590 | # if the user hits enter in the comment box. |
591 | 591 | # The unmarked state will be assumed to be a save, |
592 | 592 | # if the form seems otherwise complete. |
593 | | - wfDebug( "$fname: Passed token check.\n" ); |
| 593 | + wfDebug( __METHOD__ . ": Passed token check.\n" ); |
594 | 594 | } else if ( $this->diff ) { |
595 | 595 | # Failed token check, but only requested "Show Changes". |
596 | | - wfDebug( "$fname: Failed token check; Show Changes requested.\n" ); |
| 596 | + wfDebug( __METHOD__ . ": Failed token check; Show Changes requested.\n" ); |
597 | 597 | } else { |
598 | 598 | # Page might be a hack attempt posted from |
599 | 599 | # an external site. Preview instead of saving. |
600 | | - wfDebug( "$fname: Failed token check; forcing preview\n" ); |
| 600 | + wfDebug( __METHOD__ . ": Failed token check; forcing preview\n" ); |
601 | 601 | $this->preview = true; |
602 | 602 | } |
603 | 603 | } |
— | — | @@ -626,7 +626,7 @@ |
627 | 627 | $this->autoSumm = $request->getText( 'wpAutoSummary' ); |
628 | 628 | } else { |
629 | 629 | # Not a posted form? Start with nothing. |
630 | | - wfDebug( "$fname: Not a posted form.\n" ); |
| 630 | + wfDebug( __METHOD__ . ": Not a posted form.\n" ); |
631 | 631 | $this->textbox1 = ''; |
632 | 632 | $this->textbox2 = ''; |
633 | 633 | $this->mMetaData = ''; |
— | — | @@ -651,7 +651,7 @@ |
652 | 652 | $this->live = $request->getCheck( 'live' ); |
653 | 653 | $this->editintro = $request->getText( 'editintro' ); |
654 | 654 | |
655 | | - wfProfileOut( $fname ); |
| 655 | + wfProfileOut( __METHOD__ ); |
656 | 656 | } |
657 | 657 | |
658 | 658 | /** |
— | — | @@ -731,9 +731,8 @@ |
732 | 732 | global $wgFilterCallback, $wgUser, $wgOut, $wgParser; |
733 | 733 | global $wgMaxArticleSize; |
734 | 734 | |
735 | | - $fname = 'EditPage::attemptSave'; |
736 | | - wfProfileIn( $fname ); |
737 | | - wfProfileIn( "$fname-checks" ); |
| 735 | + wfProfileIn( __METHOD__ ); |
| 736 | + wfProfileIn( __METHOD__ . '-checks' ); |
738 | 737 | |
739 | 738 | if ( !wfRunHooks( 'EditPage::attemptSave', array( &$this ) ) ) |
740 | 739 | { |
— | — | @@ -767,96 +766,96 @@ |
768 | 767 | $pdbk = $this->mTitle->getPrefixedDBkey(); |
769 | 768 | $match = str_replace( "\n", '', $match ); |
770 | 769 | wfDebugLog( 'SpamRegex', "$ip spam regex hit [[$pdbk]]: \"$match\"" ); |
771 | | - wfProfileOut( "$fname-checks" ); |
772 | | - wfProfileOut( $fname ); |
| 770 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 771 | + wfProfileOut( __METHOD__ ); |
773 | 772 | return self::AS_SPAM_ERROR; |
774 | 773 | } |
775 | 774 | if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section, $this->hookError, $this->summary ) ) { |
776 | 775 | # Error messages or other handling should be performed by the filter function |
777 | | - wfProfileOut( "$fname-checks" ); |
778 | | - wfProfileOut( $fname ); |
| 776 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 777 | + wfProfileOut( __METHOD__ ); |
779 | 778 | return self::AS_FILTERING; |
780 | 779 | } |
781 | 780 | if ( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) ) { |
782 | 781 | # Error messages etc. could be handled within the hook... |
783 | | - wfProfileOut( "$fname-checks" ); |
784 | | - wfProfileOut( $fname ); |
| 782 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 783 | + wfProfileOut( __METHOD__ ); |
785 | 784 | return self::AS_HOOK_ERROR; |
786 | 785 | } elseif ( $this->hookError != '' ) { |
787 | 786 | # ...or the hook could be expecting us to produce an error |
788 | | - wfProfileOut( "$fname-checks" ); |
789 | | - wfProfileOut( $fname ); |
| 787 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 788 | + wfProfileOut( __METHOD__ ); |
790 | 789 | return self::AS_HOOK_ERROR_EXPECTED; |
791 | 790 | } |
792 | 791 | if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) { |
793 | 792 | # Check block state against master, thus 'false'. |
794 | | - wfProfileOut( "$fname-checks" ); |
795 | | - wfProfileOut( $fname ); |
| 793 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 794 | + wfProfileOut( __METHOD__ ); |
796 | 795 | return self::AS_BLOCKED_PAGE_FOR_USER; |
797 | 796 | } |
798 | 797 | $this->kblength = (int)(strlen( $this->textbox1 ) / 1024); |
799 | 798 | if ( $this->kblength > $wgMaxArticleSize ) { |
800 | 799 | // Error will be displayed by showEditForm() |
801 | 800 | $this->tooBig = true; |
802 | | - wfProfileOut( "$fname-checks" ); |
803 | | - wfProfileOut( $fname ); |
| 801 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 802 | + wfProfileOut( __METHOD__ ); |
804 | 803 | return self::AS_CONTENT_TOO_BIG; |
805 | 804 | } |
806 | 805 | |
807 | 806 | if ( !$wgUser->isAllowed('edit') ) { |
808 | 807 | if ( $wgUser->isAnon() ) { |
809 | | - wfProfileOut( "$fname-checks" ); |
810 | | - wfProfileOut( $fname ); |
| 808 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 809 | + wfProfileOut( __METHOD__ ); |
811 | 810 | return self::AS_READ_ONLY_PAGE_ANON; |
812 | 811 | } |
813 | 812 | else { |
814 | | - wfProfileOut( "$fname-checks" ); |
815 | | - wfProfileOut( $fname ); |
| 813 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 814 | + wfProfileOut( __METHOD__ ); |
816 | 815 | return self::AS_READ_ONLY_PAGE_LOGGED; |
817 | 816 | } |
818 | 817 | } |
819 | 818 | |
820 | 819 | if ( wfReadOnly() ) { |
821 | | - wfProfileOut( "$fname-checks" ); |
822 | | - wfProfileOut( $fname ); |
| 820 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 821 | + wfProfileOut( __METHOD__ ); |
823 | 822 | return self::AS_READ_ONLY_PAGE; |
824 | 823 | } |
825 | 824 | if ( $wgUser->pingLimiter() ) { |
826 | | - wfProfileOut( "$fname-checks" ); |
827 | | - wfProfileOut( $fname ); |
| 825 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 826 | + wfProfileOut( __METHOD__ ); |
828 | 827 | return self::AS_RATE_LIMITED; |
829 | 828 | } |
830 | 829 | |
831 | 830 | # If the article has been deleted while editing, don't save it without |
832 | 831 | # confirmation |
833 | 832 | if ( $this->wasDeletedSinceLastEdit() && !$this->recreate ) { |
834 | | - wfProfileOut( "$fname-checks" ); |
835 | | - wfProfileOut( $fname ); |
| 833 | + wfProfileOut( __METHOD__ . '-checks' ); |
| 834 | + wfProfileOut( __METHOD__ ); |
836 | 835 | return self::AS_ARTICLE_WAS_DELETED; |
837 | 836 | } |
838 | 837 | |
839 | | - wfProfileOut( "$fname-checks" ); |
| 838 | + wfProfileOut( __METHOD__ . '-checks' ); |
840 | 839 | |
841 | 840 | # If article is new, insert it. |
842 | 841 | $aid = $this->mTitle->getArticleID( GAID_FOR_UPDATE ); |
843 | 842 | if ( 0 == $aid ) { |
844 | 843 | // Late check for create permission, just in case *PARANOIA* |
845 | 844 | if ( !$this->mTitle->userCan( 'create' ) ) { |
846 | | - wfDebug( "$fname: no create permission\n" ); |
847 | | - wfProfileOut( $fname ); |
| 845 | + wfDebug( __METHOD__ . ": no create permission\n" ); |
| 846 | + wfProfileOut( __METHOD__ ); |
848 | 847 | return self::AS_NO_CREATE_PERMISSION; |
849 | 848 | } |
850 | 849 | |
851 | 850 | # Don't save a new article if it's blank. |
852 | 851 | if ( '' == $this->textbox1 ) { |
853 | | - wfProfileOut( $fname ); |
| 852 | + wfProfileOut( __METHOD__ ); |
854 | 853 | return self::AS_BLANK_ARTICLE; |
855 | 854 | } |
856 | 855 | |
857 | 856 | // Run post-section-merge edit filter |
858 | 857 | if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) { |
859 | 858 | # Error messages etc. could be handled within the hook... |
860 | | - wfProfileOut( $fname ); |
| 859 | + wfProfileOut( __METHOD__ ); |
861 | 860 | return self::AS_HOOK_ERROR; |
862 | 861 | } |
863 | 862 | |
— | — | @@ -865,7 +864,7 @@ |
866 | 865 | $this->mArticle->insertNewArticle( $this->textbox1, $this->summary, |
867 | 866 | $this->minoredit, $this->watchthis, false, $isComment, $bot); |
868 | 867 | |
869 | | - wfProfileOut( $fname ); |
| 868 | + wfProfileOut( __METHOD__ ); |
870 | 869 | return self::AS_SUCCESS_NEW_ARTICLE; |
871 | 870 | } |
872 | 871 | |
— | — | @@ -930,7 +929,7 @@ |
931 | 930 | } |
932 | 931 | |
933 | 932 | if ( $this->isConflict ) { |
934 | | - wfProfileOut( $fname ); |
| 933 | + wfProfileOut( __METHOD__ ); |
935 | 934 | return self::AS_CONFLICT_DETECTED; |
936 | 935 | } |
937 | 936 | |
— | — | @@ -939,7 +938,7 @@ |
940 | 939 | // Run post-section-merge edit filter |
941 | 940 | if ( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError, $this->summary ) ) ) { |
942 | 941 | # Error messages etc. could be handled within the hook... |
943 | | - wfProfileOut( $fname ); |
| 942 | + wfProfileOut( __METHOD__ ); |
944 | 943 | return self::AS_HOOK_ERROR; |
945 | 944 | } |
946 | 945 | |
— | — | @@ -949,7 +948,7 @@ |
950 | 949 | ) { |
951 | 950 | if ( md5( $this->summary ) == $this->autoSumm ) { |
952 | 951 | $this->missingSummary = true; |
953 | | - wfProfileOut( $fname ); |
| 952 | + wfProfileOut( __METHOD__ ); |
954 | 953 | return self::AS_SUMMARY_NEEDED; |
955 | 954 | } |
956 | 955 | } |
— | — | @@ -958,13 +957,13 @@ |
959 | 958 | if ( $this->section == 'new' && !$this->allowBlankSummary ) { |
960 | 959 | if (trim($this->summary) == '') { |
961 | 960 | $this->missingSummary = true; |
962 | | - wfProfileOut( $fname ); |
| 961 | + wfProfileOut( __METHOD__ ); |
963 | 962 | return self::AS_SUMMARY_NEEDED; |
964 | 963 | } |
965 | 964 | } |
966 | 965 | |
967 | 966 | # All's well |
968 | | - wfProfileIn( "$fname-sectionanchor" ); |
| 967 | + wfProfileIn( __METHOD__ . '-sectionanchor' ); |
969 | 968 | $sectionanchor = ''; |
970 | 969 | if ( $this->section == 'new' ) { |
971 | 970 | if ( $this->textbox1 == '' ) { |
— | — | @@ -989,7 +988,7 @@ |
990 | 989 | $sectionanchor = $wgParser->guessSectionNameFromWikiText( $matches[2] ); |
991 | 990 | } |
992 | 991 | } |
993 | | - wfProfileOut( "$fname-sectionanchor" ); |
| 992 | + wfProfileOut( __METHOD__ . '-sectionanchor' ); |
994 | 993 | |
995 | 994 | // Save errors may fall down to the edit form, but we've now |
996 | 995 | // merged the section into full text. Clear the section field |
— | — | @@ -1002,19 +1001,19 @@ |
1003 | 1002 | $this->kblength = (int)(strlen( $text ) / 1024); |
1004 | 1003 | if ( $this->kblength > $wgMaxArticleSize ) { |
1005 | 1004 | $this->tooBig = true; |
1006 | | - wfProfileOut( $fname ); |
| 1005 | + wfProfileOut( __METHOD__ ); |
1007 | 1006 | return self::AS_MAX_ARTICLE_SIZE_EXCEEDED; |
1008 | 1007 | } |
1009 | 1008 | |
1010 | 1009 | # update the article here |
1011 | 1010 | if ( $this->mArticle->updateArticle( $text, $this->summary, $this->minoredit, |
1012 | 1011 | $this->watchthis, $bot, $sectionanchor ) ) { |
1013 | | - wfProfileOut( $fname ); |
| 1012 | + wfProfileOut( __METHOD__ ); |
1014 | 1013 | return self::AS_SUCCESS_UPDATE; |
1015 | 1014 | } else { |
1016 | 1015 | $this->isConflict = true; |
1017 | 1016 | } |
1018 | | - wfProfileOut( $fname ); |
| 1017 | + wfProfileOut( __METHOD__ ); |
1019 | 1018 | return self::AS_END; |
1020 | 1019 | } |
1021 | 1020 | |
— | — | @@ -1085,7 +1084,7 @@ |
1086 | 1085 | $wgOut->setPageTitle( wfMsg( $msg, $wgTitle->getPrefixedText() ) ); |
1087 | 1086 | } else { |
1088 | 1087 | # Use the title defined by DISPLAYTITLE magic word when present |
1089 | | - if ( isset($this->mParserOutput) |
| 1088 | + if ( isset( $this->mParserOutput ) |
1090 | 1089 | && ( $dt = $this->mParserOutput->getDisplayTitle() ) !== false ) { |
1091 | 1090 | $title = $dt; |
1092 | 1091 | } else { |
— | — | @@ -1108,11 +1107,10 @@ |
1109 | 1108 | # Some hook probably called this function without checking |
1110 | 1109 | # for is_null($wgTitle) first. Bail out right here so we don't |
1111 | 1110 | # do lots of work just to discard it right after. |
1112 | | - if (is_null($wgTitle)) |
| 1111 | + if ( is_null( $wgTitle ) ) |
1113 | 1112 | return; |
1114 | 1113 | |
1115 | | - $fname = 'EditPage::showEditForm'; |
1116 | | - wfProfileIn( $fname ); |
| 1114 | + wfProfileIn( __METHOD__ ); |
1117 | 1115 | |
1118 | 1116 | $sk = $wgUser->getSkin(); |
1119 | 1117 | |
— | — | @@ -1258,16 +1256,13 @@ |
1259 | 1257 | #if ( "no" == $redirect ) { $q .= "&redirect=no"; } |
1260 | 1258 | $action = $wgTitle->escapeLocalURL( $q ); |
1261 | 1259 | |
1262 | | - $colonSep = wfMsg( 'colon-separator' ); |
1263 | | - $summary = wfMsg( 'summary' ) . $colonSep; |
1264 | | - $subject = wfMsg( 'subject' ) . $colonSep; |
| 1260 | + $summary = wfMsgExt( 'summary', array( 'parseinline' ) ); |
| 1261 | + $subject = wfMsgExt( 'subject', array( 'parseinline' ) ); |
1265 | 1262 | |
1266 | | - $cancel = $sk->makeKnownLink( $wgTitle->getPrefixedText(), |
1267 | | - wfMsgExt('cancel', array('parseinline')) ); |
1268 | | - $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' )); |
1269 | | - $edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'. |
1270 | | - htmlspecialchars( wfMsg( 'edithelp' ) ).'</a> '. |
1271 | | - htmlspecialchars( wfMsg( 'newwindow' ) ); |
| 1263 | + $cancel = $sk->makeKnownLinkObj( $wgTitle, wfMsgHtml( 'cancel' ) ); |
| 1264 | + $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ) ); |
| 1265 | + $edithelp = Xml::element( 'a', array( 'target' => 'helpwindow', 'href' => $edithelpurl ), wfMsg( 'edithelp' ) ) . |
| 1266 | + ' ' . wfMsgExt( 'newwindow', array( 'parseinline' ) ); |
1272 | 1267 | |
1273 | 1268 | global $wgRightsText; |
1274 | 1269 | if ( $wgRightsText ) { |
— | — | @@ -1332,18 +1327,25 @@ |
1333 | 1328 | if ( $this->missingSummary ) $summaryhiddens .= Xml::hidden( 'wpIgnoreBlankSummary', true ); |
1334 | 1329 | $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); |
1335 | 1330 | $summaryhiddens .= Xml::hidden( 'wpAutoSummary', $autosumm ); |
| 1331 | + $subjectPreviewMsg = wfMsgExt( 'subject-preview', array( 'escapenoentities' ) ); |
1336 | 1332 | if ( $this->section == 'new' ) { |
1337 | | - $commentsubject="<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}</label></span>\n<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' />{$summaryhiddens}<br />"; |
| 1333 | + $commentsubject = "<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}</label></span>\n" . |
| 1334 | + "<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' />" . |
| 1335 | + "{$summaryhiddens}<br />"; |
1338 | 1336 | $editsummary = "<div class='editOptions'>\n"; |
1339 | 1337 | global $wgParser; |
1340 | 1338 | $formattedSummary = wfMsgForContent( 'newsectionsummary', $wgParser->stripSectionName( $this->summary ) ); |
1341 | | - $subjectpreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('subject-preview').$colonSep.$sk->commentBlock( $formattedSummary, $this->mTitle, true )."</div>\n" : ''; |
| 1339 | + $subjectpreview = $summarytext && $this->preview ? |
| 1340 | + "<div class=\"mw-summary-preview\">" . $subjectPreviewMsg . $sk->commentBlock( $formattedSummary, $this->mTitle, true ) . "</div>\n" : ''; |
1342 | 1341 | $summarypreview = ''; |
1343 | 1342 | } else { |
1344 | 1343 | $commentsubject = ''; |
1345 | | - $editsummary="<div class='editOptions'>\n<span id='wpSummaryLabel'><label for='wpSummary'>{$summary}</label></span>\n<input tabindex='2' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' />{$summaryhiddens}<br />"; |
1346 | | - $summarypreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('summary-preview').$colonSep.$sk->commentBlock( $this->summary, $this->mTitle )."</div>\n" : ''; |
| 1344 | + $editsummary = "<div class='editOptions'>\n<span id='wpSummaryLabel'><label for='wpSummary'>{$summary}</label></span>\n" . |
| 1345 | + "<input tabindex='2' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' />" . |
| 1346 | + "{$summaryhiddens}<br />"; |
1347 | 1347 | $subjectpreview = ''; |
| 1348 | + $summarypreview = $summarytext && $this->preview ? |
| 1349 | + "<div class=\"mw-summary-preview\">" . $subjectPreviewMsg . $sk->commentBlock( $this->summary, $this->mTitle ) . "</div>\n" : ''; |
1348 | 1350 | } |
1349 | 1351 | |
1350 | 1352 | # Set focus to the edit box on load, except on preview or diff, where it would interfere with the display |
— | — | @@ -1358,7 +1360,7 @@ |
1359 | 1361 | |
1360 | 1362 | global $wgUseMetadataEdit ; |
1361 | 1363 | if ( $wgUseMetadataEdit ) { |
1362 | | - $metadata = $this->mMetaData ; |
| 1364 | + $metadata = $this->mMetaData; |
1363 | 1365 | $metadata = htmlspecialchars( $wgContLang->recodeForEdit( $metadata ) ) ; |
1364 | 1366 | $top = wfMsgWikiHtml( 'metadata_help' ); |
1365 | 1367 | /* ToDo: Replace with clean code */ |
— | — | @@ -1374,15 +1376,15 @@ |
1375 | 1377 | $recreate = ''; |
1376 | 1378 | if ( $this->wasDeletedSinceLastEdit() ) { |
1377 | 1379 | if ( 'save' != $this->formtype ) { |
1378 | | - $wgOut->addWikiMsg('deletedwhileediting'); |
| 1380 | + $wgOut->addWikiMsg( 'deletedwhileediting' ); |
1379 | 1381 | } else { |
1380 | 1382 | // Hide the toolbar and edit area, use can click preview to get it back |
1381 | 1383 | // Add an confirmation checkbox and explanation. |
1382 | 1384 | $toolbar = ''; |
1383 | | - $recreate = $wgOut->parse( wfMsg( 'confirmrecreate', $this->lastDelete->user_name , $this->lastDelete->log_comment )); |
1384 | | - $recreate .= |
1385 | | - "<br /><input tabindex='1' type='checkbox' value='1' name='wpRecreate' id='wpRecreate' />". |
1386 | | - "<label for='wpRecreate' title='".wfMsg('tooltip-recreate')."'>". wfMsg('recreate')."</label>"; |
| 1385 | + $recreate = wfMsgExt( 'confirmrecreate', array( 'parse' ), $this->lastDelete->user_name , $this->lastDelete->log_comment ) . |
| 1386 | + "<br />" . |
| 1387 | + Xml::checkLabel( wfMsg( 'recreate' ), 'wpRecreate', 'wpRecreate', false, |
| 1388 | + array( 'tabindex' => '1' ), array( 'title' => wfMsg( 'tooltip-recreate' ) ) ); |
1387 | 1389 | } |
1388 | 1390 | } |
1389 | 1391 | |
— | — | @@ -1470,13 +1472,13 @@ |
1471 | 1473 | ); |
1472 | 1474 | |
1473 | 1475 | if ( $this->isConflict && wfRunHooks( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) ) ) { |
1474 | | - $wgOut->wrapWikiMsg( '==$1==', "yourdiff" ); |
| 1476 | + $wgOut->wrapWikiMsg( '==$1==', 'yourdiff' ); |
1475 | 1477 | |
1476 | 1478 | $de = new DifferenceEngine( $this->mTitle ); |
1477 | 1479 | $de->setText( $this->textbox2, $this->textbox1 ); |
1478 | | - $de->showDiff( wfMsg( "yourtext" ), wfMsg( "storedversion" ) ); |
| 1480 | + $de->showDiff( wfMsgExt( 'yourtext', array( 'parseinline' ) ), wfMsgExt( 'storedversion', array( 'parseinline' ) ) ); |
1479 | 1481 | |
1480 | | - $wgOut->wrapWikiMsg( '==$1==', "yourtext" ); |
| 1482 | + $wgOut->wrapWikiMsg( '==$1==', 'yourtext' ); |
1481 | 1483 | $this->showTextbox2(); |
1482 | 1484 | } |
1483 | 1485 | $wgOut->addHTML( $this->editFormTextBottom ); |
— | — | @@ -1485,7 +1487,7 @@ |
1486 | 1488 | $this->displayPreviewArea( $previewOutput, false ); |
1487 | 1489 | } |
1488 | 1490 | |
1489 | | - wfProfileOut( $fname ); |
| 1491 | + wfProfileOut( __METHOD__ ); |
1490 | 1492 | } |
1491 | 1493 | |
1492 | 1494 | protected function showFormBeforeText() { |
— | — | @@ -1821,15 +1823,14 @@ |
1822 | 1824 | * @todo document |
1823 | 1825 | */ |
1824 | 1826 | function mergeChangesInto( &$editText ){ |
1825 | | - $fname = 'EditPage::mergeChangesInto'; |
1826 | | - wfProfileIn( $fname ); |
| 1827 | + wfProfileIn( __METHOD__ ); |
1827 | 1828 | |
1828 | 1829 | $db = wfGetDB( DB_MASTER ); |
1829 | 1830 | |
1830 | 1831 | // This is the revision the editor started from |
1831 | 1832 | $baseRevision = $this->getBaseRevision(); |
1832 | 1833 | if ( is_null( $baseRevision ) ) { |
1833 | | - wfProfileOut( $fname ); |
| 1834 | + wfProfileOut( __METHOD__ ); |
1834 | 1835 | return false; |
1835 | 1836 | } |
1836 | 1837 | $baseText = $baseRevision->getText(); |
— | — | @@ -1838,7 +1839,7 @@ |
1839 | 1840 | $currentRevision = Revision::loadFromTitle( |
1840 | 1841 | $db, $this->mTitle ); |
1841 | 1842 | if ( is_null( $currentRevision ) ) { |
1842 | | - wfProfileOut( $fname ); |
| 1843 | + wfProfileOut( __METHOD__ ); |
1843 | 1844 | return false; |
1844 | 1845 | } |
1845 | 1846 | $currentText = $currentRevision->getText(); |
— | — | @@ -1846,10 +1847,10 @@ |
1847 | 1848 | $result = ''; |
1848 | 1849 | if ( wfMerge( $baseText, $editText, $currentText, $result ) ) { |
1849 | 1850 | $editText = $result; |
1850 | | - wfProfileOut( $fname ); |
| 1851 | + wfProfileOut( __METHOD__ ); |
1851 | 1852 | return true; |
1852 | 1853 | } else { |
1853 | | - wfProfileOut( $fname ); |
| 1854 | + wfProfileOut( __METHOD__ ); |
1854 | 1855 | return false; |
1855 | 1856 | } |
1856 | 1857 | } |
— | — | @@ -1918,109 +1919,109 @@ |
1919 | 1920 | */ |
1920 | 1921 | $toolarray = array( |
1921 | 1922 | array( |
1922 | | - 'image' => $wgLang->getImageFile('button-bold'), |
| 1923 | + 'image' => $wgLang->getImageFile( 'button-bold' ), |
1923 | 1924 | 'id' => 'mw-editbutton-bold', |
1924 | 1925 | 'open' => '\'\'\'', |
1925 | 1926 | 'close' => '\'\'\'', |
1926 | | - 'sample' => wfMsg('bold_sample'), |
1927 | | - 'tip' => wfMsg('bold_tip'), |
| 1927 | + 'sample' => wfMsg( 'bold_sample' ), |
| 1928 | + 'tip' => wfMsg( 'bold_tip' ), |
1928 | 1929 | 'key' => 'B' |
1929 | 1930 | ), |
1930 | 1931 | array( |
1931 | | - 'image' => $wgLang->getImageFile('button-italic'), |
| 1932 | + 'image' => $wgLang->getImageFile( 'button-italic' ), |
1932 | 1933 | 'id' => 'mw-editbutton-italic', |
1933 | 1934 | 'open' => '\'\'', |
1934 | 1935 | 'close' => '\'\'', |
1935 | | - 'sample' => wfMsg('italic_sample'), |
1936 | | - 'tip' => wfMsg('italic_tip'), |
| 1936 | + 'sample' => wfMsg( 'italic_sample' ), |
| 1937 | + 'tip' => wfMsg( 'italic_tip' ), |
1937 | 1938 | 'key' => 'I' |
1938 | 1939 | ), |
1939 | 1940 | array( |
1940 | | - 'image' => $wgLang->getImageFile('button-link'), |
| 1941 | + 'image' => $wgLang->getImageFile( 'button-link' ), |
1941 | 1942 | 'id' => 'mw-editbutton-link', |
1942 | 1943 | 'open' => '[[', |
1943 | 1944 | 'close' => ']]', |
1944 | | - 'sample' => wfMsg('link_sample'), |
1945 | | - 'tip' => wfMsg('link_tip'), |
| 1945 | + 'sample' => wfMsg( 'link_sample' ), |
| 1946 | + 'tip' => wfMsg( 'link_tip' ), |
1946 | 1947 | 'key' => 'L' |
1947 | 1948 | ), |
1948 | 1949 | array( |
1949 | | - 'image' => $wgLang->getImageFile('button-extlink'), |
| 1950 | + 'image' => $wgLang->getImageFile( 'button-extlink' ), |
1950 | 1951 | 'id' => 'mw-editbutton-extlink', |
1951 | 1952 | 'open' => '[', |
1952 | 1953 | 'close' => ']', |
1953 | | - 'sample' => wfMsg('extlink_sample'), |
1954 | | - 'tip' => wfMsg('extlink_tip'), |
| 1954 | + 'sample' => wfMsg( 'extlink_sample' ), |
| 1955 | + 'tip' => wfMsg( 'extlink_tip' ), |
1955 | 1956 | 'key' => 'X' |
1956 | 1957 | ), |
1957 | 1958 | array( |
1958 | | - 'image' => $wgLang->getImageFile('button-headline'), |
| 1959 | + 'image' => $wgLang->getImageFile( 'button-headline' ), |
1959 | 1960 | 'id' => 'mw-editbutton-headline', |
1960 | 1961 | 'open' => "\n== ", |
1961 | 1962 | 'close' => " ==\n", |
1962 | | - 'sample' => wfMsg('headline_sample'), |
1963 | | - 'tip' => wfMsg('headline_tip'), |
| 1963 | + 'sample' => wfMsg( 'headline_sample' ), |
| 1964 | + 'tip' => wfMsg( 'headline_tip' ), |
1964 | 1965 | 'key' => 'H' |
1965 | 1966 | ), |
1966 | 1967 | array( |
1967 | | - 'image' => $wgLang->getImageFile('button-image'), |
| 1968 | + 'image' => $wgLang->getImageFile( 'button-image' ), |
1968 | 1969 | 'id' => 'mw-editbutton-image', |
1969 | | - 'open' => '[['.$wgContLang->getNsText(NS_FILE).':', |
| 1970 | + 'open' => '[['.$wgContLang->getNsText( NS_FILE ).':', |
1970 | 1971 | 'close' => ']]', |
1971 | | - 'sample' => wfMsg('image_sample'), |
1972 | | - 'tip' => wfMsg('image_tip'), |
| 1972 | + 'sample' => wfMsg( 'image_sample' ), |
| 1973 | + 'tip' => wfMsg( 'image_tip' ), |
1973 | 1974 | 'key' => 'D' |
1974 | 1975 | ), |
1975 | 1976 | array( |
1976 | | - 'image' => $wgLang->getImageFile('button-media'), |
| 1977 | + 'image' => $wgLang->getImageFile( 'button-media' ), |
1977 | 1978 | 'id' => 'mw-editbutton-media', |
1978 | | - 'open' => '[['.$wgContLang->getNsText(NS_MEDIA).':', |
| 1979 | + 'open' => '[['.$wgContLang->getNsText( NS_MEDIA ).':', |
1979 | 1980 | 'close' => ']]', |
1980 | | - 'sample' => wfMsg('media_sample'), |
1981 | | - 'tip' => wfMsg('media_tip'), |
| 1981 | + 'sample' => wfMsg( 'media_sample' ), |
| 1982 | + 'tip' => wfMsg( 'media_tip' ), |
1982 | 1983 | 'key' => 'M' |
1983 | 1984 | ), |
1984 | 1985 | array( |
1985 | | - 'image' => $wgLang->getImageFile('button-math'), |
| 1986 | + 'image' => $wgLang->getImageFile( 'button-math' ), |
1986 | 1987 | 'id' => 'mw-editbutton-math', |
1987 | 1988 | 'open' => "<math>", |
1988 | 1989 | 'close' => "</math>", |
1989 | | - 'sample' => wfMsg('math_sample'), |
1990 | | - 'tip' => wfMsg('math_tip'), |
| 1990 | + 'sample' => wfMsg( 'math_sample' ), |
| 1991 | + 'tip' => wfMsg( 'math_tip' ), |
1991 | 1992 | 'key' => 'C' |
1992 | 1993 | ), |
1993 | 1994 | array( |
1994 | | - 'image' => $wgLang->getImageFile('button-nowiki'), |
| 1995 | + 'image' => $wgLang->getImageFile( 'button-nowiki' ), |
1995 | 1996 | 'id' => 'mw-editbutton-nowiki', |
1996 | 1997 | 'open' => "<nowiki>", |
1997 | 1998 | 'close' => "</nowiki>", |
1998 | | - 'sample' => wfMsg('nowiki_sample'), |
1999 | | - 'tip' => wfMsg('nowiki_tip'), |
| 1999 | + 'sample' => wfMsg( 'nowiki_sample' ), |
| 2000 | + 'tip' => wfMsg( 'nowiki_tip' ), |
2000 | 2001 | 'key' => 'N' |
2001 | 2002 | ), |
2002 | 2003 | array( |
2003 | | - 'image' => $wgLang->getImageFile('button-sig'), |
| 2004 | + 'image' => $wgLang->getImageFile( 'button-sig' ), |
2004 | 2005 | 'id' => 'mw-editbutton-signature', |
2005 | 2006 | 'open' => '--~~~~', |
2006 | 2007 | 'close' => '', |
2007 | 2008 | 'sample' => '', |
2008 | | - 'tip' => wfMsg('sig_tip'), |
| 2009 | + 'tip' => wfMsg( 'sig_tip' ), |
2009 | 2010 | 'key' => 'Y' |
2010 | 2011 | ), |
2011 | 2012 | array( |
2012 | | - 'image' => $wgLang->getImageFile('button-hr'), |
| 2013 | + 'image' => $wgLang->getImageFile( 'button-hr' ), |
2013 | 2014 | 'id' => 'mw-editbutton-hr', |
2014 | 2015 | 'open' => "\n----\n", |
2015 | 2016 | 'close' => '', |
2016 | 2017 | 'sample' => '', |
2017 | | - 'tip' => wfMsg('hr_tip'), |
| 2018 | + 'tip' => wfMsg( 'hr_tip' ), |
2018 | 2019 | 'key' => 'R' |
2019 | 2020 | ) |
2020 | 2021 | ); |
2021 | 2022 | $toolbar = "<div id='toolbar'>\n"; |
2022 | 2023 | $toolbar.="<script type='$wgJsMimeType'>\n/*<![CDATA[*/\n"; |
2023 | 2024 | |
2024 | | - foreach($toolarray as $tool) { |
| 2025 | + foreach( $toolarray as $tool ) { |
2025 | 2026 | $params = array( |
2026 | 2027 | $image = $wgStylePath.'/common/images/'.$tool['image'], |
2027 | 2028 | // Note that we use the tip both for the ALT tag and the TITLE tag of the image. |
— | — | @@ -2061,8 +2062,8 @@ |
2062 | 2063 | $checkboxes = array(); |
2063 | 2064 | |
2064 | 2065 | $checkboxes['minor'] = ''; |
2065 | | - $minorLabel = wfMsgExt('minoredit', array('parseinline')); |
2066 | | - if ( $wgUser->isAllowed('minoredit') ) { |
| 2066 | + $minorLabel = wfMsgExt( 'minoredit', array( 'parseinline' ) ); |
| 2067 | + if ( $wgUser->isAllowed( 'minoredit' ) ) { |
2067 | 2068 | $attribs = array( |
2068 | 2069 | 'tabindex' => ++$tabindex, |
2069 | 2070 | 'accesskey' => wfMsg( 'accesskey-minoredit' ), |
— | — | @@ -2070,10 +2071,10 @@ |
2071 | 2072 | ); |
2072 | 2073 | $checkboxes['minor'] = |
2073 | 2074 | Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) . |
2074 | | - " <label for='wpMinoredit'".$skin->tooltip('minoredit', 'withaccess').">{$minorLabel}</label>"; |
| 2075 | + " <label for='wpMinoredit'" . $skin->tooltip( 'minoredit', 'withaccess' ) . ">{$minorLabel}</label>"; |
2075 | 2076 | } |
2076 | 2077 | |
2077 | | - $watchLabel = wfMsgExt('watchthis', array('parseinline')); |
| 2078 | + $watchLabel = wfMsgExt( 'watchthis', array( 'parseinline' ) ); |
2078 | 2079 | $checkboxes['watch'] = ''; |
2079 | 2080 | if ( $wgUser->isLoggedIn() ) { |
2080 | 2081 | $attribs = array( |
— | — | @@ -2083,7 +2084,7 @@ |
2084 | 2085 | ); |
2085 | 2086 | $checkboxes['watch'] = |
2086 | 2087 | Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) . |
2087 | | - " <label for='wpWatchthis'".$skin->tooltip('watch', 'withaccess').">{$watchLabel}</label>"; |
| 2088 | + " <label for='wpWatchthis'" . $skin->tooltip('watch', 'withaccess') . ">{$watchLabel}</label>"; |
2088 | 2089 | } |
2089 | 2090 | wfRunHooks( 'EditPageBeforeEditChecks', array( &$this, &$checkboxes, &$tabindex ) ); |
2090 | 2091 | return $checkboxes; |
— | — | @@ -2097,7 +2098,7 @@ |
2098 | 2099 | * |
2099 | 2100 | * @return array |
2100 | 2101 | */ |
2101 | | - public function getEditButtons(&$tabindex) { |
| 2102 | + public function getEditButtons( &$tabindex ) { |
2102 | 2103 | global $wgLivePreview, $wgUser; |
2103 | 2104 | |
2104 | 2105 | $buttons = array(); |
— | — | @@ -2107,11 +2108,11 @@ |
2108 | 2109 | 'name' => 'wpSave', |
2109 | 2110 | 'type' => 'submit', |
2110 | 2111 | 'tabindex' => ++$tabindex, |
2111 | | - 'value' => wfMsg('savearticle'), |
2112 | | - 'accesskey' => wfMsg('accesskey-save'), |
| 2112 | + 'value' => wfMsg( 'savearticle' ), |
| 2113 | + 'accesskey' => wfMsg( 'accesskey-save' ), |
2113 | 2114 | 'title' => wfMsg( 'tooltip-save' ).' ['.wfMsg( 'accesskey-save' ).']', |
2114 | 2115 | ); |
2115 | | - $buttons['save'] = Xml::element('input', $temp, ''); |
| 2116 | + $buttons['save'] = Xml::element( 'input', $temp, '' ); |
2116 | 2117 | |
2117 | 2118 | ++$tabindex; // use the same for preview and live preview |
2118 | 2119 | if ( $wgLivePreview && $wgUser->getOption( 'uselivepreview' ) ) { |
— | — | @@ -2120,12 +2121,12 @@ |
2121 | 2122 | 'name' => 'wpPreview', |
2122 | 2123 | 'type' => 'submit', |
2123 | 2124 | 'tabindex' => $tabindex, |
2124 | | - 'value' => wfMsg('showpreview'), |
| 2125 | + 'value' => wfMsg( 'showpreview' ), |
2125 | 2126 | 'accesskey' => '', |
2126 | 2127 | 'title' => wfMsg( 'tooltip-preview' ).' ['.wfMsg( 'accesskey-preview' ).']', |
2127 | 2128 | 'style' => 'display: none;', |
2128 | 2129 | ); |
2129 | | - $buttons['preview'] = Xml::element('input', $temp, ''); |
| 2130 | + $buttons['preview'] = Xml::element( 'input', $temp, '' ); |
2130 | 2131 | |
2131 | 2132 | $temp = array( |
2132 | 2133 | 'id' => 'wpLivePreview', |
— | — | @@ -2137,18 +2138,18 @@ |
2138 | 2139 | 'title' => '', |
2139 | 2140 | 'onclick' => $this->doLivePreviewScript(), |
2140 | 2141 | ); |
2141 | | - $buttons['live'] = Xml::element('input', $temp, ''); |
| 2142 | + $buttons['live'] = Xml::element( 'input', $temp, '' ); |
2142 | 2143 | } else { |
2143 | 2144 | $temp = array( |
2144 | 2145 | 'id' => 'wpPreview', |
2145 | 2146 | 'name' => 'wpPreview', |
2146 | 2147 | 'type' => 'submit', |
2147 | 2148 | 'tabindex' => $tabindex, |
2148 | | - 'value' => wfMsg('showpreview'), |
2149 | | - 'accesskey' => wfMsg('accesskey-preview'), |
| 2149 | + 'value' => wfMsg( 'showpreview' ), |
| 2150 | + 'accesskey' => wfMsg( 'accesskey-preview' ), |
2150 | 2151 | 'title' => wfMsg( 'tooltip-preview' ).' ['.wfMsg( 'accesskey-preview' ).']', |
2151 | 2152 | ); |
2152 | | - $buttons['preview'] = Xml::element('input', $temp, ''); |
| 2153 | + $buttons['preview'] = Xml::element( 'input', $temp, '' ); |
2153 | 2154 | $buttons['live'] = ''; |
2154 | 2155 | } |
2155 | 2156 | |
— | — | @@ -2157,11 +2158,11 @@ |
2158 | 2159 | 'name' => 'wpDiff', |
2159 | 2160 | 'type' => 'submit', |
2160 | 2161 | 'tabindex' => ++$tabindex, |
2161 | | - 'value' => wfMsg('showdiff'), |
2162 | | - 'accesskey' => wfMsg('accesskey-diff'), |
| 2162 | + 'value' => wfMsg( 'showdiff' ), |
| 2163 | + 'accesskey' => wfMsg( 'accesskey-diff' ), |
2163 | 2164 | 'title' => wfMsg( 'tooltip-diff' ).' ['.wfMsg( 'accesskey-diff' ).']', |
2164 | 2165 | ); |
2165 | | - $buttons['diff'] = Xml::element('input', $temp, ''); |
| 2166 | + $buttons['diff'] = Xml::element( 'input', $temp, '' ); |
2166 | 2167 | |
2167 | 2168 | wfRunHooks( 'EditPageBeforeEditButtons', array( &$this, &$buttons, &$tabindex ) ); |
2168 | 2169 | return $buttons; |
— | — | @@ -2210,8 +2211,8 @@ |
2211 | 2212 | $newtext = $this->mArticle->replaceSection( |
2212 | 2213 | $this->section, $this->textbox1, $this->summary, $this->edittime ); |
2213 | 2214 | $newtext = $this->mArticle->preSaveTransform( $newtext ); |
2214 | | - $oldtitle = wfMsgExt( 'currentrev', array('parseinline') ); |
2215 | | - $newtitle = wfMsgExt( 'yourtext', array('parseinline') ); |
| 2215 | + $oldtitle = wfMsgExt( 'currentrev', array( 'parseinline' ) ); |
| 2216 | + $newtitle = wfMsgExt( 'yourtext', array( 'parseinline' ) ); |
2216 | 2217 | if ( $oldtext !== false || $newtext != '' ) { |
2217 | 2218 | $de = new DifferenceEngine( $this->mTitle ); |
2218 | 2219 | $de->setText( $oldtext, $newtext ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1039,8 +1039,8 @@ |
1040 | 1040 | 'hr_tip' => 'Horizontal line (use sparingly)', |
1041 | 1041 | |
1042 | 1042 | # Edit pages |
1043 | | -'summary' => 'Summary', |
1044 | | -'subject' => 'Subject/headline', |
| 1043 | +'summary' => 'Summary:', |
| 1044 | +'subject' => 'Subject/headline:', |
1045 | 1045 | 'minoredit' => 'This is a minor edit', |
1046 | 1046 | 'watchthis' => 'Watch this page', |
1047 | 1047 | 'savearticle' => 'Save page', |
— | — | @@ -1056,7 +1056,7 @@ |
1057 | 1057 | 'missingcommentheader' => "'''Reminder:''' You have not provided a subject/headline for this comment. |
1058 | 1058 | If you click Save again, your edit will be saved without one.", |
1059 | 1059 | 'summary-preview' => 'Summary preview', |
1060 | | -'subject-preview' => 'Subject/headline preview', |
| 1060 | +'subject-preview' => 'Subject/headline preview:', |
1061 | 1061 | 'blockedtitle' => 'User is blocked', |
1062 | 1062 | 'blockedtext' => "<big>'''Your user name or IP address has been blocked.'''</big> |
1063 | 1063 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -442,9 +442,9 @@ |
443 | 443 | * (bug 16712) Special:NewFiles updated to use "newer"/"older" paging messages |
444 | 444 | for clarity over "previous/next" |
445 | 445 | * (bug 16612) Fixed "noprint" class for Modern skin print style |
446 | | -* (bug 16026) revision-info, revision-info-current, cannotdelete, |
447 | | - redirectedfrom, historywarning and difference messages now use Wiki text |
448 | | - rather than raw HTML markup |
| 446 | +* (bugs 212, 16026) revision-info, revision-info-current, cannotdelete, |
| 447 | + redirectedfrom, historywarning, difference, summary and subject messages now |
| 448 | + use Wiki text rather than raw HTML markup |
449 | 449 | * (bug 13835) Fix rendering of {{filepath:Wiki.png|nowiki}} |
450 | 450 | * (bug 16772) Special:Upload now correctly rejects files with spaces in the |
451 | 451 | file extension (e.g. Foo. jpg). |