Umherirrender has submitted this change and it was merged.

Change subject: Replace deprecated wfMsg* functions in /api
......................................................................


Replace deprecated wfMsg* functions in /api

Bug: T70750
Change-Id: Ic277d4bfb181348727009217821af96510247236
---
M api/ApiAuthorSubmissionDelete.php
M api/ApiAuthorSubmissionEdit.php
M api/ApiConferenceEdit.php
M api/ApiConferenceEventAdd.php
M api/ApiConferenceEventDelete.php
M api/ApiConferenceEventEdit.php
M api/ApiConferenceLocationAdd.php
M api/ApiConferenceLocationDelete.php
M api/ApiConferenceLocationEdit.php
M api/ApiConferenceOrganizerAdd.php
M api/ApiConferenceOrganizerDelete.php
M api/ApiConferenceOrganizerEdit.php
M api/ApiConferencePageAdd.php
M api/ApiConferencePageDelete.php
M api/ApiConferencePageEdit.php
15 files changed, 39 insertions(+), 39 deletions(-)

Approvals:
  Umherirrender: Verified; Looks good to me, approved
  Florianschmidtwelzow: Looks good to me, approved



diff --git a/api/ApiAuthorSubmissionDelete.php 
b/api/ApiAuthorSubmissionDelete.php
index 7cbd721..eb0c653 100644
--- a/api/ApiAuthorSubmissionDelete.php
+++ b/api/ApiAuthorSubmissionDelete.php
@@ -31,8 +31,8 @@
                if ( $isAuthor )
                {
                        # now check for the validity of title passed and 
conference title
-                       $text = $conferenceTitle . '/'.wfMsgForContent( 
'cvext-authors' ) . '/' . $user->getName() 
-                       . '/' . wfMsgForContent( 'cvext-submissions' ) . '/' . 
$title;
+                       $text = $conferenceTitle . '/'.$this->msg( 
'cvext-authors' )->inContentLanguage()->text() . '/' . $user->getName()
+                       . '/' . $this->msg( 'cvext-submissions' 
)->inContentLanguage()->text() . '/' . $title;
                        $titleObj = Title::newFromText( $text );
                        $titleConfObj = Title::newFromText( $conferenceTitle );
                        //$conferenceId = ConferenceUtils::getConferenceId( 
$titleConfObj->getDBkey() );
diff --git a/api/ApiAuthorSubmissionEdit.php b/api/ApiAuthorSubmissionEdit.php
index f20d8f4..5be8dbb 100644
--- a/api/ApiAuthorSubmissionEdit.php
+++ b/api/ApiAuthorSubmissionEdit.php
@@ -59,8 +59,8 @@
                        //which we are performing here
                        //so just check out to see which one is better
                        $username = $user->getName();
-                       $text = $conferenceTitle . '/' . wfMsgForContent( 
'cvext-authors' ) . '/' . $username . '/' 
-                                       . wfMsgForContent( 'cvext-submissions' 
) . '/' . $title;
+                       $text = $conferenceTitle . '/' . $this->msg( 
'cvext-authors' )->inContentLanguage()->text() . '/' . $username . '/'
+                                       . $this->msg( 'cvext-submissions' 
)->inContentLanguage()->text() . '/' . $title;
                        $titleObj = Title::newFromText( $text );
                        $titleConfObj = Title::newFromText( $conferenceTitle );
                        //$conferenceId = ConferenceUtils::getConferenceId( 
$titleConfObj->getDBkey() );
@@ -94,8 +94,8 @@
                                //also keep a check for the validity of titleTo
                                //also keep a check for other inputs
                                //just like title we have $titleTo which is 
just the rightmost part of the whole title (refer to the above Note)
-                               $text = $conferenceTitle . '/' . 
wfMsgForContent( 'cvext-authors' ) . '/' . $username 
-                                       . '/' . wfMsgForContent( 
'cvext-submissions' ) . '/' . $titleTo;
+                               $text = $conferenceTitle . '/' . $this->msg( 
'cvext-authors' )->inContentLanguage()->text() . '/' . $username
+                                       . '/' . $this->msg( 'cvext-submissions' 
)->inContentLanguage()->text() . '/' . $titleTo;
                                $titleNew = Title::newFromText( $text );
                                //$toText = Title::newFromText($titleTo);
                                if ( !$titleNew )
