Skip to content

Commit 22d86a4

Browse files
committed
renaming, reformatting
1 parent c9a58ac commit 22d86a4

File tree

5 files changed

+30
-28
lines changed

5 files changed

+30
-28
lines changed

helper/repository.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class helper_plugin_pluginrepo_repository extends Plugin
1414
{
15-
public array $dokuReleases = []; // array of DokuWiki releases (name & date)
15+
private array $dokuReleases = []; // array of DokuWiki releases (name & date)
1616

1717
public array $types = [
1818
1 => 'Syntax',
@@ -292,15 +292,15 @@ public function getPlugins($filter = null)
292292
$sortsql = $this->getPluginsSortSql($sort);
293293

294294
$alltypes = 0;
295-
foreach (array_keys($this->types) as $t) {
296-
$alltypes += $t;
295+
foreach (array_keys($this->types) as $number) {
296+
$alltypes += $number;
297297
}
298298

299299
if ($tag) {
300300
if ($type < 1 || $type > $alltypes) {
301301
$type = $alltypes; //all types
302302
}
303-
$sql = "SELECT A.*, SUBSTR(A.plugin,10) as simplename
303+
$sql = " SELECT A.*, SUBSTR(A.plugin,10) as simplename
304304
FROM plugins A
305305
WHERE A.type = 32 AND $where_filtered
306306
AND (A.type & :plugin_type)
@@ -317,7 +317,7 @@ public function getPlugins($filter = null)
317317
$values
318318
);
319319
} 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
321321
FROM plugins A
322322
WHERE A.type = 32 AND $where_filtered
323323
AND (A.type & :plugin_type)
@@ -427,8 +427,8 @@ public function getFilteredPlugins(
427427

428428
// default to all extensions
429429
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;
432432
}
433433
}
434434

@@ -1025,11 +1025,11 @@ public function parsetags($string)
10251025
public function listtype($type, $target, $sep = ', ')
10261026
{
10271027
$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
10331033
. '</a>';
10341034
}
10351035
}
@@ -1046,9 +1046,9 @@ public function listtype($type, $target, $sep = ', ')
10461046
public function listtypes($type)
10471047
{
10481048
$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;
10521052
}
10531053
}
10541054
sort($types);
@@ -1064,9 +1064,9 @@ public function listtypes($type)
10641064
public function parsetype($types)
10651065
{
10661066
$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;
10701070
}
10711071
}
10721072
if ($type === 0 && $types === '') {

repository.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ function getRepository()
7373
$feed .= '<type>';
7474
if ($plugin['type']) {
7575
$types = [];
76-
foreach ($hlp->types as $k => $v) {
77-
if ($plugin['type'] & $k) {
78-
$types[] = $v;
76+
foreach ($hlp->types as $number => $label) {
77+
if ($plugin['type'] & $number) {
78+
$types[] = $label;
7979
}
8080
}
8181
sort($types);

syntax/news.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ public function showDefault($R, $data)
211211

212212
$url = $row['screenshot'];
213213
if ($url && $data['showscreenshot']) {
214-
$R->doc .= '<a href="' . ml($url) . '" class="media screenshot" rel="lightbox">';
215-
$R->doc .= '<img src="' . ml($url, "w=200") . '" alt="" width="200" /></a>';
214+
$R->doc .= '<a href="' . ml($url) . '" class="media screenshot" rel="lightbox">'
215+
. '<img src="' . ml($url, "w=200") . '" alt="" width="200" />'
216+
. '</a>';
216217
}
217218

218219
$R->doc .= '<p class="author">Author: ';

syntax/query.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ public function render($format, Doku_Renderer $renderer, $data)
250250
$renderer->doc .= '<td>';
251251

252252
if ($field == 'type') {
253-
foreach ($this->hlp->types as $k => $v) {
254-
if ($row['type'] & $k) {
255-
$renderer->doc .= $v . ' ';
253+
foreach ($this->hlp->types as $number => $label) {
254+
if ($row['type'] & $number) {
255+
$renderer->doc .= $label . ' ';
256256
}
257257
}
258258
} elseif ($field == 'plugin') {

syntax/table.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function showMainSearch($R)
170170
<p>
171171
$intro
172172
</p>
173-
<form action="{$url}" accept-charset="utf-8" class="plugin-search" id="dw__search2" method="get">
173+
<form action="$url" accept-charset="utf-8" class="plugin-search" id="dw__search2" method="get">
174174
<div class="no">
175175
<input type="hidden" name="do" value="search" />
176176
<input type="hidden" id="dw__ns" name="ns" value="$searchNS" />
@@ -258,9 +258,10 @@ public function tagcloud($R, $data)
258258
$tagData = $this->hlp->getTags($data['cloudmin'], $data);
259259
// $tagData will be sorted by cnt (descending)
260260
foreach ($tagData as $tag) {
261+
// obsolete plugins are not included in the table
261262
if ($tag['tag'] == $this->hlp->obsoleteTag) {
262263
continue;
263-
} // obsolete plugins are not included in the table
264+
}
264265
$tags[$tag['tag']] = $tag['cnt'];
265266
if (!$max) {
266267
$max = $tag['cnt'];

0 commit comments

Comments
 (0)