35 $subtype = $this->entry->getSubtype();
36 if ( $subtype ===
'move_prot' ) {
38 return [ Title::newFromText( $params[3] ) ];
44 $key = parent::getMessageKey();
46 if ( isset( $params[4] ) && $params[4] ) {
55 $params = parent::getMessageParameters();
57 $subtype = $this->entry->getSubtype();
58 if ( $subtype ===
'protect' || $subtype ===
'modify' ) {
59 $rawParams = $this->entry->getParameters();
60 if ( isset( $rawParams[
'details'] ) ) {
62 } elseif ( isset( $params[3] ) ) {
64 $params[3] = $this->context->getLanguage()->getDirMark() . $params[3];
70 if ( isset( $params[4] ) ) {
74 } elseif ( $subtype ===
'move_prot' ) {
75 $oldname = $this->
makePageLink( Title::newFromText( $params[3] ), [
'redirect' =>
'no' ] );
84 $subtype = $this->entry->getSubtype();
85 if ( $this->entry->isDeleted( LogPage::DELETED_ACTION )
86 || $subtype ===
'move_prot'
92 $title = $this->entry->getTarget();
95 $links[] = $linkRenderer->makeLink(
$title,
96 $this->
msg(
'hist' )->text(),
99 'action' =>
'history',
100 'offset' => $this->entry->getTimestamp(),
106 if ( $this->context->getAuthority()->isAllowed(
'protect' ) ) {
107 $links[] = $linkRenderer->makeKnownLink(
109 $this->
msg(
'protect_change' )->text(),
111 [
'action' =>
'protect' ]
115 if ( empty( $links ) ) {
118 return $this->
msg(
'parentheses' )->rawParams(
119 $this->context->getLanguage()->pipeList( $links )
130 if ( $subtype ===
'protect' || $subtype ===
'modify' ) {
134 'details' =>
':array:details',
136 } elseif ( $subtype ===
'move_prot' ) {
139 '4::oldtitle' =>
'4:title:oldtitle',
142 foreach ( $map as $index => $key ) {
143 if ( isset( $params[$index] ) ) {
144 $params[$key] = $params[$index];
145 unset( $params[$index] );
150 if ( isset( $params[
'5:bool:cascade'] ) && is_string( $params[
'5:bool:cascade'] ) ) {
151 $params[
'5:bool:cascade'] = $params[
'5:bool:cascade'] ===
'cascade';
158 $ret = parent::formatParametersForApi();
159 if ( isset( $ret[
'details'] ) && is_array( $ret[
'details'] ) ) {
160 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
161 foreach ( $ret[
'details'] as &$detail ) {
162 if ( isset( $detail[
'expiry'] ) ) {
163 $detail[
'expiry'] = $contLang->
164 formatExpiry( $detail[
'expiry'], TS_ISO_8601,
'infinite' );
179 $protectDescription =
'';
181 foreach ( $details as $param ) {
182 $expiryText = $this->formatExpiry( $param[
'expiry'] );
186 $action = $this->context->msg(
'restriction-' . $param[
'type'] )->escaped();
188 $protectionLevel = $param[
'level'];
190 $message = $this->context->msg(
'protect-level-' . $protectionLevel );
191 if ( $message->isDisabled() ) {
193 $restrictions = $this->context->msg(
"protect-fallback", $protectionLevel )->parse();
195 $restrictions = $message->escaped();
198 if ( $protectDescription !==
'' ) {
199 $protectDescription .= $this->context->msg(
'word-separator' )->escaped();
202 $protectDescription .= $this->context->msg(
'protect-summary-desc' )
203 ->params( $action, $restrictions, $expiryText )->escaped();
206 return $protectDescription;
209 private function formatExpiry( $expiry ) {
211 return $this->context->msg(
'protect-expiry-indefinite' )->text();
213 $lang = $this->context->getLanguage();
214 $user = $this->context->getUser();
215 return $this->context->msg(
216 'protect-expiring-local',
217 $lang->userTimeAndDate( $expiry, $user ),
218 $lang->userDate( $expiry, $user ),
219 $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