diff --git a/api/ApiConferenceEdit.php b/api/ApiConferenceEdit.php
index 9ab6fb2..eba43a4 100644
--- a/api/ApiConferenceEdit.php
+++ b/api/ApiConferenceEdit.php
@@ -163,7 +163,7 @@
        private function setResultArray( $msgCode , $params = array(), $type = 
'failure' ) {
                $result = array();
                $result['done'] = $type === 'failure' ? false : true;
-               $result['msg'] = empty( $params ) ? wfMsg( $msgCode ) : wfMsg( 
$msgCode, $params );
+               $result['msg'] = $this->msg( $msgCode, $params )->text();
                $this->getResult()->addValue( null, $this->getModuleName(), 
$result );
        }
 
diff --git a/api/ApiConferenceEventAdd.php b/api/ApiConferenceEventAdd.php
index 2b958e2..e923301 100644
--- a/api/ApiConferenceEventAdd.php
+++ b/api/ApiConferenceEventAdd.php
@@ -53,7 +53,7 @@
                if ( $startTime === $endTime )
                {
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 
'cvext-dash-starttimeequalendtime' );
+                       $result['msg'] = $this->msg( 
'cvext-dash-starttimeequalendtime' )->text();
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                        return ;
                }
@@ -63,11 +63,11 @@
                if ( $roomNo === '-1' )
                {
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 
'cvext-dash-nolocforevents-long' );
+                       $result['msg'] = $this->msg( 
'cvext-dash-nolocforevents-long' )->text();
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                        return ;
                }
-               $localisedText = '/' . wfMsgForContent( 'cvext-locations' ) . 
'/';
+               $localisedText = '/' . $this->msg( 'cvext-locations' 
)->inContentLanguage()->text() . '/';
                $locationTitleText = $conferenceTitle . $localisedText . 
$roomNo;
                $locationTitle = Title::newFromText( $locationTitleText );
                if ( !$locationTitle )
@@ -89,7 +89,7 @@
                        //$this->dieUsageMsg(array('spamdetected',put the 
parameter due to which error was thrown))
                                
                }
-               $eventLocalisedText = '/' . wfMsgForContent( 'cvext-events' ) . 
'/';
+               $eventLocalisedText = '/' . $this->msg( 'cvext-events' 
)->inContentLanguage()->text() . '/';
                $eventTitleText = $conferenceTitle . $eventLocalisedText . 
$topic . '-' . $day . '-' 
                                . $startTime . '-' . $endTime . '-' . $group;
                $eventTitle = Title::newFromText( $eventTitleText );
@@ -113,7 +113,7 @@
                if ( isset( $timeslotConflict['error'] ) && 
$timeslotConflict['error'] )
                {
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 'cvext-eventadd-fail' );
+                       $result['msg'] = $this->msg( 'cvext-eventadd-fail' 
)->text();
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                        return ;
                        
@@ -141,11 +141,11 @@
                        $result['location'] = $location->getRoomNo();
                        $result['locationurl']= $locationTitle->getFullURL();
                        $result['eventurl'] = $eventTitle->getFullURL();
-                       $result['msg'] = wfMsg( 'cvext-eventadd-success' );
+                       $result['msg'] = $this->msg( 'cvext-eventadd-success' 
)->text;
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                } else {
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 'cvext-eventadd-fail' );
+                       $result['msg'] = $this->msg( 'cvext-eventadd-fail' 
)->text();
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                }
 
diff --git a/api/ApiConferenceEventDelete.php b/api/ApiConferenceEventDelete.php
index 675e0f1..f4e8127 100644
--- a/api/ApiConferenceEventDelete.php
+++ b/api/ApiConferenceEventDelete.php
@@ -54,7 +54,7 @@
                                
                }
 
-               $eventTitleText = $conferenceTitle . '/' . wfMsgForContent( 
'cvext-events' ) . '/' . $topic . '-' . $day 
+               $eventTitleText = $conferenceTitle . '/' . $this->msg( 
'cvext-events' )->inContentLanguage()->text() . '/' . $topic . '-' . $day
                        . '-' . $startTime . '-' . $endTime . '-' . $group;
                $eventTitle = Title::newFromText( $eventTitleText );
                if ( !$eventTitle )
