34 $subtype = $this->entry->getSubtype();
35 if ( $subtype ===
'move_prot' ) {
37 return [ Title::newFromText( $params[3] ) ];
43 $key = parent::getMessageKey();
45 if ( isset( $params[4] ) && $params[4] ) {
54 $params = parent::getMessageParameters();
56 $subtype = $this->entry->getSubtype();
57 if ( $subtype ===
'protect' || $subtype ===
'modify' ) {
58 $rawParams = $this->entry->getParameters();
59 if ( isset( $rawParams[
'details'] ) ) {
61 } elseif ( isset( $params[3] ) ) {
63 $params[3] = $this->context->getLanguage()->getDirMark() . $params[3];
69 if ( isset( $params[4] ) ) {
73 } elseif ( $subtype ===
'move_prot' ) {
74 $oldname = $this->
makePageLink( Title::newFromText( $params[3] ), [
'redirect' =>
'no' ] );
83 $subtype = $this->entry->getSubtype();
85 || $subtype ===
'move_prot'
91 $title = $this->entry->getTarget();
95 $this->
msg(
'hist' )->text(),
98 'action' =>
'history',
99 'offset' => $this->entry->getTimestamp(),
105 if ( MediaWikiServices::getInstance()
107 ->userHasRight( $this->context->getUser(),
'protect' )
111 $this->
msg(
'protect_change' )->text(),
113 [
'action' =>
'protect' ]
117 if ( empty( $links ) ) {
120 return $this->
msg(
'parentheses' )->rawParams(
121 $this->context->getLanguage()->pipeList( $links )
132 if ( $subtype ===
'protect' || $subtype ===
'modify' ) {
136 'details' =>
':array:details',
138 } elseif ( $subtype ===
'move_prot' ) {
141 '4::oldtitle' =>
'4:title:oldtitle',
144 foreach ( $map as $index => $key ) {
145 if ( isset( $params[$index] ) ) {
146 $params[$key] = $params[$index];
147 unset( $params[$index] );
152 if ( isset( $params[
'5:bool:cascade'] ) && is_string( $params[
'5:bool:cascade'] ) ) {
153 $params[
'5:bool:cascade'] = $params[
'5:bool:cascade'] ===
'cascade';
160 $ret = parent::formatParametersForApi();
161 if ( isset( $ret[
'details'] ) && is_array( $ret[
'details'] ) ) {
162 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
163 foreach ( $ret[
'details'] as &$detail ) {
164 if ( isset( $detail[
'expiry'] ) ) {
165 $detail[
'expiry'] = $contLang->
166 formatExpiry( $detail[
'expiry'], TS_ISO_8601,
'infinite' );
181 $protectDescription =
'';
183 foreach ( $details as $param ) {
188 $action = $this->context->msg(
'restriction-' . $param[
'type'] )->escaped();
190 $protectionLevel = $param[
'level'];
192 $message = $this->context->msg(
'protect-level-' . $protectionLevel );
193 if ( $message->isDisabled() ) {
195 $restrictions = $this->context->msg(
"protect-fallback", $protectionLevel )->parse();
197 $restrictions = $message->escaped();
200 if ( $protectDescription !==
'' ) {
201 $protectDescription .= $this->context->msg(
'word-separator' )->escaped();
204 $protectDescription .= $this->context->msg(
'protect-summary-desc' )
205 ->params( $action, $restrictions, $expiryText )->escaped();
208 return $protectDescription;
213 return $this->context->msg(
'protect-expiry-indefinite' )->text();
215 $lang = $this->context->getLanguage();
216 $user = $this->context->getUser();
217 return $this->context->msg(
218 'protect-expiring-local',
219 $lang->userTimeAndDate( $expiry, $user ),
220 $lang->userDate( $expiry, $user ),
221 $lang->userTime( $expiry, $user )
wfIsInfinity( $str)
Determine input string is represents as infinity.
getParameters()
Get the extra parameters stored for this message.
getSubtype()
The log subtype.
if(!isset( $args[0])) $lang