r94634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94633‎ | r94634 | r94635 >
Date:13:21, 16 August 2011
Author:devayon
Status:deferred
Tags:
Comment:
initial work for adding seperate controls for default, intro and outro
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
@@ -1515,9 +1515,7 @@
15161516
15171517 $result[0] .= "</select>";
15181518 $result[0] .= "\n";
1519 - $result[] .= '<fieldset><legend>' . wfMsg( 'smw_ask_otheroptions' ) . "</legend>\n";
1520 - $result[1] .= "<div id=\"other_options\">" . $this->showFormatOptions( $params['format'], $params ) . " </div>";
1521 - $result[1] .= "</fieldset>\n";
 1519+ $result[] .= '<div id="other_options"> ' . $this->showFormatOptions( $params['format'], $params ) . ' </div>';
15221520
15231521 // BEGIN: add javascript for updating formating options by ajax
15241522 $javascript = <<<END
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php
@@ -177,7 +177,9 @@
178178 * Overridden from parent to ignore GUI parameters 'format' 'limit' and 'offset'
179179 */
180180 protected function showFormatOptions( $format, array $paramValues, array $ignoredAttribs = array() ) {
181 - return parent::showFormatOptions( $format, $paramValues, array( 'format', 'limit', 'offset', 'mainlabel' ) );
 181+ return parent::showFormatOptions( $format, $paramValues, array(
 182+ 'format', 'limit', 'offset', 'mainlabel', 'intro', 'outro', 'default'
 183+ ) );
182184 }
183185 /**
184186 * Creates the input form
@@ -218,7 +220,20 @@
219221 // END: show|hide additional options
220222 $result .= '<div id="additional_options" style="display:none">';
221223
222 - $result .= $formatBox[1]; // display the format options
 224+ $result .= '<fieldset><legend>' . wfMsg( 'smw_ask_otheroptions' ) . "</legend>\n" .
 225+ Html::rawElement( 'div', array( 'style' => 'width: 30%; padding: 5px; float: left;' ),
 226+ 'Intro: <input name="p[intro]" size="32"/> <br/>' . wfMsg( 'smw_paramdesc_intro' )
 227+ ) .
 228+ Html::rawElement( 'div', array( 'style' => 'width: 30%; padding: 5px; float: left;' ),
 229+ 'Outro: <input name="p[outro]" size="32"/> <br/>' . wfMsg( 'smw_paramdesc_outro' )
 230+ ) .
 231+ Html::rawElement( 'div', array( 'style' => 'width: 30%; padding: 5px; float: left;' ),
 232+ 'Default: <input name="p[default]" size="32"/> <br/>' . wfMsg( 'smw_paramdesc_default' )
 233+ ) .
 234+ '</fieldset>';
 235+ $result .= '<fieldset><legend>' . wfMsg( 'smw_qc_formatopt' ) . "</legend>\n" .
 236+ $formatBox[1] . // display the format options
 237+ "</fieldset>\n";
223238
224239 $result .= '</div>'; // end of hidden additional options
225240 $result .= '<br /><input type="submit" value="' . wfMsg( 'smw_ask_submit' ) . '"/><br/>';
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
@@ -227,7 +227,7 @@
228228 'smw_ask_queryhead' => 'Query',
229229 'smw_ask_printhead' => 'Additional data to display',
230230 'smw_ask_printdesc' => '(add one property name per line)',
231 - 'smw_ask_format_as' => 'Format as:',
 231+ 'smw_ask_format_as' => 'Format as:',
232232 'smw_ask_defaultformat' => 'default',
233233 'smw_ask_otheroptions' => 'Other options',
234234 'smw_ask_show_embed' => 'Show embed code',
@@ -240,6 +240,8 @@
241241 'smw_qc_addmainlabel' => 'Add main label',
242242 'smw_qc_show_addnal_opts' => 'Show more options',
243243 'smw_qc_hide_addnal_opts' => 'Show less options',
 244+ 'smw_qc_otheropt' => 'Other options',
 245+ 'smw_qc_formatopt' => 'Format options',
244246 'smw_qc_query_help' => 'Enter a query using the form below. Select wiki pages based on
245247 Categories (<strong>[[{{ns:category}}:Actor]]</strong>),
246248 Properties (<strong>[[Located in::Germany]]</strong>),