Robert Vogel has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404947 )
Change subject: WikiAdmin is not part of BlueSpice 3. Removed unneeded code and ...................................................................... WikiAdmin is not part of BlueSpice 3. Removed unneeded code and used new registry for admin tools Change-Id: I35a944b03d7a0280fcedfeabd78de7936d4d5f84 --- M BlueSpiceAbout.class.php M extension.json A src/AdminTool.php 3 files changed, 44 insertions(+), 29 deletions(-) Approvals: Robert Vogel: Verified; Looks good to me, approved diff --git a/BlueSpiceAbout.class.php b/BlueSpiceAbout.class.php index ece73b7..c2ce6ab 100644 --- a/BlueSpiceAbout.class.php +++ b/BlueSpiceAbout.class.php @@ -35,7 +35,6 @@ wfProfileIn( 'BS::'.__METHOD__ ); // Hooks $this->setHook( 'BeforePageDisplay' ); - $this->setHook( 'BSWikiAdminMenuItems' ); $this->setHook( 'BSTopMenuBarCustomizerRegisterNavigationSites' ); $this->setHook( 'SkinBuildSidebar' ); @@ -56,34 +55,6 @@ if ( BsConfig::get( 'MW::BlueSpiceAbout::ShowMenuLinks' )) { $out->addModules( 'ext.bluespice.bluespiceabout' ); } - return true; - } - - /** - * Returns a list item with a link to the "BlueSpice About" special page - * @param array $aOutSortable Indexed list of menu items. Add item in HTML form. - * @param \User The user in which context the menu is rendered - * @return string Link to the "BlueSpice About" special page - */ - public static function onBSWikiAdminMenuItems( &$aOutSortable, $oUser ) { - if ( !BsConfig::get( 'MW::BlueSpiceAbout::ShowMenuLinks' )) { - return true; - } - if( !$oUser->isAllowed( 'bluespiceabout-viewspecialpage' ) ) { - return true; - } - $oSpecialPage = SpecialPage::getTitleFor( 'BlueSpiceAbout' ); - $sLink = Html::element( - 'a', - array ( - 'id' => 'bs-admin-bluespiceabout', - 'href' => $oSpecialPage->getLocalURL(), - 'title' => wfMessage( 'bs-bluespiceabout-about-bluespice' )->plain(), - 'class' => 'bs-admin-link' - ), - wfMessage( 'bs-bluespiceabout-about-bluespice' )->plain() - ); - $aOutSortable[wfMessage( 'bs-bluespiceabout-about-bluespice' )->escaped()] = '<li>' . $sLink . '</li>'; return true; } diff --git a/extension.json b/extension.json index fa7d31d..fa7bbd4 100644 --- a/extension.json +++ b/extension.json @@ -17,6 +17,12 @@ "ExtensionMessagesFiles": { "BlueSpiceAboutAlias": "includes/specials/SpecialBlueSpiceAbout.alias.php" }, + "BlueSpiceFoundationAdminToolRegistry": { + "bs-bluespiceabout": "BlueSpice\\BlueSpiceAbout\\AdminTool" + }, + "AutoloadNamespaces": { + "BlueSpice\\BlueSpiceAbout\\" : "src/" + }, "AutoloadClasses": { "BlueSpiceAbout": "BlueSpiceAbout.class.php", "SpecialBlueSpiceAbout": "includes/specials/SpecialBlueSpiceAbout.class.php" diff --git a/src/AdminTool.php b/src/AdminTool.php new file mode 100644 index 0000000..9da1641 --- /dev/null +++ b/src/AdminTool.php @@ -0,0 +1,38 @@ +<?php + +namespace BlueSpice\BlueSpiceAbout; + +use BlueSpice\IAdminTool; + +class AdminTool implements IAdminTool { + + public function getURL() { + $tool = \SpecialPage::getTitleFor( 'BlueSpiceAbout' ); + return $tool->getLocalURL(); + } + + public function getDescription() { + return wfMessage( 'bs-bluespiceabout-desc' ); + } + + public function getName() { + return wfMessage( 'bs-bluespiceabout-about-bluespice' ); + } + + public function getClasses() { + $classes = array(); + + return $classes; + } + + public function getDataAttributes() { + } + + public function getPermissions() { + $permissions = array( + 'bluespiceabout-viewspecialpage' + ); + return $permissions; + } + +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/404947 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35a944b03d7a0280fcedfeabd78de7936d4d5f84 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAbout Gerrit-Branch: master Gerrit-Owner: Dvogel hallowelt <daniel.vo...@hallowelt.com> Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com> Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz> Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz> Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits