MediaWiki  1.30.0
ContentModelLogFormatter.php
Go to the documentation of this file.
1 <?php
2 
4 
6  protected function getMessageParameters() {
7  $lang = $this->context->getLanguage();
8  $params = parent::getMessageParameters();
11  return $params;
12  }
13 
14  public function getActionLinks() {
15  if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) // Action is hidden
16  || $this->entry->getSubtype() !== 'change'
17  || !$this->context->getUser()->isAllowed( 'editcontentmodel' )
18  ) {
19  return '';
20  }
21 
22  $params = $this->extractParameters();
23  $revert = MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
24  SpecialPage::getTitleFor( 'ChangeContentModel' ),
25  $this->msg( 'logentry-contentmodel-change-revertlink' )->text(),
26  [],
27  [
28  'pagetitle' => $this->entry->getTarget()->getPrefixedText(),
29  'model' => $params[3],
30  'reason' => $this->msg( 'logentry-contentmodel-change-revert' )->inContentLanguage()->text(),
31  ]
32  );
33 
34  return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
35  }
36 }
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:33
text
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
Definition: design.txt:12
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
$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 If you don't need a full Title object,...
Definition: SpecialPage.php:82
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
ContentModelLogFormatter\getMessageParameters
getMessageParameters()
Formats parameters intented for action message from array of all parameters.
Definition: ContentModelLogFormatter.php:6
LogFormatter\msg
msg( $key)
Shortcut for wfMessage which honors local context.
Definition: LogFormatter.php:733
ContentModelLogFormatter\getActionLinks
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
Definition: ContentModelLogFormatter.php:14
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:32
ContentHandler\getLocalizedName
static getLocalizedName( $name, Language $lang=null)
Returns the localized name for a given content model.
Definition: ContentHandler.php:348
ContentModelLogFormatter
Definition: ContentModelLogFormatter.php:5
$revert
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' 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
Definition: hooks.txt:2141
LogFormatter
Implements the default log formatting.
Definition: LogFormatter.php:38
MediaWikiServices
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
Definition: injection.txt:23
LogFormatter\extractParameters
extractParameters()
Extracts the optional extra parameters for use in action messages.
Definition: LogFormatter.php:498