1
1
<?php
2
+
3
+ use dokuwiki \Extension \AdminPlugin ;
4
+
2
5
/*
3
6
* Copyright (c) 2014 Mark C. Prins <[email protected] >
4
7
*
14
17
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
18
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
19
*/
17
-
18
20
/**
19
21
* DokuWiki Plugin spatialhelper (Admin Component).
20
22
* This component purges and recreates the spatial index and sitemaps.
21
23
*
22
24
* @author Mark Prins
23
25
*/
24
- class admin_plugin_spatialhelper_purge extends DokuWiki_Admin_Plugin {
25
-
26
+ class admin_plugin_spatialhelper_purge extends AdminPlugin
27
+ {
26
28
/**
27
29
*
28
30
* @see DokuWiki_Admin_Plugin::getMenuSort()
29
31
*/
30
- public function getMenuSort (): int {
32
+ public function getMenuSort (): int
33
+ {
31
34
return 801 ;
32
35
}
33
36
34
- public function getMenuIcon (): string {
37
+ public function getMenuIcon (): string
38
+ {
35
39
$ plugin = $ this ->getPluginName ();
36
40
return DOKU_PLUGIN . $ plugin . '/admin/purge.svg ' ;
37
41
}
@@ -41,11 +45,12 @@ public function getMenuIcon(): string {
41
45
*
42
46
* @see DokuWiki_Admin_Plugin::handle()
43
47
*/
44
- public function handle (): void {
45
- if (isset ($ _REQUEST ['purgeindex ' ])) {
48
+ public function handle (): void
49
+ {
50
+ if (isset ($ _REQUEST ['purgeindex ' ])) {
46
51
global $ conf ;
47
52
$ path = $ conf ['indexdir ' ] . '/spatial.idx ' ;
48
- if (file_exists ($ path ) && unlink ($ path )) {
53
+ if (file_exists ($ path ) && unlink ($ path )) {
49
54
msg ($ this ->getLang ('admin_purged_tiles ' ), 0 );
50
55
}
51
56
}
@@ -63,22 +68,21 @@ public function handle(): void {
63
68
*
64
69
* @see DokuWiki_Admin_Plugin::html()
65
70
*/
66
- public function html (): void {
71
+ public function html (): void
72
+ {
67
73
echo $ this ->locale_xhtml ('admin_purge_intro ' );
68
74
69
75
$ form = new Doku_Form (
70
- array (
71
- 'id ' => 'spatialhelper__purgeform ' ,
72
- 'method ' => 'post '
73
- )
76
+ ['id ' => 'spatialhelper__purgeform ' , 'method ' => 'post ' ]
74
77
);
75
78
$ form ->addHidden ('purgeindex ' , 'true ' );
76
79
77
80
$ form ->addElement (
78
81
form_makeButton (
79
- 'submit ' , 'admin ' , $ this ->getLang ('admin_submit ' ), array (
80
- 'title ' => $ this ->getLang ('admin_submit ' )
81
- )
82
+ 'submit ' ,
83
+ 'admin ' ,
84
+ $ this ->getLang ('admin_submit ' ),
85
+ ['title ' => $ this ->getLang ('admin_submit ' )]
82
86
)
83
87
);
84
88
$ form ->printForm ();
0 commit comments