mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 22:35:45 +00:00
refactor(core): ♻️ use the same code pattern for SkinEditSectionLinks
This commit is contained in:
parent
2ec7da29a5
commit
5c375bb71d
|
@ -116,19 +116,22 @@ class SkinHooks implements
|
||||||
* @param Language $lang
|
* @param Language $lang
|
||||||
*/
|
*/
|
||||||
public function onSkinEditSectionLinks( $skin, $title, $section, $sectionTitle, &$result, $lang ) {
|
public function onSkinEditSectionLinks( $skin, $title, $section, $sectionTitle, &$result, $lang ) {
|
||||||
/*
|
// Be extra safe because it might be active on other skins with caching
|
||||||
* FIXME: For some reason if you modify the VE button, it duplicates one automatically
|
if ( $skin->getSkinName() === 'citizen' && $result ) {
|
||||||
* Bug: T323186
|
/*
|
||||||
*
|
* FIXME: For some reason if you modify the VE button, it duplicates one automatically
|
||||||
* if ( $result['veeditsection'] ) {
|
* Bug: T323186
|
||||||
* $result['veeditsection']['attribs']['class'] = 'mw-ui-icon-wikimedia-edit';
|
*
|
||||||
* }
|
* if ( isset( $result['veeditsection'] ) ) {
|
||||||
*/
|
* $result['veeditsection']['attribs']['class'] = 'mw-ui-icon-wikimedia-edit';
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
// Add icon to edit section link
|
// Add icon to edit section link
|
||||||
// If VE button is present, use wikiText icon
|
// If VE button is present, use wikiText icon
|
||||||
if ( $result['editsection'] ) {
|
if ( isset( $result['editsection'] ) ) {
|
||||||
$result['editsection']['attribs']['class'] = $result['veeditsection'] ? 'mw-ui-icon-wikimedia-wikiText' : 'mw-ui-icon-wikimedia-edit';
|
$result['editsection']['attribs']['class'] = $result['veeditsection'] ? 'mw-ui-icon-wikimedia-wikiText' : 'mw-ui-icon-wikimedia-edit';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue