jenkins-bot has submitted this change and it was merged.

Change subject: Clean SpecialListDatatypes
......................................................................


Clean SpecialListDatatypes

Change-Id: I4eca135dccd78fd04ee9c2fcff1fc8da9dd01388
---
M repo/includes/specials/SpecialListDatatypes.php
1 file changed, 18 insertions(+), 20 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/specials/SpecialListDatatypes.php 
b/repo/includes/specials/SpecialListDatatypes.php
index 3c7a887..12d2bc9 100644
--- a/repo/includes/specials/SpecialListDatatypes.php
+++ b/repo/includes/specials/SpecialListDatatypes.php
@@ -3,21 +3,6 @@
 /**
  * Page for listing available datatypes.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
  * @since 0.2
  *
  * @file
@@ -59,13 +44,26 @@
                // 'wikibase-listdatatypes-time-head'
                // 'wikibase-listdatatypes-text-body'
 
-               foreach (\Wikibase\Settings::get( 'dataTypes' ) as $dataTypeId 
) {
-                       $baseKey = 'wikibase-listdatatypes-' . mb_strtolower( 
$dataTypeId );
-                       $out = Html::rawElement( 'dt', array(), $this->msg( 
$baseKey . '-head' )->parse() )
-                       . Html::rawElement( 'dd', array(), $this->msg( $baseKey 
. '-body' )->parse() );
-                       $this->getOutput()->addHTML( $out );
+               foreach ( $this->getDataTypeIds() as $dataTypeId ) {
+                       $this->getOutput()->addHTML( 
$this->getHtmlForDataTypeId( $dataTypeId ) );
                }
 
                $this->getOutput()->addHTML( Html::closeElement( 'dl' ));
        }
+
+       protected function getDataTypeIds() {
+               return 
\Wikibase\Repo\WikibaseRepo::getDefaultInstance()->getDataTypeFactory()->getTypeIds();
+       }
+
+       protected function getHtmlForDataTypeId( $dataTypeId ) {
+               $baseKey = 'wikibase-listdatatypes-' . mb_strtolower( 
$dataTypeId );
+
+               return Html::rawElement(
+                       'dt',
+                       array(),
+                       $this->msg( $baseKey . '-head' )->parse() )
+                               . Html::rawElement( 'dd', array(), $this->msg( 
$baseKey . '-body' )->parse()
+               );
+       }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/80247
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4eca135dccd78fd04ee9c2fcff1fc8da9dd01388
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to