Hiong3-eng5 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71576
Change subject: moved most SpecialPage from app to setup
......................................................................
moved most SpecialPage from app to setup
also changed two wg to wld
and built some special page credits
Change-Id: I9e26aea619db73096f50066ac49c08f2c9abeea3
---
M App.php
M OmegaWiki/Wikidata.php
M includes/setup/OWSpecials.php
3 files changed, 108 insertions(+), 55 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData
refs/changes/76/71576/1
diff --git a/App.php b/App.php
index 3708fe4..3cebf7e 100644
--- a/App.php
+++ b/App.php
@@ -73,15 +73,7 @@
$wgAutoloadClasses['NeedsTranslationTo'] = $dir .
'OmegaWiki/NeedsTranslationTo.php';
$wgAutoloadClasses['Search'] = $dir . 'OmegaWiki/Search.php';
-$wgAutoloadClasses['SpecialSuggest'] = $dir . 'OmegaWiki/SpecialSuggest.php';
-$wgAutoloadClasses['SpecialSelect'] = $dir . 'OmegaWiki/SpecialSelect.php';
-// $wgAutoloadClasses['SpecialTransaction'] = $dir .
'OmegaWiki/SpecialTransaction.php';
-$wgAutoloadClasses['SpecialNeedsTranslation'] = $dir .
'OmegaWiki/SpecialNeedsTranslation.php';
-$wgAutoloadClasses['SpecialImportLangNames'] = $dir .
'OmegaWiki/SpecialImportLangNames.php';
-$wgAutoloadClasses['SpecialAddCollection'] = $dir .
'OmegaWiki/SpecialAddCollection.php';
-$wgAutoloadClasses['SpecialConceptMapping'] = $dir .
'OmegaWiki/SpecialConceptMapping.php';
-$wgAutoloadClasses['SpecialCopy'] = $dir . 'OmegaWiki/SpecialCopy.php';
-
+// Special Pages
require_once( $wgWldSetupScriptPath . "OWSpecials.php" );
# FIXME: These should be modified to make Wikidata more reusable.
@@ -103,7 +95,7 @@
$wgGroupPermissions['bureaucrat']['addcollection'] = true;
$wgGroupPermissions['bureaucrat']['editClassAttributes'] = true;
-// Wikidata Configuration.
+// WikiLexicalData Configuration.
# Array of namespace ids and the handler classes they use.
$wdHandlerClasses = array();
@@ -138,23 +130,13 @@
$wdCopyAltDefinitions = false;
$wdCopyDryRunOnly = false;
-# FIXME: Should be renamed to prefix with wd rather than wg.
-$wgShowClassicPageTitles = false;
-$wgExpressionPageTitlePrefix = 'Multiple meanings';
+$wldShowClassicPageTitles = false;
+$wldExpressionPageTitlePrefix = 'Multiple meanings'; // NOTE: unused
# The site prefix allows us to have multiple sets of customized
# messages (for different, typically site-specific UIs)
# in a single database.
if ( !isset( $wdSiteContext ) ) $wdSiteContext = "uw";
-
-$wgSpecialPages['Suggest'] = 'SpecialSuggest';
-$wgSpecialPages['Select'] = 'SpecialSelect';
-// $wgSpecialPages['Transaction'] = 'SpecialTransaction';
-$wgSpecialPages['NeedsTranslation'] = 'SpecialNeedsTranslation';
-$wgSpecialPages['ImportLangNames'] = 'SpecialImportLangNames';
-$wgSpecialPages['AddCollection'] = 'SpecialAddCollection';
-$wgSpecialPages['ConceptMapping'] = 'SpecialConceptMapping';
-$wgSpecialPages['Copy'] = 'SpecialCopy';
#
## Hooks
diff --git a/OmegaWiki/Wikidata.php b/OmegaWiki/Wikidata.php
index dc974c9..9e8892f 100644
--- a/OmegaWiki/Wikidata.php
+++ b/OmegaWiki/Wikidata.php
@@ -13,7 +13,7 @@
protected $transaction;
protected $queryTransactionInformation;
protected $showCommunityContribution;
-
+
// The following member variables control some application specific
preferences
protected $showClassicPageTitles = true; // Show classic page
titles instead of prettier page titles
@@ -24,12 +24,12 @@
protected $showDataSetPanel = false;
public function __construct( $title ) {
- global $wgShowClassicPageTitles, $wgPropertyToColumnFilters;
+ global $wldShowClassicPageTitles, $wgPropertyToColumnFilters;
$this->title = $title;
- if ( isset( $wgShowClassicPageTitles ) ) {
- $this->showClassicPageTitles = $wgShowClassicPageTitles;
+ if ( isset( $wldShowClassicPageTitles ) ) {
+ $this->showClassicPageTitles =
$wldShowClassicPageTitles;
}
if ( isset( $wgPropertyToColumnFilters ) ) {
$this->propertyToColumnFilters =
$wgPropertyToColumnFilters;
@@ -41,9 +41,8 @@
}
protected function outputViewHeader() {
- global
- $wgOut;
-
+ global $wgOut;
+
if ( $this->showDataSetPanel ) {
$wgOut->addHTML( $this->getDataSetPanel() );
}
@@ -63,19 +62,19 @@
$wgOut->setPageTitle( $myTitle );
$this->queryTransactionInformation = new
QueryLatestTransactionInformation();
-
+
$viewInformation = new ViewInformation();
$viewInformation->showRecordLifeSpan = false;
$viewInformation->queryTransactionInformation =
$this->queryTransactionInformation;
$viewInformation->setPropertyToColumnFilters(
$this->propertyToColumnFilters );
-
+
$this->viewInformation = $viewInformation;
// Not clear why this is here. Works well without.
// initializeOmegaWikiAttributes( $viewInformation );
// initializeObjectAttributeEditors( $viewInformation );
}
-
+
protected function getDataSetPanel() {
global $wgUser;
$dc = wdGetDataSetContext();
@@ -103,13 +102,13 @@
$viewInformation->queryTransactionInformation =
$referenceQueryTransactionInformation;
$viewInformation->setPropertyToColumnFilters(
$this->propertyToColumnFilters );
$viewInformation->viewOrEdit = "edit";
-
+
$this->viewInformation = $viewInformation;
initializeOmegaWikiAttributes( $this->viewInformation );
initializeObjectAttributeEditors( $this->viewInformation );
}
-
+
public function saveWithinTransaction() {
global $wgUser, $wgRequest;
@@ -131,7 +130,7 @@
/**
* @return true if permission to edit, false if not
- **/
+ */
public function edit() {
global $wgOut, $wgRequest, $wgUser;
@@ -139,7 +138,7 @@
if ( $wgUser->isBlockedFrom( $this->getTitle(), false ) ) {
$wgOut->blockedPage() ;
- return false;
+ return false;
}
$dc = wdGetDataSetContext();
@@ -157,18 +156,18 @@
$viewInformation->queryTransactionInformation = new
QueryLatestTransactionInformation();
$viewInformation->viewOrEdit = "edit";
$viewInformation->setPropertyToColumnFilters(
$this->propertyToColumnFilters );
-
+
$this->viewInformation = $viewInformation;
-
+
initializeOmegaWikiAttributes( $this->viewInformation );
initializeObjectAttributeEditors( $this->viewInformation );
return true;
}
-
+
public function history() {
global $wgOut, $wgRequest;
-
+
$wgOut->enableClientCache( false );
$title = $this->title->getPrefixedText();
@@ -187,13 +186,13 @@
$this->showRecordLifeSpan = true;
$this->transaction = 0;
}
-
+
# Up to which transaction to view the data
if ( $this->transaction == 0 )
$this->queryTransactionInformation = new
QueryHistoryTransactionInformation();
else
$this->queryTransactionInformation = new
QueryAtTransactionInformation( $this->transaction, $this->showRecordLifeSpan );
-
+
$transactionId = $wgRequest->getInt( 'transaction' );
$wgOut->addHTML( getOptionPanel(
@@ -208,16 +207,16 @@
$viewInformation->showRecordLifeSpan =
$this->showRecordLifeSpan;
$viewInformation->queryTransactionInformation =
$this->queryTransactionInformation;
$viewInformation->setPropertyToColumnFilters(
$this->propertyToColumnFilters );
-
+
$this->viewInformation = $viewInformation;
initializeOmegaWikiAttributes( $this->viewInformation );
initializeObjectAttributeEditors( $viewInformation );
}
-
+
protected function outputEditHeader() {
global $wgOut, $wgUser;
-
+
$title = $this->title->getPrefixedText();
if ( !$this->showClassicPageTitles )
@@ -231,13 +230,13 @@
$wgOut->addHTML(
'<form method="post" action="">' .
- '<input type="hidden" name="transaction"
value="' . getLatestTransactionId() . '"/>'
+ '<input type="hidden" name="transaction" value="' .
getLatestTransactionId() . '"/>'
);
}
-
+
protected function outputEditFooter() {
global $wgOut, $wgUser;
-
+
$wgOut->addHTML(
'<div class="option-panel">' .
'<table cellpadding="0" cellspacing="0"><tr>' .
@@ -247,7 +246,7 @@
getSubmitButton( "save", wfMessage( "ow_save"
)->text() ) .
'</div>'
);
-
+
$wgOut->addHTML( '</form>' );
if ( $wgUser->isAnon() ) {
diff --git a/includes/setup/OWSpecials.php b/includes/setup/OWSpecials.php
index aaa33a9..c4644b2 100644
--- a/includes/setup/OWSpecials.php
+++ b/includes/setup/OWSpecials.php
@@ -17,18 +17,53 @@
}
$wgExtensionCredits['specialpage'][] = array(
- 'name' => 'SpecialConceptMapping',
- 'author' => 'Kim Bruning',
+ 'name' => 'SpecialCopy',
+ 'author' => array(
+ 'Eric Moeller',
+ 'Kim Bruning',
+ 'Alan Smithee',
+ ),
);
$wgExtensionCredits['specialpage'][] = array(
- 'name' => 'SpecialCopy',
- 'author' => 'Alan Smithee',
+ 'name' => 'SpecialConceptMapping',
+ 'author' => array(
+ 'Eric Moeller',
+ 'Kim Bruning',
+ ),
+);
+
+$wgExtensionCredits['specialpage'][] = array(
+ 'name' => 'SpecialSuggest',
+ 'author' => array(
+ 'Peter-Jan Roes',
+ 'Kim Bruning',
+ ),
+);
+
+$wgExtensionCredits['specialpage'][] = array(
+ 'name' => 'SpecialAddCollection',
+ 'author' => array(
+ 'Eric Moeller',
+ 'Kim Bruning',
+ ),
);
$wgExtensionCredits['specialpage'][] = array(
'name' => 'SpecialDatasearch',
- 'author' => 'Kipcool',
+ 'author' => array(
+ 'Peter-Jan Roes',
+ 'Karsten Uil',
+ 'Kipcool',
+ ),
+);
+
+$wgExtensionCredits['specialpage'][] = array(
+ 'name' => 'SpecialNeedsTranslation',
+ 'author' => array(
+ 'Peter-Jan Roes',
+ 'Kipcool',
+ ),
);
$wgExtensionCredits['specialpage'][] = array(
@@ -42,19 +77,56 @@
);
# Location of the SpecialMyExtension class (Tell MediaWiki to load this file)
+$wgAutoloadClasses['SpecialCopy'] = $dir . 'OmegaWiki/SpecialCopy.php';
+$wgAutoloadClasses['SpecialSelect'] = $dir . 'OmegaWiki/SpecialSelect.php';
+$wgAutoloadClasses['SpecialSuggest'] = $dir . 'OmegaWiki/SpecialSuggest.php';
+
+$wgAutoloadClasses['SpecialAddCollection'] = $dir .
'OmegaWiki/SpecialAddCollection.php';
+$wgAutoloadClasses['SpecialConceptMapping'] = $dir .
'OmegaWiki/SpecialConceptMapping.php';
$wgAutoloadClasses['SpecialDatasearch'] = $wgWldSpecialsScriptPath .
'SpecialDatasearch.php';
+$wgAutoloadClasses['SpecialImportLangNames'] = $dir .
'OmegaWiki/SpecialImportLangNames.php';
+$wgAutoloadClasses['SpecialNeedsTranslation'] = $dir .
'OmegaWiki/SpecialNeedsTranslation.php';
+
$wgAutoloadClasses['SpecialOWStatistics'] = $wgWldSpecialsScriptPath .
'SpecialOWStatistics.php';
-$wgAutoloadClasses[ 'SpecialOWDownloads' ] = $wgWldSpecialsScriptPath .
'SpecialOWDownloads.php';
+$wgAutoloadClasses['SpecialOWDownloads'] = $wgWldSpecialsScriptPath .
'SpecialOWDownloads.php';
+
+// $wgAutoloadClasses['SpecialTransaction'] = $dir .
'OmegaWiki/SpecialTransaction.php';
# Tell MediaWiki about the new special page and its class name
+$wgSpecialPages['Copy'] = 'SpecialCopy';
+$wgSpecialPages['Select'] = 'SpecialSelect';
+$wgSpecialPages['Suggest'] = 'SpecialSuggest';
+
+$wgSpecialPages['AddCollection'] = 'SpecialAddCollection';
+$wgSpecialPages['ConceptMapping'] = 'SpecialConceptMapping';
$wgSpecialPages['ow_data_search'] = 'SpecialDatasearch';
+$wgSpecialPages['ImportLangNames'] = 'SpecialImportLangNames';
+$wgSpecialPages['NeedsTranslation'] = 'SpecialNeedsTranslation';
+
$wgSpecialPages['ow_statistics'] = 'SpecialOWStatistics';
$wgSpecialPages['ow_downloads'] = 'SpecialOWDownloads';
+// $wgSpecialPages['Transaction'] = 'SpecialTransaction';
+
# Tell MediaWiki about which group the new special page belongs to
+/**
+ * == UnlistedSpecialPage ==
+ * SpecialCopy
+ * SpecialSelect
+ * SpecialSuggest
+ */
+
+$wgSpecialPageGroups[ 'AddCollection' ] = 'other';
+$wgSpecialPageGroups[ 'ConceptMapping' ] = 'other';
$wgSpecialPageGroups[ 'ow_data_search' ] = 'wiki';
+$wgSpecialPageGroups[ 'ImportLangNames' ] = 'other';
+$wgSpecialPageGroups[ 'NeedsTranslation' ] = 'maintenance';
+
$wgSpecialPageGroups[ 'ow_statistics' ] = 'wiki';
$wgSpecialPageGroups[ 'ow_downloads' ] = 'wiki';
# Location of an aliases file (Tell MediaWiki to load this file)
//$wgExtensionMessagesFiles[ 'OWSpecialsAlias' ] = #dir .
'../i18n/OWSpecials.alias.php';
+
+// Return true so that MediaWiki continues to load extensions.
+return true;
--
To view, visit https://gerrit.wikimedia.org/r/71576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e26aea619db73096f50066ac49c08f2c9abeea3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Hiong3-eng5 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits