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 ( $this->context->getAuthority()->isAllowed(
'protect' ) ) {
108 $this->
msg(
'protect_change' )->text(),
110 [
'action' =>
'protect' ]
114 if ( empty( $links ) ) {
117 return $this->
msg(
'parentheses' )->rawParams(
118 $this->context->getLanguage()->pipeList( $links )
129 if ( $subtype ===
'protect' || $subtype ===
'modify' ) {
133 'details' =>
':array:details',
135 } elseif ( $subtype ===
'move_prot' ) {
138 '4::oldtitle' =>
'4:title:oldtitle',
141 foreach ( $map as $index => $key ) {
142 if ( isset( $params[$index] ) ) {
143 $params[$key] = $params[$index];
144 unset( $params[$index] );
149 if ( isset( $params[
'5:bool:cascade'] ) && is_string( $params[
'5:bool:cascade'] ) ) {
150 $params[
'5:bool:cascade'] = $params[
'5:bool:cascade'] ===
'cascade';
157 $ret = parent::formatParametersForApi();
158 if ( isset( $ret[
'details'] ) && is_array( $ret[
'details'] ) ) {
159 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
160 foreach ( $ret[
'details'] as &$detail ) {
161 if ( isset( $detail[
'expiry'] ) ) {
162 $detail[
'expiry'] = $contLang->
163 formatExpiry( $detail[
'expiry'], TS_ISO_8601,
'infinite' );
178 $protectDescription =
'';
180 foreach ( $details as $param ) {
185 $action = $this->context->msg(
'restriction-' . $param[
'type'] )->escaped();
187 $protectionLevel = $param[
'level'];
189 $message = $this->context->msg(
'protect-level-' . $protectionLevel );
190 if ( $message->isDisabled() ) {
192 $restrictions = $this->context->msg(
"protect-fallback", $protectionLevel )->parse();
194 $restrictions = $message->escaped();
197 if ( $protectDescription !==
'' ) {
198 $protectDescription .= $this->context->msg(
'word-separator' )->escaped();
201 $protectDescription .= $this->context->msg(
'protect-summary-desc' )
202 ->params( $action, $restrictions, $expiryText )->escaped();
205 return $protectDescription;
210 return $this->context->msg(
'protect-expiry-indefinite' )->text();
212 $lang = $this->context->getLanguage();
213 $user = $this->context->getUser();
214 return $this->context->msg(
215 'protect-expiring-local',
216 $lang->userTimeAndDate( $expiry, $user ),
217 $lang->userDate( $expiry, $user ),
218 $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