r77336 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77335‎ | r77336 | r77337 >
Date:18:39, 26 November 2010
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: follow-up to r76665 - prevent notices about undefined variables
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php
@@ -385,17 +385,17 @@
386386 <div class="cleared"></div>
387387 <p class="profile-update-unit-left">' . wfMsg( 'user-profile-personal-email' ) . '</p>
388388 <p class="profile-update-unit"><input type="text" size="25" name="email" id="email" value="' . $email . '"/>';
389 - if ( !$wgUser->mEmailAuthenticated ) {
390 - $confirm = SpecialPage::getTitleFor( 'Confirmemail' );
391 - $form .= " <a href=\"{$confirm->getFullURL()}\">" . wfMsg( 'user-profile-personal-confirmemail' ) . '</a>';
392 - }
393 - $form .= '</p>
 389+ if ( !$wgUser->mEmailAuthenticated ) {
 390+ $confirm = SpecialPage::getTitleFor( 'Confirmemail' );
 391+ $form .= " <a href=\"{$confirm->getFullURL()}\">" . wfMsg( 'user-profile-personal-confirmemail' ) . '</a>';
 392+ }
 393+ $form .= '</p>
394394 <div class="cleared"></div>';
395 - if ( !$wgUser->mEmailAuthenticated ) {
396 - $form .= '<p class="profile-update-unit-left"></p>
 395+ if ( !$wgUser->mEmailAuthenticated ) {
 396+ $form .= '<p class="profile-update-unit-left"></p>
397397 <p class="profile-update-unit-small">' . wfMsg( 'user-profile-personal-email-needs-auth' ) . '</p>';
398 - }
399 - $form .= '<div class="cleared"></div>
 398+ }
 399+ $form .= '<div class="cleared"></div>
400400 </div>
401401 <div class="cleared"></div>';
402402
@@ -405,13 +405,13 @@
406406 <p class="profile-update-unit"><input type="text" size="25" name="location_city" id="location_city" value="' . ( isset( $location_city ) ? $location_city : '' ) . '" /></p>
407407 <div class="cleared"></div>
408408 <p class="profile-update-unit-left" id="location_state_label">' . wfMsg( 'user-profile-personal-country' ) . '</p>';
409 - $form .= '<p class="profile-update-unit">';
410 - $form .= '<span id="location_state_form">';
411 - $form .= "</span>
412 - <script type=\"text/javascript\">
 409+ $form .= '<p class="profile-update-unit">';
 410+ $form .= '<span id="location_state_form">';
 411+ $form .= "</span>
 412+ <script type=\"text/javascript\">
