r48918 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48917‎ | r48918 | r48919 >
Date:14:02, 27 March 2009
Author:sergeychernyshev
Status:deferred
Tags:
Comment:
Added format selector drop-down to Special:Ask page in Semantic MediaWiki.
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php
@@ -228,7 +228,7 @@
229229
230230
231231 protected function getInputForm($printoutstring, $urltail) {
232 - global $wgUser, $smwgQSortingSupport, $wgLang;
 232+ global $wgUser, $smwgQSortingSupport, $wgLang, $smwgResultFormats;
233233 $skin = $wgUser->getSkin();
234234 $result = '';
235235
@@ -264,7 +264,22 @@
265265 $result .= '<input type="hidden" name="sc" value="' . $i . '"/>';
266266 $result .= '<a href="' . htmlspecialchars($skin->makeSpecialUrl('Ask',$urltail . '&eq=yes&sc=1')) . '" rel="nofollow">' . wfMsg('smw_add_sortcondition') . '</a>'; // note that $urltail uses a , separated list for sorting, so setting sc to 1 always adds one new condition
267267 }
268 - $result .= '<br /><input type="submit" value="' . wfMsg('smw_ask_submit') . '"/>' .
 268+
 269+ $result .= '<div>'.wfMsg('smw_ask_format_as').' <input type="hidden" name="eq" value="yes"/>' .
 270+ '<select name="p">' .
 271+ '<option value="format=broadtable"'.($this->m_params['format'] == 'broadtable' ? ' selected' : '').'>broadtable ('.wfMsg('smw_ask_defaultformat').')</option>'."\n";
 272+
 273+ foreach (array_keys($smwgResultFormats) as $format)
 274+ {
 275+ if ($format != 'broadtable')
 276+ {
 277+ $result .= '<option value="format='.$format.'"'.($this->m_params['format'] == $format ? ' selected' : '').'>'.$format."</option>\n";
 278+ }
 279+ }
 280+
 281+ $result .= '</select></div>';
 282+
 283+ $result .= '<input type="submit" value="' . wfMsg('smw_ask_submit') . '"/>' .
269284 '<input type="hidden" name="eq" value="yes"/>' .
270285 ' <a href="' . htmlspecialchars($skin->makeSpecialUrl('Ask',$urltail)) . '" rel="nofollow">' . wfMsg('smw_ask_hidequery') . '</a> ' .
271286 SMWAskPage::$pipeseparator .
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
@@ -196,6 +196,8 @@
197197 'smw_ask_help' => 'Querying help',
198198 'smw_ask_queryhead' => 'Query',
199199 'smw_ask_printhead' => 'Additional printouts (optional)',
 200+ 'smw_ask_format_as' => 'Format as',
 201+ 'smw_ask_defaultformat' => 'default',
200202
201203 // Messages for the search by property special
202204 'searchbyproperty' => 'Search by property',

Status & tagging log