diff --git a/api/ApiConferenceEventEdit.php b/api/ApiConferenceEventEdit.php
index 0e051fd..0814ffc 100644
--- a/api/ApiConferenceEventEdit.php
+++ b/api/ApiConferenceEventEdit.php
@@ -55,14 +55,14 @@
                        if ( $starttimeto === $endtimeto )
                        {
                                $result['done'] = false;
-                               $result['msg'] = wfMsg( 
'cvext-dash-starttimeequalendtime' );
+                               $result['msg'] = $this->msg( 
'cvext-dash-starttimeequalendtime' )->text();
                                $resultApi->addValue( null, 
$this->getModuleName(), $result );
                                return ;
                        }
                        if ( DateTime::createFromFormat('His', $starttimeto . 
'00' ) > DateTime::createFromFormat('His', $endtimeto . '00' ) )
                        {
                                $result['done'] = false;
-                               $result['msg'] = wfMsg( 
'cvext-dash-invalidtimes' );
+                               $result['msg'] = $this->msg( 
'cvext-dash-invalidtimes' )->text();
                                $resultApi->addValue( null, 
$this->getModuleName(), $result );
                                return ;
                        }
@@ -94,7 +94,7 @@
                        $conferenceTitle = $sessionData['title'];
                        if ( $params['locationto'] )
                        {
-                               $localisedText = '/' . wfMsgForContent( 
'cvext-locations' ) .'/';
+                               $localisedText = '/' . $this->msg( 
'cvext-locations' )->inContentLanguage()->text() .'/';
                                $locationText = $conferenceTitle . 
$localisedText . $params['locationto'];
                                $titleLocation = Title::newFromText( 
$locationText );
                                if ( !$titleLocation )
@@ -111,7 +111,7 @@
                                }
                        }
                        //modify the day value
-                       $eventLocalisedText = '/' . wfMsgForContent( 
'cvext-events' ) . '/';
+                       $eventLocalisedText = '/' . $this->msg( 'cvext-events' 
)->inContentLanguage()->text() . '/';
                        $oldText = $conferenceTitle . $eventLocalisedText . 
$params['topic'] . '-' . $day . '-' . $params['starttime'] 
                                . '-' . $params['endtime'] . '-' . $group;
                        $newText = $conferenceTitle . $eventLocalisedText . 
$topicto . '-' . $dayto . '-' . $starttimeto 
@@ -168,7 +168,7 @@
                                        {
                                                        
                                                //no need to perform an edit , 
just send back the msg stating no edit operation was performed
-                                               $result['msg'] = wfMsg( 
'cvext-eventedit-same' );
+                                               $result['msg'] = $this->msg( 
'cvext-eventedit-same' )->text();
                                                $result['done'] = true;
                                                $result['noedit'] = true;
                                                $resultApi->addValue( null, 
$this->getModuleName(), $result );
diff --git a/api/ApiConferenceLocationAdd.php b/api/ApiConferenceLocationAdd.php
index 8bcf82f..1523aaf 100644
--- a/api/ApiConferenceLocationAdd.php
+++ b/api/ApiConferenceLocationAdd.php
@@ -85,18 +85,18 @@
                                $result['url'] = $url;
                                $locUrl = Title::makeTitle( NS_MAIN, 
$title->getDBkey() )->getFullURL();
                                $result['locurl'] = $locUrl;
-                               $result['msg'] = wfMsg( 'cvext-locadd-success' 
);
+                               $result['msg'] = $this->msg( 
'cvext-locadd-success' )->text();
 
                        } else {
                                $result['done'] = false;
-                               $result['msg'] = wfMsg( 'cvext-loc-noconf' );
+                               $result['msg'] = $this->msg( 'cvext-loc-noconf' 
)->text();
                        }
 
 
                } else {
                                
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 'cvext-locadd-fail' );
+                       $result['msg'] = $this->msg( 'cvext-locadd-fail' 
)->text();
 
                }
                $resultApi->addValue( null, $this->getModuleName(), $result );
diff --git a/api/ApiConferenceLocationDelete.php 
b/api/ApiConferenceLocationDelete.php
index fe4a759..7fc1389 100644
--- a/api/ApiConferenceLocationDelete.php
+++ b/api/ApiConferenceLocationDelete.php
@@ -42,7 +42,7 @@
                $conferenceId = $sessionData['id'];
                $conferenceTitle = $sessionData['title'];
 
-               $titleText = $conferenceTitle . '/' . wfMsgForContent( 
'cvext-locations' ) . '/' . $roomNo;
+               $titleText = $conferenceTitle . '/' . $this->msg( 
'cvext-locations' )->inContentLanguage()->text() . '/' . $roomNo;
                $title = Title::newFromText( $titleText );
                if ( !$title )
                {
@@ -71,7 +71,7 @@
                                        $schedule->deleteLocation( 
$dummyLocation );
                                }
                        } else {
-                               $result['msg'] = wfMsg( 'cvext-loc-noconf' );
+                               $result['msg'] = $this->msg( 'cvext-loc-noconf' 
)->text();
                                $result['done'] = false;
                        }
 