413413 displaySection(\"location_state\",\"" . $location_country . "\",\"" . ( isset( $location_state ) ? $location_state : '' ) . "\");
414414 </script>";
415 - $form .= "<select name=\"location_country\" id=\"location_country\" onchange=\"displaySection('location_state',this.value,'')\"><option></option>";
 415+ $form .= "<select name=\"location_country\" id=\"location_country\" onchange=\"displaySection('location_state',this.value,'')\"><option></option>";
416416
417417 foreach ( $countries as $country ) {
418418 $form .= "<option value=\"{$country}\"" . ( ( $country == $location_country ) ? ' selected="selected"' : '' ) . ">";
@@ -548,60 +548,66 @@
549549 $wgOut->setPageTitle( wfMsg( 'user-profile-section-interests' ) );
550550 $form = UserProfile::getEditProfileNav( wfMsg( 'user-profile-section-interests' ) );
551551 $form .= '<form action="" method="post" enctype="multipart/form-data" name="profile">
552 - <div class="profile-info clearfix">';
553 - $form .= "<div class=\"profile-update\">
554 - <p class=\"profile-update-title\">" . wfMsg( 'user-profile-interests-entertainment' ) . "</p>
555 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-movies' ) . "</p>
556 - <p class=\"profile-update-unit\">
557 - <textarea name=\"movies\" id=\"movies\" rows=\"3\" cols=\"75\">{$movies}</textarea>
 552+ <div class="profile-info clearfix">
 553+ <div class="profile-update">
 554+ <p class="profile-update-title">' . wfMsg( 'user-profile-interests-entertainment' ) . '</p>
 555+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-movies' ) . '</p>
 556+ <p class="profile-update-unit">
 557+ <textarea name="movies" id="movies" rows="3" cols="75">' . ( isset( $movies ) ? $movies : '' ) . '</textarea>
558558 </p>
559 - <div class=\"cleared\"></div>
560 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-tv' ) . "</p>
561 - <p class=\"profile-update-unit\">
562 - <textarea name=\"tv\" id=\"tv\" rows=\"3\" cols=\"75\">{$tv}</textarea>
563 - </p>
564 - <div class=\"cleared\"></div>
565 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-music' ) . "</p>
566 - <p class=\"profile-update-unit\">
567 - <textarea name=\"music\" id=\"music\" rows=\"3\" cols=\"75\">{$music}</textarea>
 559+ <div class="cleared"></div>
 560+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-tv' ) . '</p>
 561+ <p class="profile-update-unit">
 562+ <textarea name="tv" id="tv" rows="3" cols="75">' . ( isset( $tv ) ? $tv : '' ) . '</textarea>
568563 </p>
569 - <div class=\"cleared\"></div>
570 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-books' ) . "</p>
571 - <p class=\"profile-update-unit\">
572 - <textarea name=\"books\" id=\"books\" rows=\"3\" cols=\"75\">{$books}</textarea>
 564+ <div class="cleared"></div>
 565+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-music' ) . '</p>
 566+ <p class="profile-update-unit">
 567+ <textarea name="music" id="music" rows="3" cols="75">' . ( isset( $music ) ? $music : '' ) . '</textarea>
573568 </p>
574 - <div class=\"cleared\"></div>
575 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-magazines' ) . "</p>
576 - <p class=\"profile-update-unit\">
577 - <textarea name=\"magazines\" id=\"magazines\" rows=\"3\" cols=\"75\">{$magazines}</textarea>
 569+ <div class="cleared"></div>
 570+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-books' ) . '</p>
 571+ <p class="profile-update-unit">
 572+ <textarea name="books" id="books" rows="3" cols="75">' . ( isset( $books ) ? $books : '' ) . '</textarea>
578573 </p>
579 - <div class=\"cleared\"></div>
580 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-videogames' ) . "</p>
581 - <p class=\"profile-update-unit\">
582 - <textarea name=\"videogames\" id=\"videogames\" rows=\"3\" cols=\"75\">{$videogames}</textarea>
 574+ <div class="cleared"></div>
 575+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-magazines' ) . '</p>
 576+ <p class="profile-update-unit">
 577+ <textarea name="magazines" id="magazines" rows="3" cols="75">' . ( isset( $magazines ) ? $magazines : '' ) . '</textarea>
583578 </p>
584 - <div class=\"cleared\"></div>
 579+ <div class="cleared"></div>
 580+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-videogames' ) . '</p>
 581+ <p class="profile-update-unit">
 582+ <textarea name="videogames" id="videogames" rows="3" cols="75">' . ( isset( $videogames ) ? $videogames : '' ) . '</textarea>
 583+ </p>
 584+ <div class="cleared"></div>
585585 </div>
586 - <div class=\"profile-info clearfix\">
587 - <p class=\"profile-update-title\">" . wfMsg( 'user-profile-interests-eats' ) . "</p>
588 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-foodsnacks' ) . "</p>
589 - <p class=\"profile-update-unit\">
590 - <textarea name=\"snacks\" id=\"snacks\" rows=\"3\" cols=\"75\">{$snacks}</textarea>
 586+ <div class="profile-info clearfix">
 587+ <p class="profile-update-title">' . wfMsg( 'user-profile-interests-eats' ) . '</p>
 588+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-foodsnacks' ) . '</p>
 589+ <p class="profile-update-unit">
 590+ <textarea name="snacks" id="snacks" rows="3" cols="75">' . ( isset( $snacks ) ? $snacks : '' ) . '</textarea>
591591 </p>
592 - <div class=\"cleared\"></div>
593 - <p class=\"profile-update-unit-left\">" . wfMsg( 'user-profile-interests-drinks' ) . "</p>
594 - <p class=\"profile-update-unit\">
595 - <textarea name=\"drinks\" id=\"drinks\" rows=\"3\" cols=\"75\">{$drinks}</textarea>
 592+ <div class="cleared"></div>
 593+ <p class="profile-update-unit-left">' . wfMsg( 'user-profile-interests-drinks' ) . '</p>
 594+ <p class="profile-update-unit">
 595+ <textarea name="drinks" id="drinks" rows="3" cols="75">' . ( isset( $drinks ) ? $drinks : '' ) . '</textarea>
596596 </p>
597 - <div class=\"cleared\"></div>
 597+ <div class="cleared"></div>
598598 </div>
599 - <input type=\"button\" class=\"site-button\" value=" . wfMsg( 'user-profile-update-button' ) . " size=\"20\" onclick=\"document.profile.submit()\" />
 599+ <input type="button" class="site-button" value="' . wfMsg( 'user-profile-update-button' ) . '" size="20" onclick="document.profile.submit()" />
600600 </div>
601 - </form>";
 601+ </form>';
602602
603603 return $form;
604604 }
605605
 606+ /**
 607+ * Displays the form for toggling notifications related to social tools
 608+ * (e-mail me when someone friends/foes me, send me a gift, etc.)
 609+ *
 610+ * @return HTML
 611+ */
606612 function displayPreferencesForm() {
607613 global $wgUser, $wgOut;
608614
@@ -674,28 +680,28 @@
675681 <div id="profile-update-custom1">
676682 <p class="profile-update-unit-left">' . wfMsgForContent( 'custom-info-field1' ) . '</p>
677683 <p class="profile-update-unit">
678 - <textarea name="custom1" id="fav_moment" rows="3" cols="75">' . $custom1 . '</textarea>
 684+ <textarea name="custom1" id="fav_moment" rows="3" cols="75">' . ( isset( $custom1 ) ? $custom1 : '' ) . '</textarea>
679685 </p>
680686 </div>
681687 <div class="cleared"></div>
682688 <div id="profile-update-custom2">
683689 <p class="profile-update-unit-left">' . wfMsgForContent( 'custom-info-field2' ) . '</p>
684690 <p class="profile-update-unit">
685 - <textarea name="custom2" id="least_moment" rows="3" cols="75">' . $custom2 . '</textarea>
 691+ <textarea name="custom2" id="least_moment" rows="3" cols="75">' . ( isset( $custom2 ) ? $custom2 : '' ) . '</textarea>
686692 </p>
687693 </div>
688694 <div class="cleared"></div>
689695 <div id="profile-update-custom3">
690696 <p class="profile-update-unit-left">' . wfMsgForContent( 'custom-info-field3' ) . '</p>
691697 <p class="profile-update-unit">
692 - <textarea name="custom3" id="fav_athlete" rows="3" cols="75">' . $custom3 . '</textarea>
 698+ <textarea name="custom3" id="fav_athlete" rows="3" cols="75">' . ( isset( $custom3 ) ? $custom3 : '' ) . '</textarea>
693699 </p>
694700 </div>
695701 <div class="cleared"></div>
696702 <div id="profile-update-custom4">
697703 <p class="profile-update-unit-left">' . wfMsgForContent( 'custom-info-field4' ) . '</p>
698704 <p class="profile-update-unit">
699 - <textarea name="custom4" id="least_fav_athlete" rows="3" cols="75">' . $custom4 . '</textarea>
 705+ <textarea name="custom4" id="least_fav_athlete" rows="3" cols="75">' . ( isset( $custom4 ) ? $custom4 : '' ) . '</textarea>
700706 </p>
701707 </div>
702708 <div class="cleared"></div>

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76665SocialProfile: bug #25805 - shut up warnings in Special:UpdateProfile. Patch ...ashley19:12, 14 November 2010

Status & tagging log