Index: trunk/extensions/Maps/Maps.i18n.php |
— | — | @@ -24,6 +24,8 @@ |
25 | 25 | 'maps-markers' => 'Markers', |
26 | 26 | 'maps-ns-layer' => 'Layer', |
27 | 27 | 'maps-ns-layer-talk' => 'Layer talk', |
| 28 | + 'maps-layer-property' => 'Property', |
| 29 | + 'maps-layer-value' => 'Value', |
28 | 30 | |
29 | 31 | // Validation |
30 | 32 | 'validation-error-invalid-location' => 'Parameter $1 must be a valid location.', |
Index: trunk/extensions/Maps/includes/Maps_LayerPage.php |
— | — | @@ -29,7 +29,45 @@ |
30 | 30 | * @since 0.7.1 |
31 | 31 | */ |
32 | 32 | public function view() { |
33 | | - parent::view(); |
| 33 | + global $wgOut; |
| 34 | + |
| 35 | + $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
| 36 | + |
| 37 | + $rows = array(); |
| 38 | + |
| 39 | + $rows[] = Html::rawElement( |
| 40 | + 'tr', |
| 41 | + array(), |
| 42 | + Html::element( |
| 43 | + 'th', |
| 44 | + array( 'width' => '200px' ), |
| 45 | + wfMsg( 'maps-layer-property' ) |
| 46 | + ) . |
| 47 | + Html::element( |
| 48 | + 'th', |
| 49 | + array(), |
| 50 | + wfMsg( 'maps-layer-value' ) |
| 51 | + ) |
| 52 | + ); |
| 53 | + |
| 54 | + foreach ( $this->getProperties() as $property => $value ) { |
| 55 | + $rows[] = Html::rawElement( |
| 56 | + 'tr', |
| 57 | + array(), |
| 58 | + Html::element( |
| 59 | + 'td', |
| 60 | + array(), |
| 61 | + $property |
| 62 | + ) . |
| 63 | + Html::element( |
| 64 | + 'td', |
| 65 | + array(), |
| 66 | + $value |
| 67 | + ) |
| 68 | + ); |
| 69 | + } |
| 70 | + |
| 71 | + $wgOut->addHTML( Html::rawElement( 'table', array( 'width' => '100%', 'class' => 'wikitable sortable' ), implode( "\n", $rows ) ) ); |
34 | 72 | } |
35 | 73 | |
36 | 74 | /** |
— | — | @@ -51,6 +89,12 @@ |
52 | 90 | * @return array |
53 | 91 | */ |
54 | 92 | protected function getProperties() { |
| 93 | + static $cachedProperties = false; |
| 94 | + |
| 95 | + if ( $cachedProperties !== false ) { |
| 96 | + return $cachedProperties; |
| 97 | + } |
| 98 | + |
55 | 99 | $properties = array(); |
56 | 100 | |
57 | 101 | if ( is_null( $this->mContent ) ) { |
— | — | @@ -65,6 +109,7 @@ |
66 | 110 | } |
67 | 111 | } |
68 | 112 | |
| 113 | + $cachedProperties = $properties; |
69 | 114 | return $properties; |
70 | 115 | } |
71 | 116 | |