33 $key = parent::getMessageKey();
34 if ( in_array( $this->entry->getSubtype(), [
'event',
'revision' ] ) ) {
40 } elseif ( $this->entry->getSubtype() ===
'restore' ) {
41 $rawParams = $this->entry->getParameters();
42 if ( !isset( $rawParams[
':assoc:count'] ) ) {
44 return $key .
'-nocount';
52 if ( isset( $this->parsedParametersDeleteLog ) ) {
53 return $this->parsedParametersDeleteLog;
56 $params = parent::getMessageParameters();
57 $subtype = $this->entry->getSubtype();
58 if ( in_array( $subtype, [
'event',
'revision' ] ) ) {
64 ( $subtype ===
'event' && count(
$params ) === 6 )
66 $subtype ===
'revision' && isset(
$params[3] )
67 && in_array(
$params[3], [
'revision',
'archive',
'oldimage',
'filearchive' ] )
71 $paramStart = $subtype ===
'revision' ? 4 : 3;
78 foreach ( $hid as $v ) {
79 $changes[] = $this->
msg(
"$v-hid" )->plain();
83 foreach ( $unhid as $v ) {
84 $changes[] = $this->
msg(
"$v-unhid" )->plain();
86 foreach ( $extra as $v ) {
87 $changes[] = $this->
msg( $v )->plain();
89 $changeText = $this->context->getLanguage()->listToText( $changes );
91 $newParams = array_slice(
$params, 0, 3 );
92 $newParams[3] = $changeText;
93 $ids = is_array(
$params[$paramStart] )
95 : explode(
',',
$params[$paramStart] );
96 $newParams[4] = $this->context->getLanguage()->formatNum( count( $ids ) );
98 $this->parsedParametersDeleteLog = $newParams;
99 return $this->parsedParametersDeleteLog;
101 $this->parsedParametersDeleteLog = array_slice(
$params, 0, 3 );
102 return $this->parsedParametersDeleteLog;
104 } elseif ( $subtype ===
'restore' ) {
105 $rawParams = $this->entry->getParameters();
106 if ( isset( $rawParams[
':assoc:count'] ) ) {
108 foreach ( $rawParams[
':assoc:count'] as
$type => $count ) {
111 $countList[] = $this->context->msg(
'restore-count-' .
$type )
112 ->numParams( $count )->plain();
115 $params[3] = $this->context->getLanguage()->listToText( $countList );
119 $this->parsedParametersDeleteLog =
$params;
120 return $this->parsedParametersDeleteLog;
125 if ( strpos( $string,
'field=' ) === 1 ) {
126 list( , $field ) = explode(
'=', $string );
135 $user = $this->context->getUser();
137 if ( !$user->isAllowed(
'deletedhistory' )
143 switch ( $this->entry->getSubtype() ) {
146 if ( $user->isAllowed(
'undelete' ) ) {
147 $message =
'undeletelink';
149 $message =
'undeleteviewlink';
152 SpecialPage::getTitleFor(
'Undelete' ),
153 $this->
msg( $message )->
text(),
155 [
'target' => $this->entry->getTarget()->getPrefixedDBkey() ]
158 return $this->
msg(
'parentheses' )->rawParams(
$revert )->escaped();
176 if ( count( $ids ) == 1 ) {
178 if ( $key ==
'oldid' || $key ==
'revision' ) {
180 $this->entry->getTarget(),
181 $this->msg(
'diff' )->text(),
184 'diff' => intval( $ids[0] ),
189 } elseif ( $key ==
'artimestamp' || $key ==
'archive' ) {
191 SpecialPage::getTitleFor(
'Undelete' ),
195 'target' => $this->entry->getTarget()->getPrefixedDBkey(),
197 'timestamp' => $ids[0]
205 SpecialPage::getTitleFor(
'Revisiondelete' ),
206 $this->
msg(
'revdel-restore' )->
text(),
209 'target' => $this->entry->getTarget()->getPrefixedText(),
211 'ids' => implode(
',', $ids ),
215 return $this->
msg(
'parentheses' )->rawParams(
216 $this->context->getLanguage()->pipeList( $links ) )->escaped();
225 if ( is_array(
$query ) ) {
230 SpecialPage::getTitleFor(
'Revisiondelete' ),
231 $this->
msg(
'revdel-restore' )->
text(),
234 'target' => $this->entry->getTarget()->getPrefixedText(),
240 return $this->
msg(
'parentheses' )->rawParams(
$revert )->escaped();
251 if ( in_array( $subtype, [
'event',
'revision' ] ) ) {
253 if ( $subtype ===
'event' ) {
254 array_unshift( $rawParams,
'logging' );
262 '4::ids' =>
'5::ids',
263 '5::ofield' =>
'6::ofield',
264 '6::nfield' =>
'7::nfield',
266 foreach ( $map as $index => $key ) {
267 if ( isset( $rawParams[$index] ) ) {
268 $rawParams[$key] = $rawParams[$index];
269 unset( $rawParams[$index] );
275 if ( !is_array( $rawParams[
'5::ids'] ) ) {
276 $rawParams[
'5::ids'] = explode(
',', $rawParams[
'5::ids'] );
280 '::type' => $rawParams[
'4::type'],
281 ':array:ids' => $rawParams[
'5::ids'],
282 ':assoc:old' => [
'bitmask' => $old ],
283 ':assoc:new' => [
'bitmask' => $new ],
287 Revision::DELETED_TEXT =>
'content',
288 Revision::DELETED_COMMENT =>
'comment',
289 Revision::DELETED_USER =>
'user',
290 Revision::DELETED_RESTRICTED =>
'restricted',
292 foreach ( $fields as $bit => $key ) {
293 $params[
':assoc:old'][$key] = (bool)( $old & $bit );
294 $params[
':assoc:new'][$key] = (bool)( $new & $bit );
296 } elseif ( $subtype ===
'restore' ) {
298 if ( isset( $rawParams[
':assoc:count'] ) ) {
299 $params[
':assoc:count'] = $rawParams[
':assoc:count'];
307 $ret = parent::formatParametersForApi();
308 if ( isset(
$ret[
'ids'] ) ) {
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static getChanges( $n, $o)
Gets an array of message keys describing the changes made to the visibility of the revision.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
returning false will NOT prevent logging a wrapping ErrorException instead of letting the login form give the generic error message that the account does not exist For when the account has been renamed or deleted or an array to pass a message key and parameters create2 Corresponds to logging log_action database field and which is displayed in the UI & $revert
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
getParameters()
Get the extra parameters stored for this message.
getSubtype()
The log subtype.