r89919 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89918‎ | r89919 | r89920 >
Date:05:48, 12 June 2011
Author:devayon
Status:deferred (Comments)
Tags:
Comment:
Creating a Query Creator interface to seperate use cases of Special:Ask
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php (added) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php
@@ -0,0 +1,42 @@
 2+<?php
 3+
 4+/**
 5+ * This special page for Semantic MediaWiki implements a customisable form for
 6+ * executing queries outside of articles. Results are generated by
 7+ * SMW_SpecialAsk.php. This page is currently under development as part of
 8+ * the Google Summer of Code 2011 Program.
 9+ *
 10+ * @file SMW_SpecialQueryCreator.php
 11+ * @ingroup SMWSpecialPage
 12+ * @ingroup SpecialPage
 13+ *
 14+ * @author Markus Krötzsch
 15+ * @author Yaron Koren
 16+ * @author Sanyam Goyal
 17+ * @author Jeroen De Dauw
 18+ * @author Devayon Das
 19+ *
 20+ */
 21+class SMWQueryCreatorPage extends SpecialPage {
 22+
 23+ /**
 24+ * Constructor.
 25+ */
 26+ public function __construct() {
 27+ parent::__construct( 'QueryCreator' );
 28+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
 29+ }
 30+
 31+ /**
 32+ * Main entrypoint for the special page.
 33+ *
 34+ * @param string $p
 35+ */
 36+ public function execute( $p ) {
 37+ global $wgOut, $wgRequest, $smwgQEnabled;
 38+ $this->setHeaders();
 39+ $wgOut->addWikiText( "Hi. This page isn't ready for viewing yet. May I suggest you view [[Special:Ask]]");
 40+ }
 41+
 42+}
 43+
Property changes on: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php
___________________________________________________________________
Added: svn:eol-style
144 + native
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -238,6 +238,10 @@
239239 $wgSpecialPages['Ask'] = 'SMWAskPage';
240240 $wgSpecialPageGroups['Ask'] = 'smw_group';
241241
 242+ $wgAutoloadClasses['SMWQueryCreatorPage'] = $smwgIP . 'specials/AskSpecial/SMW_SpecialQueryCreator.php';
 243+ $wgSpecialPages['QueryCreator'] = 'SMWQueryCreatorPage';
 244+ $wgSpecialPageGroups['QueryCreator'] = 'smw_group';
 245+
242246 $wgAutoloadClasses['SMWSpecialBrowse'] = $smwgIP . 'specials/SearchTriple/SMW_SpecialBrowse.php';
243247 $wgSpecialPages['Browse'] = 'SMWSpecialBrowse';
244248 $wgSpecialPageGroups['Browse'] = 'smw_group';
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
@@ -212,6 +212,7 @@
213213
214214 // Messages for ask Special
215215 'ask' => 'Semantic search',
 216+ 'querycreator' => 'Query creator',
216217 'smw_ask_doculink' => 'http://semantic-mediawiki.org/wiki/Help:Semantic_search',
217218 'smw_ask_sortby' => 'Sort by column (optional)',
218219 'smw_ask_ascorder' => 'Ascending',

Comments

#Comment by Jeroen De Dauw (talk | contribs)   17:28, 15 June 2011

When adding a new special page, you also need to add an element to the English special page aliases array, as done for QueryCreator in r90121 :)

#Comment by Devayon (talk | contribs)   11:42, 16 June 2011

Thanks for pointing that out!