X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialTags.php;h=605ee008d857921afe4f2897b34eef562dd1ec2c;hb=3bd786315247f94cf6782fe430e07b4dd948d660;hp=47bed626428a45e08ad74501eda620d21bdd5ca1;hpb=d7a9ccee2dc835d2b662c7bc8b7ff655d762c093;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 47bed62642..605ee008d8 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -34,14 +34,14 @@ class SpecialTags extends SpecialPage { protected $explicitlyDefinedTags; /** - * @var array List of extension defined tags + * @var array List of software defined tags */ - protected $extensionDefinedTags; + protected $softwareDefinedTags; /** - * @var array List of extension activated tags + * @var array List of software activated tags */ - protected $extensionActivatedTags; + protected $softwareActivatedTags; function __construct() { parent::__construct( 'Tags' ); @@ -98,7 +98,7 @@ class SpecialTags extends SpecialPage { ], ]; - $form = new HTMLForm( $fields, $this->getContext() ); + $form = HTMLForm::factory( 'ooui', $fields, $this->getContext() ); $form->setAction( $this->getPageTitle( 'create' )->getLocalURL() ); $form->setWrapperLegendMsg( 'tags-create-heading' ); $form->setHeaderText( $this->msg( 'tags-create-explanation' )->parseAsBlock() ); @@ -110,7 +110,7 @@ class SpecialTags extends SpecialPage { // continuing with this, as the user is just going to end up getting sent // somewhere else. Additionally, if we keep going here, we end up // populating the memcache of tag data (see ChangeTags::listDefinedTags) - // with out-of-date data from the slave, because the slave hasn't caught + // with out-of-date data from the replica DB, because the replica DB hasn't caught // up to the fact that a new tag has been created as part of an implicit, // as yet uncommitted transaction on master. if ( $out->getRedirect() !== '' ) { @@ -124,11 +124,11 @@ class SpecialTags extends SpecialPage { // Used in #doTagRow() $this->explicitlyDefinedTags = array_fill_keys( ChangeTags::listExplicitlyDefinedTags(), true ); - $this->extensionDefinedTags = array_fill_keys( - ChangeTags::listExtensionDefinedTags(), true ); + $this->softwareDefinedTags = array_fill_keys( + ChangeTags::listSoftwareDefinedTags(), true ); // List all defined tags, even if they were never applied - $definedTags = array_keys( $this->explicitlyDefinedTags + $this->extensionDefinedTags ); + $definedTags = array_keys( $this->explicitlyDefinedTags + $this->softwareDefinedTags ); // Show header only if there exists atleast one tag if ( !$tagStats && !$definedTags ) { @@ -149,8 +149,8 @@ class SpecialTags extends SpecialPage { ); // Used in #doTagRow() - $this->extensionActivatedTags = array_fill_keys( - ChangeTags::listExtensionActivatedTags(), true ); + $this->softwareActivatedTags = array_fill_keys( + ChangeTags::listSoftwareActivatedTags(), true ); // Insert tags that have been applied at least once foreach ( $tagStats as $tag => $hitcount ) { @@ -176,7 +176,7 @@ class SpecialTags extends SpecialPage { $newRow .= Xml::tags( 'td', null, Xml::element( 'code', null, $tag ) ); $linkRenderer = $this->getLinkRenderer(); - $disp = ChangeTags::tagDescription( $tag ); + $disp = ChangeTags::tagDescription( $tag, $this->getContext() ); if ( $showEditLinks ) { $disp .= ' '; $editLink = $linkRenderer->makeLink( @@ -200,9 +200,10 @@ class SpecialTags extends SpecialPage { $newRow .= Xml::tags( 'td', null, $desc ); $sourceMsgs = []; - $isExtension = isset( $this->extensionDefinedTags[$tag] ); + $isSoftware = isset( $this->softwareDefinedTags[$tag] ); $isExplicit = isset( $this->explicitlyDefinedTags[$tag] ); - if ( $isExtension ) { + if ( $isSoftware ) { + // TODO: Rename this message $sourceMsgs[] = $this->msg( 'tags-source-extension' )->escaped(); } if ( $isExplicit ) { @@ -213,7 +214,7 @@ class SpecialTags extends SpecialPage { } $newRow .= Xml::tags( 'td', null, implode( Xml::element( 'br' ), $sourceMsgs ) ); - $isActive = $isExplicit || isset( $this->extensionActivatedTags[$tag] ); + $isActive = $isExplicit || isset( $this->softwareActivatedTags[$tag] ); $activeMsg = ( $isActive ? 'tags-active-yes' : 'tags-active-no' ); $newRow .= Xml::tags( 'td', null, $this->msg( $activeMsg )->escaped() ); @@ -245,7 +246,6 @@ class SpecialTags extends SpecialPage { } if ( $showManageActions ) { // we've already checked that the user had the requisite userright - // activate if ( ChangeTags::canActivateTag( $tag )->isOK() ) { $actionLinks[] = $linkRenderer->makeKnownLink( @@ -263,7 +263,6 @@ class SpecialTags extends SpecialPage { [], [ 'tag' => $tag ] ); } - } if ( $showDeleteActions || $showManageActions ) { @@ -311,7 +310,7 @@ class SpecialTags extends SpecialPage { $out->parse( $status->getWikiText() ) . $this->msg( 'tags-create-warnings-below' )->parseAsBlock(); - $subform = new HTMLForm( $fields, $this->getContext() ); + $subform = HTMLForm::factory( 'ooui', $fields, $this->getContext() ); $subform->setAction( $this->getPageTitle( 'create' )->getLocalURL() ); $subform->setWrapperLegendMsg( 'tags-create-heading' ); $subform->setHeaderText( $headerText ); @@ -357,9 +356,9 @@ class SpecialTags extends SpecialPage { $preText .= $this->msg( 'tags-delete-explanation-warning', $tag )->parseAsBlock(); // see if the tag is in use - $this->extensionActivatedTags = array_fill_keys( - ChangeTags::listExtensionActivatedTags(), true ); - if ( isset( $this->extensionActivatedTags[$tag] ) ) { + $this->softwareActivatedTags = array_fill_keys( + ChangeTags::listSoftwareActivatedTags(), true ); + if ( isset( $this->softwareActivatedTags[$tag] ) ) { $preText .= $this->msg( 'tags-delete-explanation-active', $tag )->parseAsBlock(); } @@ -376,7 +375,7 @@ class SpecialTags extends SpecialPage { 'required' => true, ]; - $form = new HTMLForm( $fields, $this->getContext() ); + $form = HTMLForm::factory( 'ooui', $fields, $this->getContext() ); $form->setAction( $this->getPageTitle( 'delete' )->getLocalURL() ); $form->tagAction = 'delete'; // custom property on HTMLForm object $form->setSubmitCallback( [ $this, 'processTagForm' ] ); @@ -427,7 +426,7 @@ class SpecialTags extends SpecialPage { 'required' => true, ]; - $form = new HTMLForm( $fields, $this->getContext() ); + $form = HTMLForm::factory( 'ooui', $fields, $this->getContext() ); $form->setAction( $this->getPageTitle( $actionStr )->getLocalURL() ); $form->tagAction = $actionStr; $form->setSubmitCallback( [ $this, 'processTagForm' ] );