Completed
Pull Request — master (#130)
by None
07:05
created

SpecialMapEditor::getGroupName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * Special page with map editor interface using Google Maps.
5
 *
6
 * @since 2.0
7
 *
8
 * @licence GNU GPL v2+
9
 * @author Kim Eik
10
 * @author Jeroen De Dauw < [email protected] >
11
 */
12
class SpecialMapEditor extends SpecialPage{
13
14
	/**
15
	 * @see SpecialPage::__construct
16
	 *
17
	 * @since 2.0
18
	 */
19
	public function __construct() {
20
		parent::__construct( 'MapEditor' );
21
	}
22
23
	/**
24
	 * @see SpecialPage::execute
25
	 *
26
	 * @since 2.0
27
	 *
28
	 * @param null|string $subPage
29
	 */
30
	public function execute( $subPage ) {
31
		$this->setHeaders();
32
33
		$outputPage = $this->getOutput();
34
35
		$outputPage->addHtml( MapsGoogleMaps3::getApiScript(
36
			$this->getLanguage()->getCode(),
37
			array( 'libraries' => 'drawing' )
38
		) );
39
40
		$outputPage->addModules( 'mapeditor' );
41
        $editorHtml = new MapEditorHtml( $this->getAttribs() );
42
		$html = $editorHtml->getEditorHtml();
43
		$outputPage->addHTML( $html );
44
	}
45
46
	/**
47
	 * @since 2.1
48
	 *
49
	 * @return array
50
	 */
51
	protected function getAttribs(){
52
		return array(
53
            'id' => 'map-canvas',
54
            'context' => 'SpecialMapEditor'
55
        );
56
	}
57
58
}
59