34 $subtype = $this->entry->getSubtype();
35 if ( $subtype ===
'move_prot' ) {
37 return [ Title::newFromText(
$params[3] ) ];
43 $key = parent::getMessageKey();
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];
73 } elseif ( $subtype ===
'move_prot' ) {
75 $params[3] = Message::rawParam( $oldname );
83 $subtype = $this->entry->getSubtype();
84 if ( $this->entry->isDeleted( LogPage::DELETED_ACTION )
85 || $subtype ===
'move_prot'
91 $title = $this->entry->getTarget();
93 if ( $title->exists() ) {
94 $links[] = $linkRenderer->makeLink( $title,
95 $this->
msg(
'hist' )->text(),
98 'action' =>
'history',
99 'offset' => $this->entry->getTimestamp(),
105 if ( $this->context->getAuthority()->isAllowed(
'protect' ) ) {
106 $links[] = $linkRenderer->makeKnownLink(
108 $this->
msg(
'protect_change' )->text(),
110 [
'action' =>
'protect' ]
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] ) ) {
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'] ) ) {
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 ) {
181 $expiryText = $this->formatExpiry( $param[
'expiry'] );
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;
208 private function formatExpiry( $expiry ) {
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 )
getParameters()
Get the extra parameters stored for this message.