r107706 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107705‎ | r107706 | r107707 >
Date:04:24, 31 December 2011
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
docs++
Modified paths:
  • /trunk/extensions/SemanticMaps/SemanticMaps.hooks.php (modified) (history)
  • /trunk/extensions/SemanticMaps/SemanticMaps.i18n.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/SM_AreaValueDescription.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValueDescription.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/forminputs/SM_FormInputs.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_KMLPrinter.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_Mapper.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryPrinters.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php
@@ -72,6 +72,8 @@
7373 *
7474 * @param $value String
7575 * @param $asQuery Boolean
 76+ *
 77+ * @return SMWDescription
7678 */
7779 protected function parseUserValueOrQuery( $value, $asQuery = false ) {
7880 $this->wikiValue = $value;
Index: trunk/extensions/SemanticMaps/includes/forminputs/SM_FormInputs.php
@@ -6,7 +6,8 @@
77 * @file SM_FormInputs.php
88 * @ingroup SemanticMaps
99 *
10 - * @author Jeroen De Dauw
 10+ * @licence GNU GPL v3
 11+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1112 */
1213
1314 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -77,7 +78,7 @@
7879 * Adds a mapping service's form hook.
7980 *
8081 * @param string $inputName The name of the form input.
81 - * @param strig $mainName
 82+ * @param string $mainName
8283 */
8384 private static function initFormHook( $inputName, $mainName = '' ) {
8485 global $sfgFormPrinter;
Index: trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValueDescription.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * Description of one data value of type Goegraphical Coordinates.
 5+ * Description of one data value of type Geographical Coordinates.
66 *
77 * @since 0.6
88 * @file SM_GeoCoordsValueDescription.php
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryPrinters.php
@@ -6,7 +6,8 @@
77 * @file SM_QueryPrinters.php
88 * @ingroup SemanticMaps
99 *
10 - * @author Jeroen De Dauw
 10+ * @licence GNU GPL v3
 11+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1112 */
1213
1314 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -88,13 +89,7 @@
8990 */
9091 private static function addFormatQP( $format, $class ) {
9192 global $smwgResultFormats;
92 -
93 - if ( isset( $smwgResultFormats ) ) {
94 - $smwgResultFormats[$format] = $class;
95 - }
96 - else { // BC with some old SMW version
97 - SMWQueryProcessor::$formats[$format] = $class;
98 - }
 93+ $smwgResultFormats[$format] = $class;
9994 }
10095
10196 }
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php
@@ -2,7 +2,7 @@
33
44 /**
55 * Query printer for maps. Is invoked via SMMapper.
6 - * Can be overriden per service to have custom output.
 6+ * Can be overridden per service to have custom output.
77 *
88 * @file SM_MapPrinter.php
99 * @ingroup SemanticMaps
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php
@@ -8,7 +8,8 @@
99 * @ingroup SemanticMaps
1010 * @file SM_QueryHandler.php
1111 *
12 - * @author Jeroen De Dauw
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class SMQueryHandler {
1516
@@ -81,7 +82,7 @@
8283 protected $pageLinkText;
8384
8485 /**
85 - * A separator to use beteen the subject and properties in the text field.
 86+ * A separator to use between the subject and properties in the text field.
8687 *
8788 * @since 1.0
8889 *
@@ -114,6 +115,9 @@
115116 *
116117 * @param SMWQueryResult $queryResult
117118 * @param integer $outputmode
 119+ * @param boolean $linkAbsolute
 120+ * @param string $pageLinkText
 121+ * @param boolean $titleLinkSeparate
118122 */
119123 public function __construct( SMWQueryResult $queryResult, $outputmode, $linkAbsolute = false, $pageLinkText = '$1', $titleLinkSeparate = false ) {
120124 $this->queryResult = $queryResult;
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_Mapper.php
@@ -61,22 +61,26 @@
6262 }
6363
6464 /**
65 - * Explcitly define this method, so method_exists returns true in SMW.
 65+ * Explicitly define this method, so method_exists returns true in SMW.
6666 *
6767 * @see SMWResultPrinter::getParameters
6868 *
6969 * @since 1.0
 70+ *
 71+ * @return array
7072 */
7173 public function getParameters() {
7274 return $this->queryPrinter->getParameters();
7375 }
7476
7577 /**
76 - * Explcitly define this method, so method_exists returns true in SMW.
 78+ * Explicitly define this method, so method_exists returns true in SMW.
7779 *
7880 * @see SMWResultPrinter::getParameters
7981 *
8082 * @since 1.0
 83+ *
 84+ * @return array
8185 */
8286 public function getValidatorParameters() {
8387 return $this->queryPrinter->getValidatorParameters();
@@ -84,12 +88,14 @@
8589
8690 /**
8791 * SMW thinks this class is a SMWResultPrinter, and calls methods that should
88 - * be forewarded to $this->queryPrinter on it.
 92+ * be forward to $this->queryPrinter on it.
8993 *
9094 * @since 1.0
9195 *
9296 * @param string $name
9397 * @param array $arguments
 98+ *
 99+ * @return mixed|void
94100 */
95101 public function __call( $name, array $arguments ) {
96102 return call_user_func_array( array( $this->queryPrinter, $name ), $arguments );
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_KMLPrinter.php
@@ -8,7 +8,8 @@
99 * @file SM_KMLPrinter.php
1010 * @ingroup SemanticMaps
1111 *
12 - * @author Jeroen De Dauw
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 class SMKMLPrinter extends SMWResultPrinter {
1516 /**
@@ -91,12 +92,12 @@
9293 * @return string
9394 */
9495 protected function getKML( SMWQueryResult $res, $outputmode ) {
95 - $queryHandler = new SMQueryHandler( $res, $outputmode, $this->m_params['linkabsolute'], $this->m_params['pagelinktext'], false );
96 - $queryHandler->setText( $this->m_params['text'] );
97 - $queryHandler->setTitle( $this->m_params['title'] );
 96+ $queryHandler = new SMQueryHandler( $res, $outputmode, $this->params['linkabsolute'], $this->params['pagelinktext'], false );
 97+ $queryHandler->setText( $this->params['text'] );
 98+ $queryHandler->setTitle( $this->params['title'] );
9899 $queryHandler->setSubjectSeparator( '' );
99100
100 - $formatter = new MapsKMLFormatter( $this->m_params );
 101+ $formatter = new MapsKMLFormatter( $this->params );
101102 $formatter->addPlacemarks( $queryHandler->getLocations() );
102103
103104 return $formatter->getKML();
@@ -116,19 +117,19 @@
117118 $searchLabel = $this->getSearchLabel( $outputmode );
118119 $link = $res->getQueryLink( $searchLabel ? $searchLabel : wfMsgForContent( 'semanticmaps-kml-link' ) );
119120 $link->setParameter( 'kml', 'format' );
120 - $link->setParameter( $this->m_params['linkabsolute'] ? 'yes' : 'no', 'linkabsolute' );
121 - $link->setParameter( $this->m_params['pagelinktext'], 'pagelinktext' );
 121+ $link->setParameter( $this->params['linkabsolute'] ? 'yes' : 'no', 'linkabsolute' );
 122+ $link->setParameter( $this->params['pagelinktext'], 'pagelinktext' );
122123
123 - if ( $this->m_params['title'] !== '' ) {
124 - $link->setParameter( $this->m_params['title'], 'title' );
 124+ if ( $this->params['title'] !== '' ) {
 125+ $link->setParameter( $this->params['title'], 'title' );
125126 }
126127
127 - if ( $this->m_params['text'] !== '' ) {
128 - $link->setParameter( $this->m_params['text'], 'text' );
 128+ if ( $this->params['text'] !== '' ) {
 129+ $link->setParameter( $this->params['text'], 'text' );
129130 }
130131
131 - if ( array_key_exists( 'limit', $this->m_params ) ) {
132 - $link->setParameter( $this->m_params['limit'], 'limit' );
 132+ if ( array_key_exists( 'limit', $this->params ) ) {
 133+ $link->setParameter( $this->params['limit'], 'limit' );
133134 } else { // Use a reasonable default limit.
134135 $link->setParameter( 20, 'limit' );
135136 }
Index: trunk/extensions/SemanticMaps/includes/SM_AreaValueDescription.php
@@ -2,7 +2,7 @@
33
44 /**
55 * Description of a geographical area defined by a coordinates set and a distance to the bounds.
6 - * The bounds are a 'rectangle' (but bend due to the earhs curvature), as the resulting query
 6+ * The bounds are a 'rectangle' (but bend due to the earths curvature), as the resulting query
77 * would otherwise be to resource intensive.
88 *
99 * @since 0.6
@@ -10,7 +10,8 @@
1111 * @file SM_AreaValueDescription.php
1212 * @ingroup SemanticMaps
1313 *
14 - * @author Jeroen De Dauw
 14+ * @licence GNU GPL v3
 15+ * @author Jeroen De Dauw < jeroendedauw@gmail.com
1516 *
1617 * TODO: would be awesome to use Spatial Extensions to select coordinates
1718 */
@@ -63,10 +64,11 @@
6465 *
6566 * @since 0.6
6667 *
67 - * @param Boolean $asvalue
 68+ * @param Boolean $asValue
6869 */
6970 public function getQueryString( $asValue = false ) {
7071 if ( $this->getDataItem() !== null ) {
 72+ // FIXME
7173 $queryString = SMWDataValueFactory::newDataItemValue( $this->getDataItem() )->getWikiValue();
7274 return $asValue ? $queryString : "[[$queryString]]";
7375 } else {
@@ -154,7 +156,7 @@
155157 * @since 0.6
156158 *
157159 * @param array $centerCoordinates Array containing non-directional float coordinates with lat and lon keys.
158 - * @param float $circleRadius The radidus of the circle to create a bounding box for, in m.
 160+ * @param float $circleRadius The radius of the circle to create a bounding box for, in m.
159161 *
160162 * @return An associative array containing the limits with keys north, east, south and west.
161163 */
Index: trunk/extensions/SemanticMaps/SemanticMaps.i18n.php
@@ -6,7 +6,8 @@
77 * @file SemanticMaps.i18n.php
88 * @ingroup Semantic Maps
99 *
10 - * @author Jeroen De Dauw
 10+ * @licence GNU GPL v3
 11+ * @author Jeroen De Dauw < jeroendedauw@gmail.com
1112 */
1213
1314 $messages = array();
Index: trunk/extensions/SemanticMaps/SemanticMaps.hooks.php
@@ -7,8 +7,9 @@
88 *
99 * @file SemanticMaps.hooks.php
1010 * @ingroup SemanticMaps
11 - *
12 - * @author Jeroen De Dauw
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1314 */
1415 final class SemanticMapsHooks {
1516
@@ -16,7 +17,9 @@
1718 * Adds a link to Admin Links page.
1819 *
1920 * @since 0.7
20 - *
 21+ *
 22+ * @param array $admin_links_tree
 23+ *
2124 * @return true
2225 */
2326 public static function addToAdminLinks( &$admin_links_tree ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r107728Follow up to r107706; typo fixjeroendedauw17:58, 31 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   09:53, 31 December 2011

Did you mean forwarded

+	 * be forward to $this->queryPrinter on it.
#Comment by Jeroen De Dauw (talk | contribs)   17:58, 31 December 2011

yeah, thnx

Status & tagging log