12
12
*/
13
13
class helper_plugin_pluginrepo_repository extends Plugin
14
14
{
15
- public array $ dokuReleases = []; // array of DokuWiki releases (name & date)
15
+ private array $ dokuReleases = []; // array of DokuWiki releases (name & date)
16
16
17
17
public array $ types = [
18
18
1 => 'Syntax ' ,
@@ -292,15 +292,15 @@ public function getPlugins($filter = null)
292
292
$ sortsql = $ this ->getPluginsSortSql ($ sort );
293
293
294
294
$ alltypes = 0 ;
295
- foreach (array_keys ($ this ->types ) as $ t ) {
296
- $ alltypes += $ t ;
295
+ foreach (array_keys ($ this ->types ) as $ number ) {
296
+ $ alltypes += $ number ;
297
297
}
298
298
299
299
if ($ tag ) {
300
300
if ($ type < 1 || $ type > $ alltypes ) {
301
301
$ type = $ alltypes ; //all types
302
302
}
303
- $ sql = "SELECT A.*, SUBSTR(A.plugin,10) as simplename
303
+ $ sql = " SELECT A.*, SUBSTR(A.plugin,10) as simplename
304
304
FROM plugins A
305
305
WHERE A.type = 32 AND $ where_filtered
306
306
AND (A.type & :plugin_type)
@@ -317,7 +317,7 @@ public function getPlugins($filter = null)
317
317
$ values
318
318
);
319
319
} elseif ($ type > 0 && $ type <= $ alltypes ) {
320
- $ sql = "SELECT A.*, SUBSTR(A.plugin,10) as simplename
320
+ $ sql = " SELECT A.*, SUBSTR(A.plugin,10) as simplename
321
321
FROM plugins A
322
322
WHERE A.type = 32 AND $ where_filtered
323
323
AND (A.type & :plugin_type)
@@ -427,8 +427,8 @@ public function getFilteredPlugins(
427
427
428
428
// default to all extensions
429
429
if ($ type == 0 ) {
430
- foreach (array_keys ($ this ->types ) as $ t ) {
431
- $ type += $ t ;
430
+ foreach (array_keys ($ this ->types ) as $ number ) {
431
+ $ type += $ number ;
432
432
}
433
433
}
434
434
@@ -1025,11 +1025,11 @@ public function parsetags($string)
1025
1025
public function listtype ($ type , $ target , $ sep = ', ' )
1026
1026
{
1027
1027
$ types = [];
1028
- foreach ($ this ->types as $ k => $ v ) {
1029
- if ($ type & $ k ) {
1030
- $ url = wl ($ target , ['plugintype ' => $ k ]) . '#extension__table ' ;
1031
- $ types [] = '<a href=" ' . $ url . '" class="wikilink1" title="List all ' . $ v . ' plugins"> '
1032
- . $ v
1028
+ foreach ($ this ->types as $ number => $ label ) {
1029
+ if ($ type & $ number ) {
1030
+ $ url = wl ($ target , ['plugintype ' => $ number ]) . '#extension__table ' ;
1031
+ $ types [] = '<a href=" ' . $ url . '" class="wikilink1" title="List all ' . $ label . ' plugins"> '
1032
+ . $ label
1033
1033
. '</a> ' ;
1034
1034
}
1035
1035
}
@@ -1046,9 +1046,9 @@ public function listtype($type, $target, $sep = ', ')
1046
1046
public function listtypes ($ type )
1047
1047
{
1048
1048
$ types = [];
1049
- foreach ($ this ->types as $ k => $ v ) {
1050
- if ($ type & $ k ) {
1051
- $ types [] = $ v ;
1049
+ foreach ($ this ->types as $ number => $ label ) {
1050
+ if ($ type & $ number ) {
1051
+ $ types [] = $ label ;
1052
1052
}
1053
1053
}
1054
1054
sort ($ types );
@@ -1064,9 +1064,9 @@ public function listtypes($type)
1064
1064
public function parsetype ($ types )
1065
1065
{
1066
1066
$ type = 0 ;
1067
- foreach ($ this ->types as $ k => $ v ) {
1068
- if (preg_match ('# ' . preg_quote ($ v ) . '#i ' , $ types )) {
1069
- $ type += $ k ;
1067
+ foreach ($ this ->types as $ number => $ label ) {
1068
+ if (preg_match ('# ' . preg_quote ($ label ) . '#i ' , $ types )) {
1069
+ $ type += $ number ;
1070
1070
}
1071
1071
}
1072
1072
if ($ type === 0 && $ types === '' ) {
0 commit comments