r85190 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85189‎ | r85190 | r85191 >
Date:12:53, 2 April 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
adding stuff to work with Validator style params for SMW 1.6
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php
@@ -702,7 +702,9 @@
703703 $printer = SMWQueryProcessor::getResultPrinter( $format, SMWQueryProcessor::SPECIAL_PAGE );
704704
705705 $params = method_exists( $printer, 'getParameters' ) ? $printer->getParameters() : array();
706 -
 706+
 707+ $optionsHtml = array();
 708+
707709 foreach ( $params as $i => $param ) {
708710 $param_name = $param['name'];
709711 $type = $param['type'];
@@ -710,6 +712,9 @@
711713
712714 $cur_value = ( array_key_exists( $param_name, $paramValues ) ) ? $paramValues[$param_name] : '';
713715
 716+ //$optionsHtml[] = $optionsHtml[$i] = "<div style=\"width: 30%; padding: 5px; float: left;\">$param_name:\n"
 717+ // . $this->showFormatOption( $this->toValidatorParam( $param ) );
 718+
714719 // 3 values per row, with alternating colors for rows
715720 if ( $i % 3 == 0 ) {
716721 $bgcolor = ( $i % 6 ) == 0 ? '#dddddd' : 'white';
@@ -726,9 +731,40 @@
727732 $text .= "<div style=\"clear: both\";></div></div>\n";
728733 }
729734 }
730 -
 735+ /*
 736+ for ( $i = 0, $n = count( $optionsHtml ); $i < $n; $i++ ) {
 737+ if ( $i % 3 == 2 || $i == $n - 1 ) {
 738+ $optionsHtml[$i] .= "<div style=\"clear: both\";></div></div>\n";
 739+ }
 740+ }
 741+ */
731742 return $text;
732743 }
 744+
 745+ /**
 746+ * Returns a Validator style Parameter definition.
 747+ * SMW 1.5.x style definitions are converted.
 748+ *
 749+ * @since 1.6
 750+ *
 751+ * @return Parameter
 752+ */
 753+ protected function toValidatorParam() {
 754+ // TODO
 755+ }
 756+
 757+ /**
 758+ * Get the HTML for a single parameter input.
 759+ *
 760+ * @since 1.6
 761+ *
 762+ * @param Parameter $parameter
 763+ *
 764+ * @return string
 765+ */
 766+ protected function showFormatOption( Parameter $parameter ) {
 767+ // TODO
 768+ }
733769
734770 /**
735771 * Adds a an input for a result format parameter to $text.

Status & tagging log