37 if ( !$this->plaintext ) {
38 $text = MediaWikiServices::getInstance()->getContentLanguage()->
39 ucfirst(
$title->getDBkey() );
42 if ( count( $parts ) === 2 ) {
47 strtr( $parts[0],
'_',
' ' ) .
53 if ( $titleLink !==
false ) {
63 $key = parent::getMessageKey();
65 if ( !isset( $params[3] ) && !isset( $params[4] ) ) {
74 $params = parent::getMessageParameters();
77 if ( !isset( $params[3] ) && !isset( $params[4] ) ) {
84 $userName = $this->entry->getTarget()->getText();
85 if ( !$this->plaintext && count( $oldGroups ) ) {
86 foreach ( $oldGroups as &$group ) {
90 if ( !$this->plaintext && count( $newGroups ) ) {
91 foreach ( $newGroups as &$group ) {
97 $allParams = $this->entry->getParameters();
99 if ( count( $oldGroups ) ) {
101 $allParams[
'oldmetadata'] ?? [] ) ];
103 $params[3] = $this->
msg(
'rightsnone' )->text();
105 if ( count( $newGroups ) ) {
108 $params[4] = [
'raw' => $this->
formatRightsList( array_values( $newGroups ),
109 $allParams[
'newmetadata'] ?? [] ) ];
111 $params[4] = $this->
msg(
'rightsnone' )->text();
114 $params[5] = $userName;
120 $uiLanguage = $this->context->getLanguage();
121 $uiUser = $this->context->getUser();
123 $tempList = $permList = [];
126 reset( $serializedUGMs );
127 while ( current( $groups ) ) {
128 $group = current( $groups );
130 if ( current( $serializedUGMs ) &&
131 isset( current( $serializedUGMs )[
'expiry'] ) &&
132 current( $serializedUGMs )[
'expiry']
135 $expiry = current( $serializedUGMs )[
'expiry'];
136 $expiryFormatted = $uiLanguage->userTimeAndDate( $expiry, $uiUser );
137 $expiryFormattedD = $uiLanguage->userDate( $expiry, $uiUser );
138 $expiryFormattedT = $uiLanguage->userTime( $expiry, $uiUser );
139 $tempList[] = $this->
msg(
'rightslogentry-temporary-group' )->params( $group,
140 $expiryFormatted, $expiryFormattedD, $expiryFormattedT )->parse();
143 $permList[] = $group;
147 next( $serializedUGMs );
152 return $uiLanguage->listToText( array_merge( $tempList, $permList ) );
162 '4::oldgroups' =>
'4:array:oldgroups',
163 '5::newgroups' =>
'5:array:newgroups',
165 foreach ( $map as $index => $key ) {
166 if ( isset( $params[$index] ) ) {
167 $params[$key] = $params[$index];
168 unset( $params[$index] );
176 if ( isset( $params[
'4:array:oldgroups'] ) ) {
177 $params[
'4:array:oldgroups'] = $this->
makeGroupArray( $params[
'4:array:oldgroups'] );
179 $oldmetadata =& $params[
'oldmetadata'];
181 unset( $params[
'oldmetadata'] );
182 $params[
'oldmetadata'] = array_map(
function ( $index ) use ( $params, $oldmetadata ) {
183 $result = [
'group' => $params[
'4:array:oldgroups'][$index] ];
184 if ( isset( $oldmetadata[$index] ) ) {
185 $result += $oldmetadata[$index];
190 }, array_keys( $params[
'4:array:oldgroups'] ) );
193 if ( isset( $params[
'5:array:newgroups'] ) ) {
194 $params[
'5:array:newgroups'] = $this->
makeGroupArray( $params[
'5:array:newgroups'] );
196 $newmetadata =& $params[
'newmetadata'];
198 unset( $params[
'newmetadata'] );
199 $params[
'newmetadata'] = array_map(
function ( $index ) use ( $params, $newmetadata ) {
200 $result = [
'group' => $params[
'5:array:newgroups'][$index] ];
201 if ( isset( $newmetadata[$index] ) ) {
202 $result += $newmetadata[$index];
207 }, array_keys( $params[
'5:array:newgroups'] ) );
214 $ret = parent::formatParametersForApi();
215 if ( isset( $ret[
'oldgroups'] ) ) {
218 if ( isset( $ret[
'newgroups'] ) ) {
221 if ( isset( $ret[
'oldmetadata'] ) ) {
225 if ( isset( $ret[
'newmetadata'] ) ) {
234 if ( $group ===
'' ) {
236 } elseif ( is_string( $group ) ) {
237 $group = array_map(
'trim', explode(
',', $group ) );