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