diff --git a/api/ApiConferenceLocationEdit.php 
b/api/ApiConferenceLocationEdit.php
index f49efee..d29cced 100644
--- a/api/ApiConferenceLocationEdit.php
+++ b/api/ApiConferenceLocationEdit.php
@@ -56,7 +56,7 @@
                //we dont need to check the validity of location title , or do 
we ?
                $conferenceId = $sessionData['id'];
                $conferenceTitle = $sessionData['title'];
-               $titleText = $conferenceTitle . '/' . wfMsgForContent( 
'cvext-locations' ) . '/' . $roomNo;
+               $titleText = $conferenceTitle . '/' . $this->msg( 
'cvext-locations' )->inContentLanguage()->text() . '/' . $roomNo;
                $title = Title::newFromText( $titleText );
                if ( !$title )
                {
@@ -88,7 +88,7 @@
                                
                                //its a big change need to think about it
                                //now we need to check the validity of roomnoto 
-                               $toTitleText = $conferenceTitle . '/' . 
wfMsgForContent( 'cvext-locations' ) . '/' . $roomNoTo;
+                               $toTitleText = $conferenceTitle . '/' . 
$this->msg( 'cvext-locations' )->inContentLanguage()->text() . '/' . $roomNoTo;
                                $titleTo = Title::newFromText( $toTitleText );
                                if ( !$titleTo )
                                {
@@ -147,7 +147,7 @@
                                        }
                                        $roomNo = $roomNoTo;
                                } else {
-                                       $result['msg'] = wfMsg( 
'cvext-loc-noconf' );
+                                       $result['msg'] = $this->msg( 
'cvext-loc-noconf' )->text();
                                        $result['done'] = false;
                                        $resultApi->addValue( null, 
$this->getModuleName(), $result );
                                        return ;
diff --git a/api/ApiConferenceOrganizerAdd.php 
b/api/ApiConferenceOrganizerAdd.php
index 5a8bf79..d47f5ea 100644
--- a/api/ApiConferenceOrganizerAdd.php
+++ b/api/ApiConferenceOrganizerAdd.php
@@ -65,7 +65,7 @@
                {
                        
                        /* modify the organizer page if it exists */
-                       $orgsTitleText = $conferenceTitle . '/' . 
wfMsgForContent( 'cvext-pages' ) . '/' . wfMsgForContent( 'cvext-orgteam' );
+                       $orgsTitleText = $conferenceTitle . '/' . $this->msg( 
'cvext-pages' )->inContentLanguage()->text() . '/' . $this->msg( 
'cvext-orgteam' )->inContentLanguage()->text();
                        $orgsPageTitle = Title::newFromText( $orgsTitleText );
                        if ( $orgsPageTitle->exists() )
                        {
@@ -121,7 +121,7 @@
                        
                        //$orgurl = Title::makeTitle(NS_MAIN, 
$conferenceId.'/organizers/'.$user->getName())->getFullURL();
                        $result['done'] = true;
-                       $result['msg'] = wfMsg( 'cvext-orgadd-success' );
+                       $result['msg'] = $this->msg( 'cvext-orgadd-success' 
)->text();
                        $result['id'] = $organizer->getOrganizerId();
                        $result['username'] = $addedUser->getName();
                        $result['category'] = $category;
@@ -136,7 +136,7 @@
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                } else {
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 'cvext-orgadd-fail' );
+                       $result['msg'] = $this->msg( 'cvext-orgadd-fail' 
)->text();
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                }
        }
