Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases Class Reference

Special page for setting label, description and aliases of a Wikibase entity that features labels, descriptions and aliases. More...

+ Inheritance diagram for Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases:
+ Collaboration diagram for Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases:

Public Member Functions

 __construct (array $tags, SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediaWikiEditEntityFactory $editEntityFactory, AnonymousEditWarningBuilder $anonymousEditWarningBuilder, FingerprintChangeOpFactory $changeOpFactory, ContentLanguages $termsLanguages, EntityPermissionChecker $permissionChecker, LanguageNameUtils $languageNameUtils, string $submitButtonMessage)
 
 doesWrites ()
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialModifyEntity
 __construct ( $title, array $tags, SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediaWikiEditEntityFactory $editEntityFactory, AnonymousEditWarningBuilder $anonymousEditWarningBuilder)
 
 execute ( $subPage)
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibaseRepoPage
 __construct ( $title, $restriction, array $tags, SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediaWikiEditEntityFactory $editEntityFactory)
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 __construct ( $name='', $restriction='', $listed=true)
 
 getDescription ()
 
 setHeaders ()
 

Static Public Member Functions

static factory (LanguageNameUtils $languageNameUtils, Config $mwConfig, AnonymousEditWarningBuilder $anonymousEditWarningBuilder, ChangeOpFactoryProvider $changeOpFactoryProvider, MediaWikiEditEntityFactory $editEntityFactory, EntityPermissionChecker $entityPermissionChecker, EntityTitleLookup $entityTitleLookup, SettingsArray $repoSettings, SummaryFormatter $summaryFormatter, ContentLanguages $termsLanguages)
 

Public Attributes

const BUTTON_MESSAGE_PUBLISH = 'publishchanges'
 
const BUTTON_MESSAGE_SAVE = 'savechanges'
 

Protected Member Functions

 validateInput ()
 
 getForm (EntityDocument $entity=null)
 
 processArguments ( $subPage)
 
 modifyEntity (EntityDocument $entity)
 
 getSubmitKey (EntityDocument $entity=null)
 
 showCopyrightNotice (EntityDocument $entity=null)
 
- Protected Member Functions inherited from Wikibase\Repo\Specials\SpecialModifyEntity
 getEntityId ()
 Returns the ID of the Entity being modified.
 
 getBaseRevision ()
 Returns the base revision.
 
 getLatestRevision ()
 Returns the current revision.
 
 getEntityForModification ()
 Returns the EntityDocument that is to be modified by code in this class (or subclasses).
 
 getEntityForDisplay ()
 Returns the EntityDocument that is to be shown by code in this class (or subclasses).
 
 getFormElements (EntityDocument $entity=null)
 
 isModificationRequested ()
 Whether the current request is a request for modification (as opposed to a request for showing the input form).
 
 applyChangeOp (ChangeOp $changeOp, EntityDocument $entity, Summary $summary=null)
 Applies the given ChangeOp to the given Entity.
 
- Protected Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibaseRepoPage
 prepareEditEntity (EntityId $id=null, $baseRev=0)
 
 getEditEntity ()
 Returns the EditEntity interactor.
 
 parseEntityId ( $rawId)
 Parses an entity id.
 
 parseItemId ( $rawId)
 Parses an item id.
 
 getEntityTitle (EntityId $id)
 
 saveEntity (EntityDocument $entity, FormatableSummary $summary, $token, $flags=EDIT_UPDATE)
 Saves the entity using the given summary.
 
 redirectToEntityPage (EditEntityStatus $status)
 Redirect to the page of the entity that was successfully edited.
 
 getCopyrightHTML ( $saveMessageKey=null)
 
- Protected Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 getGroupName ()
 
 checkBlocked ()
 Checks if user is blocked, and if blocked throws a UserBlocked.
 
 showErrorHTML ( $error)
 

Private Member Functions

 wasPostedWithLabelDescriptionOrAliases ()
 
 isAllowedToChangeTerms (EntityDocument $entity)
 
 getDescriptionInputField (string $languageCode, string $value)
 
 getLabeledInputField ( $termType, $value)
 Returns an HTML label and text input element for a specific term.
 
 extractInput ( $subPage)
 
 setFingerprintFields (Fingerprint $fingerprint)
 
 isValidLanguageCode ( $languageCode)
 
 assertNoPipeCharacterInAliases (Fingerprint $fingerprint)
 
 applyChangeOpList (array $changeOps, EntityDocument $entity)
 
 getChangeOps (Fingerprint $fingerprint)
 
 getSummaryForLabelDescriptionAliases ()
 
 isEditFormStep (EntityDocument $entity=null)
 

Private Attributes

 $changeOpFactory
 
 $termsLanguages
 
 $permissionChecker
 
 $languageNameUtils
 
 $submitButtonMessage
 
 $languageCode
 
 $label = ''
 
 $description = ''
 
 $aliases = []
 

Additional Inherited Members

- Protected Attributes inherited from Wikibase\Repo\Specials\SpecialWikibaseRepoPage
 $summaryFormatter
 
