Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | * |
32 | 32 | * @var mixed SMWQUeryUI::ENABLE_AUTO_SUGGEST | SMWQUeryUI::DISABLE_AUTO_SUGGEST |
33 | 33 | */ |
34 | | - private $autocompleteenabled = false; |
| 34 | + private $autoCompleteEnabled = false; |
35 | 35 | |
36 | 36 | const ENABLE_AUTO_SUGGEST = true; |
37 | 37 | const DISABLE_AUTO_SUGGEST = false; |
— | — | @@ -143,8 +143,8 @@ |
144 | 144 | protected function enableJQuery() { |
145 | 145 | global $wgOut, $smwgJQueryIncluded; |
146 | 146 | if ( !$smwgJQueryIncluded ) { |
147 | | - $realFunction = array( 'OutputPage', 'includeJQuery' ); |
148 | | - if ( is_callable( $realFunction ) ) { |
| 147 | + $real_function = array( 'OutputPage', 'includeJQuery' ); |
| 148 | + if ( is_callable( $real_function ) ) { |
149 | 149 | $wgOut->includeJQuery(); |
150 | 150 | } else { |
151 | 151 | $wgOut->addScriptFile( "$smwgScriptPath/libs/jquery-1.4.2.min.js" ); |
— | — | @@ -188,7 +188,7 @@ |
189 | 189 | */ |
190 | 190 | protected function addAutocompletionJavascriptAndCSS() { |
191 | 191 | global $wgOut; |
192 | | - if ( $this->autocompleteenabled == false ) { |
| 192 | + if ( $this->autoCompleteEnabled == false ) { |
193 | 193 | $this->enableJQueryUI(); |
194 | 194 | $javascript_autocomplete_text = <<<END |
195 | 195 | <script type="text/javascript"> |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | END; |
238 | 238 | |
239 | 239 | $wgOut->addScript( $javascript_autocomplete_text ); |
240 | | - $this->autocompleteenabled = true; |
| 240 | + $this->autoCompleteEnabled = true; |
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
— | — | @@ -250,13 +250,13 @@ |
251 | 251 | * @global int $smwgQMaxInlineLimit |
252 | 252 | * @param int $limit |
253 | 253 | * @param int $offset |
254 | | - * @param boolean $has_further_results |
| 254 | + * @param boolean $hasFurtherResults |
255 | 255 | * |
256 | 256 | * @return string |
257 | 257 | */ |
258 | | - public function getNavigationBar( $limit, $offset, $has_further_results ) { |
| 258 | + public function getNavigationBar( $limit, $offset, $hasFurtherResults ) { |
259 | 259 | global $smwgQMaxInlineLimit; |
260 | | - $urltail = $this->getUrlTail(); |
| 260 | + $url_tail = $this->getUrlTail(); |
261 | 261 | // Prepare navigation bar. |
262 | 262 | if ( $offset > 0 ) { |
263 | 263 | $navigation = Html::element( |
— | — | @@ -264,7 +264,7 @@ |
265 | 265 | array( |
266 | 266 | 'href' => $this->getTitle()->getLocalURL( |
267 | 267 | 'offset=' . max( 0, $offset - $limit ) . |
268 | | - '&limit=' . $limit . $urltail |
| 268 | + '&limit=' . $limit . $url_tail |
269 | 269 | ), |
270 | 270 | 'rel' => 'nofollow' |
271 | 271 | ), |
— | — | @@ -282,13 +282,13 @@ |
283 | 283 | ( $offset + $this->uiCore->getResultCount() ) . |
284 | 284 | '</b>    '; |
285 | 285 | |
286 | | - if ( $has_further_results ) { |
| 286 | + if ( $hasFurtherResults ) { |
287 | 287 | $navigation .= Html::element( |
288 | 288 | 'a', |
289 | 289 | array( |
290 | 290 | 'href' => $this->getTitle()->getLocalURL( |
291 | 291 | 'offset=' . ( $offset + $limit ) . |
292 | | - '&limit=' . $limit . $urltail |
| 292 | + '&limit=' . $limit . $url_tail |
293 | 293 | ), |
294 | 294 | 'rel' => 'nofollow' |
295 | 295 | ), |
— | — | @@ -316,7 +316,7 @@ |
317 | 317 | array( |
318 | 318 | 'href' => $this->getTitle()->getLocalURL( |
319 | 319 | 'offset=' . $offset . |
320 | | - '&limit=' . $l . $urltail |
| 320 | + '&limit=' . $l . $url_tail |
321 | 321 | ), |
322 | 322 | 'rel' => 'nofollow' |
323 | 323 | ), |
— | — | @@ -821,7 +821,7 @@ |
822 | 822 | */ |
823 | 823 | protected function processPOFormBox( WebRequest $wgRequest ) { |
824 | 824 | $postring = $wgRequest->getText( 'po' ); |
825 | | - $poarray = array(); |
| 825 | + $po_array = array(); |
826 | 826 | |
827 | 827 | if ( $postring != '' ) { // parameters from HTML input fields |
828 | 828 | $ps = explode( "\n", $postring ); // params separated by newlines here (compatible with text-input for printouts) |
— | — | @@ -833,11 +833,11 @@ |
834 | 834 | $param = '?' . $param; |
835 | 835 | } |
836 | 836 | |
837 | | - $poarray[] = $param; |
| 837 | + $po_array[] = $param; |
838 | 838 | } |
839 | 839 | } |
840 | 840 | |
841 | | - return $poarray; |
| 841 | + return $po_array; |
842 | 842 | } |
843 | 843 | |
844 | 844 | /** |
— | — | @@ -848,7 +848,7 @@ |
849 | 849 | * @return string An url-encoded string. |
850 | 850 | */ |
851 | 851 | protected function getUrlTail() { |
852 | | - $urltail = '&q=' . urlencode( $this->uiCore->getQuerystring() ); |
| 852 | + $url_tail = '&q=' . urlencode( $this->uiCore->getQuerystring() ); |
853 | 853 | |
854 | 854 | $tmp_parray = array(); |
855 | 855 | $params = $this->uiCore->getParameters(); |
— | — | @@ -857,24 +857,24 @@ |
858 | 858 | $tmp_parray[$key] = $value; |
859 | 859 | } |
860 | 860 | } |
861 | | - $urltail .= '&p=' . urlencode( SMWInfolink::encodeParameters( $tmp_parray ) ); |
| 861 | + $url_tail .= '&p=' . urlencode( SMWInfolink::encodeParameters( $tmp_parray ) ); |
862 | 862 | |
863 | | - $printoutstring = ''; |
| 863 | + $print_out_string = ''; |
864 | 864 | foreach ( $this->uiCore->getPrintOuts() as $printout ) { |
865 | | - $printoutstring .= $printout->getSerialisation() . "\n"; |
| 865 | + $print_out_string .= $printout->getSerialisation() . "\n"; |
866 | 866 | } |
867 | 867 | |
868 | | - if ( $printoutstring != '' ) { |
869 | | - $urltail .= '&po=' . urlencode( $printoutstring ); |
| 868 | + if ( $print_out_string != '' ) { |
| 869 | + $url_tail .= '&po=' . urlencode( $print_out_string ); |
870 | 870 | } |
871 | 871 | if ( array_key_exists( 'sort', $params ) ) { |
872 | | - $urltail .= '&sort=' . $params['sort']; |
| 872 | + $url_tail .= '&sort=' . $params['sort']; |
873 | 873 | } |
874 | 874 | if ( array_key_exists( 'order', $params ) ) { |
875 | | - $urltail .= '&order=' . $params['order']; |
| 875 | + $url_tail .= '&order=' . $params['order']; |
876 | 876 | } |
877 | 877 | |
878 | | - return $urltail; |
| 878 | + return $url_tail; |
879 | 879 | } |
880 | 880 | |
881 | 881 | /** |
— | — | @@ -883,62 +883,62 @@ |
884 | 884 | * |
885 | 885 | * @param string $format |
886 | 886 | * @param array $paramValues The current values for the parameters (name => value) |
887 | | - * @param array $ignoredattribs Attributes which should not be generated by this method. |
| 887 | + * @param array $ignoredAttribs Attributes which should not be generated by this method. |
888 | 888 | * |
889 | 889 | * @return string |
890 | 890 | */ |
891 | | - protected function showFormatOptions( $format, array $paramValues, $ignoredattribs = array() ) { |
| 891 | + protected function showFormatOptions( $format, array $paramValues, array $ignoredAttribs = array() ) { |
892 | 892 | $printer = SMWQueryProcessor::getResultPrinter( $format, SMWQueryProcessor::SPECIAL_PAGE ); |
893 | 893 | |
894 | 894 | $params = method_exists( $printer, 'getValidatorParameters' ) ? $printer->getValidatorParameters() : array(); |
895 | 895 | |
896 | | - $optionsHtml = array(); |
| 896 | + $options_html = array(); |
897 | 897 | |
898 | 898 | foreach ( $params as $param ) { |
899 | 899 | // Ignore the parameters for which we have a special control in the GUI already. |
900 | | - if ( in_array( $param->getName(), $ignoredattribs ) ) { |
| 900 | + if ( in_array( $param->getName(), $ignoredAttribs ) ) { |
901 | 901 | continue; |
902 | 902 | } |
903 | 903 | |
904 | | - $currentValue = array_key_exists( $param->getName(), $paramValues ) ? $paramValues[$param->getName()] : false; |
| 904 | + $current_value = array_key_exists( $param->getName(), $paramValues ) ? $paramValues[$param->getName()] : false; |
905 | 905 | |
906 | | - $optionsHtml[] = |
| 906 | + $options_html[] = |
907 | 907 | Html::rawElement( |
908 | 908 | 'div', |
909 | 909 | array( |
910 | 910 | 'style' => 'width: 30%; padding: 5px; float: left;' |
911 | 911 | ), |
912 | 912 | '<label for="p[' . htmlspecialchars( $param->getName() ) . ']">' . htmlspecialchars( $param->getName() ) . ': </label>' . |
913 | | - $this->showFormatOption( $param, $currentValue ) . |
| 913 | + $this->showFormatOption( $param, $current_value ) . |
914 | 914 | '<br />' . |
915 | 915 | Html::element( 'em', array(), $param->getDescription() ) |
916 | 916 | ); |
917 | 917 | } |
918 | 918 | |
919 | | - for ( $i = 0, $n = count( $optionsHtml ); $i < $n; $i++ ) { |
| 919 | + for ( $i = 0, $n = count( $options_html ); $i < $n; $i++ ) { |
920 | 920 | if ( $i % 3 == 2 || $i == $n - 1 ) { |
921 | | - $optionsHtml[$i] .= "<div style=\"clear: both\";></div>\n"; |
| 921 | + $options_html[$i] .= "<div style=\"clear: both\";></div>\n"; |
922 | 922 | } |
923 | 923 | } |
924 | 924 | |
925 | 925 | $i = 0; |
926 | | - $rowHtml = ''; |
927 | | - $resultHtml = ''; |
| 926 | + $row_html = ''; |
| 927 | + $result_html = ''; |
928 | 928 | $flip_style = true; |
929 | 929 | $flip_count = 0; |
930 | | - while ( $option = array_shift( $optionsHtml ) ) { |
931 | | - $rowHtml .= $option; |
| 930 | + while ( $option = array_shift( $options_html ) ) { |
| 931 | + $row_html .= $option; |
932 | 932 | $i++; |
933 | 933 | |
934 | | - $resultHtml .= Html::rawElement( |
| 934 | + $result_html .= Html::rawElement( |
935 | 935 | 'div', |
936 | 936 | array( |
937 | 937 | 'style' => 'background: ' . ( $flip_style ? 'white' : '#dddddd' ) . ';' |
938 | 938 | ), |
939 | | - $rowHtml |
| 939 | + $row_html |
940 | 940 | ); |
941 | 941 | |
942 | | - $rowHtml = ''; |
| 942 | + $row_html = ''; |
943 | 943 | $flip_count++; |
944 | 944 | if ( $flip_count == 3 ) { |
945 | 945 | $flip_style = !$flip_style; |
— | — | @@ -947,7 +947,7 @@ |
948 | 948 | |
949 | 949 | } |
950 | 950 | |
951 | | - return $resultHtml; |
| 951 | + return $result_html; |
952 | 952 | } |
953 | 953 | |
954 | 954 | |
— | — | @@ -1108,9 +1108,9 @@ |
1109 | 1109 | */ |
1110 | 1110 | public function getPOStrings() { |
1111 | 1111 | $string = ''; |
1112 | | - $printouts = $this->uiCore->getPrintOuts(); |
1113 | | - if ( !empty( $printouts ) ) { |
1114 | | - foreach ( $printouts as $value ) { |
| 1112 | + $print_outs = $this->uiCore->getPrintOuts(); |
| 1113 | + if ( !empty( $print_outs ) ) { |
| 1114 | + foreach ( $print_outs as $value ) { |
1115 | 1115 | $string .= $value->getSerialisation() . "\n"; |
1116 | 1116 | } |
1117 | 1117 | } |
— | — | @@ -1331,18 +1331,18 @@ |
1332 | 1332 | * Sets up a query. If validation is enabled, then the query string is |
1333 | 1333 | * checked for errors. |
1334 | 1334 | * |
1335 | | - * @param string $query_string The query |
| 1335 | + * @param string $queryString The query |
1336 | 1336 | * @return array array of errors, if any. |
1337 | 1337 | */ |
1338 | | - public function setQueryString( $query_string = "", $enable_validation = false ) { |
1339 | | - $this -> queryString = $query_string; |
| 1338 | + public function setQueryString( $queryString = "", $enableValidation = false ) { |
| 1339 | + $this -> queryString = $queryString; |
1340 | 1340 | |
1341 | 1341 | $errors = array(); |
1342 | | - if ( $enable_validation ) { |
1343 | | - if ( $query_string == '' ) { |
| 1342 | + if ( $enableValidation ) { |
| 1343 | + if ( $queryString == '' ) { |
1344 | 1344 | $errors[] = wfMsg( 'smw_qui_noquery' ); |
1345 | 1345 | } else { |
1346 | | - $query = SMWQueryProcessor::createQuery( $query_string, array() ); |
| 1346 | + $query = SMWQueryProcessor::createQuery( $queryString, array() ); |
1347 | 1347 | $errors = $query ->getErrors(); |
1348 | 1348 | } |
1349 | 1349 | if ( !empty ( $errors ) ) { |
— | — | @@ -1365,16 +1365,16 @@ |
1366 | 1366 | * each property) is returned. Returns an empty array otherwise. |
1367 | 1367 | * |
1368 | 1368 | * @param array $print_outs Array of strings |
1369 | | - * @param boolean $enable_validation |
| 1369 | + * @param boolean $enableValidation |
1370 | 1370 | * @return array Array of errors messages (strings), if any. |
1371 | 1371 | */ |
1372 | | - public function setPrintOuts( array $print_outs = array(), $enable_validation = false ) { |
| 1372 | + public function setPrintOuts( array $print_outs = array(), $enableValidation = false ) { |
1373 | 1373 | /* |
1374 | 1374 | * Note: property validation is not very clearly defined yet, so validation is disabled by default |
1375 | 1375 | */ |
1376 | 1376 | |
1377 | 1377 | $errors = array(); |
1378 | | - if ( $enable_validation ) { |
| 1378 | + if ( $enableValidation ) { |
1379 | 1379 | foreach ( $print_outs as $key => $prop ) { |
1380 | 1380 | if ( $prop[0] != '?' ) { |
1381 | 1381 | $print_outs[$key] = "?" . $print_outs[$key]; |
— | — | @@ -1404,10 +1404,10 @@ |
1405 | 1405 | * @global int $smwgQMaxInlineLimit |
1406 | 1406 | * @global array $smwgResultFormats |
1407 | 1407 | * @param array $params |
1408 | | - * @param boolean $enable_validation |
| 1408 | + * @param boolean $enableValidation |
1409 | 1409 | * @return array of strings |
1410 | 1410 | */ |
1411 | | - public function setParams( array $params = array(), $enable_validation = false ) { |
| 1411 | + public function setParams( array $params = array(), $enableValidation = false ) { |
1412 | 1412 | global $smwgQMaxInlineLimit, $smwgResultFormats; |
1413 | 1413 | $errors = array(); |
1414 | 1414 | |
— | — | @@ -1423,7 +1423,7 @@ |
1424 | 1424 | $params['offset'] = 0; |
1425 | 1425 | } |
1426 | 1426 | |
1427 | | - if ( $enable_validation ) { // validating the format |
| 1427 | + if ( $enableValidation ) { // validating the format |
1428 | 1428 | if ( !array_key_exists( $params['format'], $smwgResultFormats ) ) { |
1429 | 1429 | $errors[] = wfMsg( 'smw_qui_invalidformat', $params['format'] ); |
1430 | 1430 | $this->errorsOccured = true; |
— | — | @@ -1457,15 +1457,15 @@ |
1458 | 1458 | public function extractParameters( $p ) { |
1459 | 1459 | if ( $this->context == self::SPECIAL_PAGE ) { |
1460 | 1460 | // assume setParams(), setPintouts and setQueryString have been called |
1461 | | - $rawparams = array_merge( $this->parameters, array( $this->queryString ), $this->printOutStrings ); |
| 1461 | + $raw_params = array_merge( $this->parameters, array( $this->queryString ), $this->printOutStrings ); |
1462 | 1462 | } else {// context is WIKI_LINK |
1463 | | - $rawparams = SMWInfolink::decodeParameters( $p, true ); |
| 1463 | + $raw_params = SMWInfolink::decodeParameters( $p, true ); |
1464 | 1464 | // calling setParams to fill in missing parameters |
1465 | | - $this->setParams( $rawparams ); |
1466 | | - $rawparams = $this->parameters; |
| 1465 | + $this->setParams( $raw_params ); |
| 1466 | + $raw_params = $this->parameters; |
1467 | 1467 | } |
1468 | 1468 | |
1469 | | - SMWQueryProcessor::processFunctionParams( $rawparams, $this->queryString, $this->parameters, $this->printOuts ); |
| 1469 | + SMWQueryProcessor::processFunctionParams( $raw_params, $this->queryString, $this->parameters, $this->printOuts ); |
1470 | 1470 | } |
1471 | 1471 | |
1472 | 1472 | /** |
— | — | @@ -1493,28 +1493,28 @@ |
1494 | 1494 | |
1495 | 1495 | // BEGIN: Try to be smart for rss/ical if no description/title is given and we have a concept query |
1496 | 1496 | if ( $this->parameters['format'] == 'rss' ) { |
1497 | | - $desckey = 'rssdescription'; |
| 1497 | + $desc_key = 'rssdescription'; |
1498 | 1498 | $titlekey = 'rsstitle'; |
1499 | 1499 | } elseif ( $this->parameters['format'] == 'icalendar' ) { |
1500 | | - $desckey = 'icalendardescription'; |
| 1500 | + $desc_key = 'icalendardescription'; |
1501 | 1501 | $titlekey = 'icalendartitle'; |
1502 | 1502 | } else { |
1503 | | - $desckey = false; |
| 1503 | + $desc_key = false; |
1504 | 1504 | } |
1505 | 1505 | |
1506 | | - if ( $desckey && ( $query->getDescription() instanceof SMWConceptDescription ) && |
1507 | | - ( !isset( $this->parameters[$desckey] ) || !isset( $this->parameters[$titlekey] ) ) ) { |
| 1506 | + if ( $desc_key && ( $query->getDescription() instanceof SMWConceptDescription ) && |
| 1507 | + ( !isset( $this->parameters[$desc_key] ) || !isset( $this->parameters[$titlekey] ) ) ) { |
1508 | 1508 | $concept = $query->getDescription()->getConcept(); |
1509 | 1509 | |
1510 | 1510 | if ( !isset( $this->parameters[$titlekey] ) ) { |
1511 | 1511 | $this->parameters[$titlekey] = $concept->getText(); |
1512 | 1512 | } |
1513 | 1513 | |
1514 | | - if ( !isset( $this->parameters[$desckey] ) ) { |
| 1514 | + if ( !isset( $this->parameters[$desc_key] ) ) { |
1515 | 1515 | // / @bug The current SMWStore will never return SMWConceptValue (an SMWDataValue) here; it might return SMWDIConcept (an SMWDataItem) |
1516 | 1516 | $dv = end( smwfGetStore()->getPropertyValues( SMWWikiPageValue::makePageFromTitle( $concept ), new SMWDIProperty( '_CONC' ) ) ); |
1517 | 1517 | if ( $dv instanceof SMWConceptValue ) { |
1518 | | - $this->parameters[$desckey] = $dv->getDocu(); |
| 1518 | + $this->parameters[$desc_key] = $dv->getDocu(); |
1519 | 1519 | } |
1520 | 1520 | } |
1521 | 1521 | } |
— | — | @@ -1625,12 +1625,12 @@ |
1626 | 1626 | * from hasError() and getErrors(). |
1627 | 1627 | * |
1628 | 1628 | * @param string $p parameters of the query. |
1629 | | - * @param boolean $enable_validation |
| 1629 | + * @param boolean $enableValidation |
1630 | 1630 | * @return SMWQueryUIHelper |
1631 | 1631 | * |
1632 | 1632 | * @todo Handle validation for infolink parameters |
1633 | 1633 | */ |
1634 | | - public static function makeForInfoLink( $p, $enable_validation = false ) { |
| 1634 | + public static function makeForInfoLink( $p, $enableValidation = false ) { |
1635 | 1635 | $result = new SMWQueryUIHelper( self::WIKI_LINK ); |
1636 | 1636 | $result->extractParameters( $p ); |
1637 | 1637 | $result->execute(); |
— | — | @@ -1650,15 +1650,15 @@ |
1651 | 1651 | * @param string $query |
1652 | 1652 | * @param array $params of key=>value pairs |
1653 | 1653 | * @param array $printouts array of '?property' strings |
1654 | | - * @param boolean $enable_validation |
| 1654 | + * @param boolean $enableValidation |
1655 | 1655 | * @return SMWQueryUIHelper |
1656 | 1656 | * |
1657 | 1657 | */ |
1658 | | - public static function makeForUI( $query, array $params, array $printouts, $enable_validation = false ) { |
| 1658 | + public static function makeForUI( $query, array $params, array $printouts, $enableValidation = false ) { |
1659 | 1659 | $result = new SMWQueryUIHelper( self::SPECIAL_PAGE ); |
1660 | | - $result->setParams( $params, $enable_validation ); |
1661 | | - $result->setPrintOuts( $printouts, $enable_validation ); |
1662 | | - $result->setQueryString( $query, $enable_validation ); |
| 1660 | + $result->setParams( $params, $enableValidation ); |
| 1661 | + $result->setPrintOuts( $printouts, $enableValidation ); |
| 1662 | + $result->setQueryString( $query, $enableValidation ); |
1663 | 1663 | $result->extractParameters( '' ); |
1664 | 1664 | // $result->execute(); |
1665 | 1665 | return $result; |
— | — | @@ -1676,9 +1676,9 @@ |
1677 | 1677 | * SMWStore. We hence we check if $property has a corresponding page describing it. |
1678 | 1678 | */ |
1679 | 1679 | $prop = substr( $property, 1 ); // removing the leading '?' while checking. |
1680 | | - $propertypage = Title::newFromText( $prop, SMW_NS_PROPERTY ); |
1681 | | - if ( $propertypage instanceof Title ) { |
1682 | | - return( $propertypage->exists() ); |
| 1680 | + $property_page = Title::newFromText( $prop, SMW_NS_PROPERTY ); |
| 1681 | + if ( $property_page instanceof Title ) { |
| 1682 | + return( $property_page->exists() ); |
1683 | 1683 | } else { |
1684 | 1684 | return false; |
1685 | 1685 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php |
— | — | @@ -34,19 +34,19 @@ |
35 | 35 | */ |
36 | 36 | protected function makePage( $p ) { |
37 | 37 | global $wgOut; |
38 | | - $htmloutput = $this->makeResults( $p ); |
| 38 | + $html_output = $this->makeResults( $p ); |
39 | 39 | if ( $this->uiCore->getQueryString() != "" ) { |
40 | 40 | if ( $this->usesNavigationBar() ) { |
41 | | - $htmloutput .= $this->getNavigationBar ( $this->uiCore->getLimit(), $this->uiCore->getOffset(), $this->uiCore->hasFurtherResults() ); // ? can we preload offset and limit? |
| 41 | + $html_output .= $this->getNavigationBar ( $this->uiCore->getLimit(), $this->uiCore->getOffset(), $this->uiCore->hasFurtherResults() ); // ? can we preload offset and limit? |
42 | 42 | } |
43 | 43 | |
44 | | - $htmloutput .= "<br/>" . $this->uiCore->getHTMLResult() . "<br>"; |
| 44 | + $html_output .= "<br/>" . $this->uiCore->getHTMLResult() . "<br>"; |
45 | 45 | |
46 | 46 | if ( $this->usesNavigationBar() ) { |
47 | | - $htmloutput .= $this->getNavigationBar ( $this->uiCore->getLimit(), $this->uiCore->getOffset(), $this->uiCore->hasFurtherResults() ); // ? can we preload offset and limit? |
| 47 | + $html_output .= $this->getNavigationBar ( $this->uiCore->getLimit(), $this->uiCore->getOffset(), $this->uiCore->hasFurtherResults() ); // ? can we preload offset and limit? |
48 | 48 | } |
49 | 49 | } |
50 | | - $wgOut->addHTML( $htmloutput ); |
| 50 | + $wgOut->addHTML( $html_output ); |
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
— | — | @@ -55,13 +55,13 @@ |
56 | 56 | * |
57 | 57 | * @param string $format |
58 | 58 | * @param array $paramValues The current values for the parameters (name => value) |
59 | | - * @param array $ignoredattribs Attributes which should not be generated by this method. |
| 59 | + * @param array $ignoredAttribs Attributes which should not be generated by this method. |
60 | 60 | * |
61 | 61 | * @return string |
62 | 62 | * |
63 | 63 | * Overridden from parent to ignore GUI parameters 'format' 'limit' and 'offset' |
64 | 64 | */ |
65 | | - protected function showFormatOptions( $format, array $paramValues, $ignoredattribs = array() ) { |
| 65 | + protected function showFormatOptions( $format, array $paramValues, array $ignoredAttribs = array() ) { |
66 | 66 | return parent::showFormatOptions( $format, $paramValues, array( 'format', 'limit', 'offset' ) ); |
67 | 67 | } |
68 | 68 | /** |
— | — | @@ -73,10 +73,10 @@ |
74 | 74 | protected function makeResults() { |
75 | 75 | global $wgOut; |
76 | 76 | $result = ""; |
77 | | - $spectitle = $this->getTitle(); |
78 | | - $formatBox = $this->getFormatSelectBoxSep( 'broadtable' ); |
79 | | - $result .= '<form name="ask" action="' . $spectitle->escapeLocalURL() . '" method="get">' . "\n" . |
80 | | - '<input type="hidden" name="title" value="' . $spectitle->getPrefixedText() . '"/>'; |
| 77 | + $spec_title = $this->getTitle(); |
| 78 | + $format_box = $this->getFormatSelectBoxSep( 'broadtable' ); |
| 79 | + $result .= '<form name="ask" action="' . $spec_title->escapeLocalURL() . '" method="get">' . "\n" . |
| 80 | + '<input type="hidden" name="title" value="' . $spec_title->getPrefixedText() . '"/>'; |
81 | 81 | $result .= '<br>'; |
82 | 82 | $result .= wfMsg( 'smw_qc_query_help' ); |
83 | 83 | // Main query and format options |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | '<tr><th>' . wfMsg( 'smw_ask_queryhead' ) . "</th>\n<th>" . wfMsg( 'smw_ask_format_as' ) . "</th></tr>" . |
86 | 86 | '<tr>' . |
87 | 87 | '<td style="width: 70%; padding-right: 7px;">' . $this->getQueryFormBox() . "</td>\n" . |
88 | | - '<td style="padding-right: 7px; text-align:center;">' . $formatBox[0] . '</td>' . |
| 88 | + '<td style="padding-right: 7px; text-align:center;">' . $format_box[0] . '</td>' . |
89 | 89 | '</tr>' . |
90 | 90 | "</table>\n"; |
91 | 91 | // sorting and prinouts |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | // additional options |
106 | 106 | $result .= '<div id="additional_options" style="display:none">'; |
107 | 107 | |
108 | | - $result .= $formatBox[1]; // display the format options |
| 108 | + $result .= $format_box[1]; // display the format options |
109 | 109 | |
110 | 110 | if ( $this->uiCore->getQueryString() != '' ) // hide #ask if there isnt any query defined |
111 | 111 | $result .= $this->getAskEmbedBox(); |
— | — | @@ -324,7 +324,7 @@ |
325 | 325 | // END: create form elements already submitted earlier via form |
326 | 326 | |
327 | 327 | // create hidden form elements to be cloned later |
328 | | - $hiddenproperty = Html::openElement( 'div', array( 'id' => 'property_starter', 'class' => 'smw-sort', 'style' => 'display:none' ) ) . |
| 328 | + $hidden_property = Html::openElement( 'div', array( 'id' => 'property_starter', 'class' => 'smw-sort', 'style' => 'display:none' ) ) . |
329 | 329 | '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
330 | 330 | wfMsg( 'smw_qui_property' ) . |
331 | 331 | Xml::input( "property_num", '35' ) . " " . |
— | — | @@ -335,18 +335,18 @@ |
336 | 336 | Xml::closeElement( 'select' ) . |
337 | 337 | Xml::checkLabel( wfMsg( 'smw_qui_shownresults' ), "display_num", '', true ) . |
338 | 338 | Xml::closeElement( 'div' ); |
339 | | - $hiddenproperty = json_encode( $hiddenproperty ); |
| 339 | + $hidden_property = json_encode( $hidden_property ); |
340 | 340 | |
341 | | - $hiddencategory = Html::openElement( 'div', array( 'id' => 'category_starter', 'class' => 'smw-sort', 'style' => 'display:none' ) ) . |
| 341 | + $hidden_category = Html::openElement( 'div', array( 'id' => 'category_starter', 'class' => 'smw-sort', 'style' => 'display:none' ) ) . |
342 | 342 | '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
343 | 343 | 'Category (optional)' . // todo: i18n |
344 | 344 | Xml::input( "category_num", '20' ) . " " . |
345 | 345 | 'Label' . // todo: i18n |
346 | 346 | Xml::input( "cat_label_num", '20' ) . " " . |
347 | 347 | Xml::closeElement( 'div' ); |
348 | | - $hiddencategory = json_encode( $hiddencategory ); |
| 348 | + $hidden_category = json_encode( $hidden_category ); |
349 | 349 | |
350 | | - $propertydialogbox = Xml::openElement( 'div', array( 'id' => 'prop-dialog', 'title' => 'Property Options', 'class' => 'smw-prop-dialog' ) ) . // todo i18n |
| 350 | + $property_dialog_box = Xml::openElement( 'div', array( 'id' => 'prop-dialog', 'title' => 'Property Options', 'class' => 'smw-prop-dialog' ) ) . // todo i18n |
351 | 351 | Xml::inputLabel( 'Property:', '', 'd-property', 'd-property' ) . '<br/>' . // todo i18n |
352 | 352 | Xml::inputLabel( 'Label:', '', 'd-property-label', 'd-property-label' ) . '<br/>' . // todo i18n |
353 | 353 | 'Format: ' . Html::openElement( 'select', array( 'name' => 'd-format', 'id' => 'd-format' ) ) . // todo i18n |
— | — | @@ -357,7 +357,7 @@ |
358 | 358 | // Xml::inputLabel( 'Limit:', 'd-property-limit', 'd-property-limit' ) . '<br/>' . // todo i18n |
359 | 359 | '<input type="hidden" name="d-property-code" id="d-property-code">' . |
360 | 360 | Xml::closeElement( 'div' ); |
361 | | - $categorydialogbox = Xml::openElement( 'div', array( 'id' => 'cat-dialog', 'title' => 'Category Options', 'class' => 'smw-cat-dialog' ) ) . // todo i18n |
| 361 | + $category_dialog_box = Xml::openElement( 'div', array( 'id' => 'cat-dialog', 'title' => 'Category Options', 'class' => 'smw-cat-dialog' ) ) . // todo i18n |
362 | 362 | Xml::inputLabel( 'Category:', '', 'd-category', 'd-category' ) . '<br/>' . // todo i18n |
363 | 363 | Xml::inputLabel( 'Label:', '', 'd-category-label', 'd-category-label' ) . '<br/>' . // todo i18n |
364 | 364 | Xml::inputLabel( 'Yes:', '', 'd-category-yes', 'd-category-yes' ) . '<br/>' . // todo i18n |
— | — | @@ -540,10 +540,10 @@ |
541 | 541 | } |
542 | 542 | |
543 | 543 | jQuery(function(){ |
544 | | - jQuery('$hiddenproperty').appendTo(document.body); |
545 | | - jQuery('$hiddencategory').appendTo(document.body); |
546 | | - jQuery('$propertydialogbox').appendTo(document.body); |
547 | | - jQuery('$categorydialogbox').appendTo(document.body); |
| 544 | + jQuery('$hidden_property').appendTo(document.body); |
| 545 | + jQuery('$hidden_category').appendTo(document.body); |
| 546 | + jQuery('$property_dialog_box').appendTo(document.body); |
| 547 | + jQuery('$category_dialog_box').appendTo(document.body); |
548 | 548 | jQuery('#cat-dialog').dialog({ |
549 | 549 | autoOpen: false, |
550 | 550 | modal: true, |