diff --git a/api/ApiConferenceOrganizerDelete.php 
b/api/ApiConferenceOrganizerDelete.php
index f281f11..4696c67 100644
--- a/api/ApiConferenceOrganizerDelete.php
+++ b/api/ApiConferenceOrganizerDelete.php
@@ -60,7 +60,7 @@
                        if ( $result['done'] )
                        {
                                /* modify the organizing team page if it exists 
*/
-                               $orgsTitleText = $conferenceTitle . '/' . 
wfMsgForContent( 'cvext-pages' ) . '/' . wfMsgForContent( 'cvext-orgteam' );
+                               $orgsTitleText = $conferenceTitle . '/' . 
$this->msg( 'cvext-pages' )->inContentLanguage()->text() . '/' . $this->msg( 
'cvext-orgteam' )->inContentLanguage()->text();
                                $orgsPageTitle = Title::newFromText( 
$orgsTitleText );
                                if ( $orgsPageTitle->exists() )
                                {
diff --git a/api/ApiConferenceOrganizerEdit.php 
b/api/ApiConferenceOrganizerEdit.php
index 3ae1f3e..f48f48d 100644
--- a/api/ApiConferenceOrganizerEdit.php
+++ b/api/ApiConferenceOrganizerEdit.php
@@ -109,7 +109,7 @@
                        if ( $result['flag'] == Conference::SUCCESS_CODE )
                        {
                                /* modify the organizing team page if it exists 
*/
-                               $orgsTitleText = $conferenceTitle . '/' . 
wfMsgForContent( 'cvext-pages' ) . '/' . wfMsgForContent( 'cvext-orgteam' );
+                               $orgsTitleText = $conferenceTitle . '/' . 
$this->msg( 'cvext-pages' )->inContentLanguage()->text() . '/' . $this->msg( 
'cvext-orgteam' )->inContentLanguage()->text();
                                $orgsPageTitle = Title::newFromText( 
$orgsTitleText );
                                if ( $orgsPageTitle->exists() )
                                {
diff --git a/api/ApiConferencePageAdd.php b/api/ApiConferencePageAdd.php
index cecd87a..cb4b4d3 100644
--- a/api/ApiConferencePageAdd.php
+++ b/api/ApiConferencePageAdd.php
@@ -54,7 +54,7 @@
                //this is just checking the validity of the title passed along
                //sad part is that createFromScratch() never checks for the 
existence of title in the database so we will have to check that here only
                $confTitle = $sessionData['title'];
-               $localisedText = '/' . wfMsgForContent( 'cvext-pages' ) . '/';
+               $localisedText = '/' . $this->msg( 'cvext-pages' 
)->inContentLanguage()->text() . '/';
                
                $isTypePreLoaded = ConferencePage::isPreloadedType( $type, 
'userlang' );
                /*
@@ -91,11 +91,11 @@
                        $result['id'] = $page->getId();
                        $result['pagetype'] = $page->getType();
                        $result['pageurl'] = Title::makeTitle( NS_MAIN, 
$confTitle . $localisedText . $page->getType() )->getFullURL();
-                       $result['msg'] = wfMsg( 'cvext-pageadd-success' );
+                       $result['msg'] = $this->msg( 'cvext-pageadd-success' 
)->text();
                
                } else {
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 'cvext-pageadd-fail' );
+                       $result['msg'] = $this->msg( 'cvext-pageadd-fail' 
)->text();
                }
                $resultApi->addValue( null, $this->getModuleName(), $result );
 
diff --git a/api/ApiConferencePageDelete.php b/api/ApiConferencePageDelete.php
index 83aa947..a3f0209 100644
--- a/api/ApiConferencePageDelete.php
+++ b/api/ApiConferencePageDelete.php
@@ -32,7 +32,7 @@
                        $this->dieUsage( 'No conference details were found in 
the session object for this user', 'noconfinsession' );
                }
                $conferenceId = $sessionData['id'];
-               $localisedText = '/' . wfMsgForContent( 'cvext-pages' ) . '/';
+               $localisedText = '/' . $this->msg( 'cvext-pages' 
)->inContentLanguage()->text() . '/';
                $type = $params['pagetype'];
                $type = ConferencePage::isPreloadedType( $type, 'userlang' ) ? 
ConferencePage::convert( $type, 'userlang', 'contlang' ) : $type;
                $text = $sessionData['title'] . $localisedText . $type;
diff --git a/api/ApiConferencePageEdit.php b/api/ApiConferencePageEdit.php
index 0c5156e..2cad164 100644
--- a/api/ApiConferencePageEdit.php
+++ b/api/ApiConferencePageEdit.php
@@ -36,14 +36,14 @@
                }
                
                
-               $middleText = '/' . wfMsgForContent( 'cvext-pages' ) . '/';
+               $middleText = '/' . $this->msg( 'cvext-pages' 
)->inContentLanguage()->text() . '/';
                /* we dont allow pageTypeTo be of preloaded type */
                $pageType = $params['pagetype'];
                $pageTypeTo = $params['pagetypeto'];
                if ( ConferencePage::isPreloadedType( $pageTypeTo, 'userlang' ) 
)
                {
                        $result['done'] = false;
-                       $result['msg'] = wfMsg( 'cvext-pageedit-notallowed' );
+                       $result['msg'] = $this->msg( 
'cvext-pageedit-notallowed' )->text;
                        $resultApi->addValue( null, $this->getModuleName(), 
$result );
                        return ;
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/251135
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic277d4bfb181348727009217821af96510247236
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ConventionExtension
Gerrit-Branch: master
Gerrit-Owner: McIntireEvan <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: McIntireEvan <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to