- Protected Attributes inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 $stringNormalizer
 

Detailed Description

Special page for setting label, description and aliases of a Wikibase entity that features labels, descriptions and aliases.

Author
Thiemo Kreuz

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::__construct ( array $tags,
SpecialPageCopyrightView $copyrightView,
SummaryFormatter $summaryFormatter,
EntityTitleLookup $entityTitleLookup,
MediaWikiEditEntityFactory $editEntityFactory,
AnonymousEditWarningBuilder $anonymousEditWarningBuilder,
FingerprintChangeOpFactory $changeOpFactory,
ContentLanguages $termsLanguages,
EntityPermissionChecker $permissionChecker,
LanguageNameUtils $languageNameUtils,
string $submitButtonMessage )

Member Function Documentation

◆ applyChangeOpList()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::applyChangeOpList ( array $changeOps,
EntityDocument $entity )
private
Exceptions
ChangeOpException

XXX: The $changeOps array is still used below as it is indexed with the module name to pass to the Summary object.

◆ assertNoPipeCharacterInAliases()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::assertNoPipeCharacterInAliases ( Fingerprint $fingerprint)
private
Parameters
Fingerprint$fingerprint
Exceptions
UserInputException
Returns
bool

◆ doesWrites()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::doesWrites ( )

◆ extractInput()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::extractInput ( $subPage)
private
Parameters
string | null$subPage

◆ factory()

static Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::factory ( LanguageNameUtils $languageNameUtils,
Config $mwConfig,
AnonymousEditWarningBuilder $anonymousEditWarningBuilder,
ChangeOpFactoryProvider $changeOpFactoryProvider,
MediaWikiEditEntityFactory $editEntityFactory,
EntityPermissionChecker $entityPermissionChecker,
EntityTitleLookup $entityTitleLookup,
SettingsArray $repoSettings,
SummaryFormatter $summaryFormatter,
ContentLanguages $termsLanguages )
static

◆ getChangeOps()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::getChangeOps ( Fingerprint $fingerprint)
private
Parameters
Fingerprint$fingerprint
Returns
ChangeOp[]

◆ getDescriptionInputField()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::getDescriptionInputField ( string $languageCode,
string $value )
private

◆ getForm()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::getForm ( EntityDocument $entity = null)
protected
See also
SpecialModifyEntity::getForm
Parameters
EntityDocument | null$entity
Returns
HTMLForm

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ getLabeledInputField()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::getLabeledInputField ( $termType,
$value )
private

Returns an HTML label and text input element for a specific term.

Parameters
string$termTypeEither 'label', 'description' or 'aliases'.
string$valueText to fill the input element with
Returns
array[]

◆ getSubmitKey()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::getSubmitKey ( EntityDocument $entity = null)
protected
Parameters
EntityDocument | null$entity
Returns
string submit message key

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ getSummaryForLabelDescriptionAliases()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::getSummaryForLabelDescriptionAliases ( )
private
Returns
Summary

◆ isAllowedToChangeTerms()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::isAllowedToChangeTerms ( EntityDocument $entity)
private
Parameters
EntityDocument$entity
Returns
bool

◆ isEditFormStep()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::isEditFormStep ( EntityDocument $entity = null)
private

◆ isValidLanguageCode()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::isValidLanguageCode ( $languageCode)
private
Parameters
string | null$languageCode
Returns
bool

◆ modifyEntity()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::modifyEntity ( EntityDocument $entity)
protected
See also
SpecialModifyEntity::modifyEntity
Parameters
EntityDocument$entity
Exceptions
InvalidArgumentException
Returns
Summary|bool

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ processArguments()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::processArguments ( $subPage)
protected
See also
SpecialModifyEntity::processArguments
Parameters
string | null$subPage

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ setFingerprintFields()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::setFingerprintFields ( Fingerprint $fingerprint)
private

◆ showCopyrightNotice()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::showCopyrightNotice ( EntityDocument $entity = null)
protected
Parameters
EntityDocument | null$entity
Returns
bool

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ validateInput()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::validateInput ( )
protected
See also
SpecialModifyEntity::validateInput
Returns
bool

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ wasPostedWithLabelDescriptionOrAliases()

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::wasPostedWithLabelDescriptionOrAliases ( )
private
Returns
bool

Member Data Documentation

◆ $aliases

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$aliases = []
private

◆ $changeOpFactory

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$changeOpFactory
private

◆ $description

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$description = ''
private

◆ $label

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$label = ''
private

◆ $languageCode

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$languageCode
private

◆ $languageNameUtils

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$languageNameUtils
private

◆ $permissionChecker

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$permissionChecker
private

◆ $submitButtonMessage

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$submitButtonMessage
private

◆ $termsLanguages

Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::$termsLanguages
private

◆ BUTTON_MESSAGE_PUBLISH

const Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::BUTTON_MESSAGE_PUBLISH = 'publishchanges'

◆ BUTTON_MESSAGE_SAVE

const Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases::BUTTON_MESSAGE_SAVE = 'savechanges'

The documentation for this class was generated from the following file: