1 | <?php |
||
17 | class MapsLayerDefinition extends ParserHook { |
||
|
|||
18 | |||
19 | /** |
||
20 | * The final layer representation of this tag. |
||
21 | * |
||
22 | * @since 3.0 |
||
23 | * |
||
24 | * @var MapsLayer instance |
||
25 | */ |
||
26 | protected $layer; |
||
27 | |||
28 | public function __construct() { |
||
29 | /* |
||
30 | * make this a tag extension only to avoid weird parser function |
||
31 | * syntax as we have it in 'display_point' from the beginning! |
||
32 | */ |
||
33 | parent::__construct( true, false ); |
||
34 | } |
||
35 | |||
36 | public static function initialize() { |
||
37 | |||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Gets the name of the parser hook. |
||
42 | * @see ParserHook::getName |
||
43 | * |
||
44 | * @since 3.0 |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | protected function getName() { |
||
49 | return 'layer'; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Returns an array containing the parameter info. |
||
54 | * @see ParserHook::getParameterInfo |
||
55 | * |
||
56 | * @since 3.0 |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | protected function getParameterInfo( $type ) { |
||
87 | |||
88 | /** |
||
89 | * Returns the list of default parameters. |
||
90 | * @see ParserHook::getDefaultParameters |
||
91 | * |
||
92 | * @since 3.0 |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | protected function getDefaultParameters( $type ) { |
||
97 | return [ 'definition' ]; |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * Returns the parser function options. |
||
102 | * @see ParserHook::getFunctionOptions |
||
103 | * |
||
104 | * @since 3.0 |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | protected function getFunctionOptions() { |
||
114 | |||
115 | /** |
||
116 | * @see ParserHook::getMessage() |
||
117 | * |
||
118 | * @since 3.0 |
||
119 | */ |
||
120 | public function getMessage() { |
||
123 | |||
124 | /** |
||
125 | * Returns the MapsLayerGroup with all layers of the same page which have been |
||
126 | * processed already. If the store is not attached to the parser object yet, |
||
127 | * an empty MapsLayerGroup will be attached as store after calling the function. |
||
128 | * |
||
129 | * @since 3.0 |
||
130 | * |
||
131 | * @return MapsLayerGroup |
||
132 | */ |
||
133 | protected function getLayerStore() { |
||
142 | |||
143 | /** |
||
144 | * This will attach a user defined layer to the parser output of the parser which has |
||
145 | * started the <layer> rendering. All added layers will be stored in the database |
||
146 | * after page parsing. |
||
147 | * $layer will only be stored in case it is a subclass of MapsLayer and its definition |
||
148 | * is at least considered 'ok'. |
||
149 | * |
||
150 | * @since 3.0 |
||
151 | * |
||
152 | * @param type $layer |
||
153 | * |
||
154 | * @return boolean whether $layer has been added to the store |
||
155 | */ |
||
156 | protected function addLayerToStore( $layer ) { |
||
177 | |||
178 | /** |
||
179 | * Renders and returns the output. |
||
180 | * @see ParserHook::renderTag |
||
181 | * |
||
182 | * @since 3.0 |
||
183 | * |
||
184 | * @param array $parameters |
||
185 | * |
||
186 | * @return string |
||
187 | */ |
||
188 | public function render( array $parameters ) { |
||
257 | |||
258 | /** |
||
259 | * Responsible for actual output on the layer page which gives an overview of the layer definition. |
||
260 | * |
||
261 | * @since 3.0 |
||
262 | * |
||
263 | * @param MapsLayer |
||
264 | * |
||
265 | * @return string |
||
266 | */ |
||
267 | public function renderLayerInfo( MapsLayer $layer ) { |
||
315 | |||
316 | /** |
||
317 | * Displays the layer definition as a table. |
||
318 | * |
||
319 | * @since 3.0 |
||
320 | * |
||
321 | * @param MapsLayer $layer |
||
322 | * |
||
323 | * @return string |
||
324 | */ |
||
325 | protected function getLayerDefinitionTable( MapsLayer $layer ) { |
||
394 | |||
395 | /** |
||
396 | * wraps text inside an error box. |
||
397 | * |
||
398 | * @since 3.0 |
||
399 | * |
||
400 | * @param string $text text of the error, html-escaped. |
||
401 | * |
||
402 | * @return string |
||
403 | */ |
||
404 | protected function errorbox( $text, $raw = true ) { |
||
412 | |||
413 | /** |
||
414 | * wraps text inside an error box. |
||
415 | * |
||
416 | * @since 3.0 |
||
417 | * |
||
418 | * @param string $text text of the error, NOT html-escaped |
||
419 | * |
||
420 | * @return string |
||
421 | */ |
||
422 | protected function rawErrorbox( $text ) { |
||
426 | } |
||
427 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.