MediaWiki  1.23.13
MoveLogFormatter.php
Go to the documentation of this file.
1 <?php
32  public function getPreloadTitles() {
33  $params = $this->extractParameters();
34 
35  return array( Title::newFromText( $params[3] ) );
36  }
37 
38  protected function getMessageKey() {
39  $key = parent::getMessageKey();
40  $params = $this->getMessageParameters();
41  if ( isset( $params[4] ) && $params[4] === '1' ) {
42  $key .= '-noredirect';
43  }
44 
45  return $key;
46  }
47 
48  protected function getMessageParameters() {
49  $params = parent::getMessageParameters();
50  $oldname = $this->makePageLink( $this->entry->getTarget(), array( 'redirect' => 'no' ) );
51  $newname = $this->makePageLink( Title::newFromText( $params[3] ) );
52  $params[2] = Message::rawParam( $oldname );
53  $params[3] = Message::rawParam( $newname );
54 
55  return $params;
56  }
57 
58  public function getActionLinks() {
59  if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
60  || $this->entry->getSubtype() !== 'move'
61  || !$this->context->getUser()->isAllowed( 'move' )
62  ) {
63  return '';
64  }
65 
66  $params = $this->extractParameters();
67  $destTitle = Title::newFromText( $params[3] );
68  if ( !$destTitle ) {
69  return '';
70  }
71 
73  SpecialPage::getTitleFor( 'Movepage' ),
74  $this->msg( 'revertmove' )->escaped(),
75  array(),
76  array(
77  'wpOldTitle' => $destTitle->getPrefixedDBkey(),
78  'wpNewTitle' => $this->entry->getTarget()->getPrefixedDBkey(),
79  'wpReason' => $this->msg( 'revertmove' )->inContentLanguage()->text(),
80  'wpMovetalk' => 0
81  )
82  );
83 
84  return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
85  }
86 }
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
MoveLogFormatter
This class formats move log entries.
Definition: MoveLogFormatter.php:31
$revert
this hook is for auditing only etc create2 Corresponds to logging log_action database field and which is displayed in the UI & $revert
Definition: hooks.txt:1644
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$params
$params
Definition: styleTest.css.php:40
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:74
Linker\linkKnown
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
Definition: Linker.php:264
LogFormatter\msg
msg( $key)
Shortcut for wfMessage which honors local context.
Definition: LogFormatter.php:624
LogFormatter\makePageLink
makePageLink(Title $title=null, $parameters=array())
Helper to make a link to the page, taking the plaintext value in consideration.
Definition: LogFormatter.php:537
MoveLogFormatter\getPreloadTitles
getPreloadTitles()
Definition: MoveLogFormatter.php:32
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:33
MoveLogFormatter\getActionLinks
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
Definition: MoveLogFormatter.php:58
MoveLogFormatter\getMessageKey
getMessageKey()
Returns a key to be used for formatting the action sentence.
Definition: MoveLogFormatter.php:38
LogFormatter
Implements the default log formatting.
Definition: LogFormatter.php:33
LogFormatter\extractParameters
extractParameters()
Extracts the optional extra parameters for use in action messages.
Definition: LogFormatter.php:395
MoveLogFormatter\getMessageParameters
getMessageParameters()
Formats parameters intented for action message from array of all parameters.
Definition: MoveLogFormatter.php:48