Skip to content

Commit 02ef454

Browse files
committed
b8
1 parent 412e790 commit 02ef454

10 files changed

Lines changed: 60 additions & 8 deletions

File tree

docs/version_check.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"stable": {
3+
"1.0": {
4+
"current": "1.0.0",
5+
"announcement": "https://github.com/LukeWCS/stats-permissions/releases/tag/1.0.0",
6+
"download": "https://github.com/LukeWCS/stats-permissions/releases/download/1.0.0/lukewcs_statspermissions_1.0.0.zip",
7+
"eol": null,
8+
"security": false
9+
}
10+
}
11+
}

lukewcs/statspermissions/composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "phpbb-extension",
44
"description": "Allows to define independent permissions for viewing statistics and newest member.",
55
"homepage": "https://github.com/LukeWCS/stats-permissions",
6-
"version": "1.0.0-rc1",
7-
"time": "2022-02-28",
6+
"version": "1.0.0",
7+
"time": "2022-03-26",
88
"license": "GPL-2.0-only",
99
"authors": [
1010
{
@@ -20,9 +20,15 @@
2020
},
2121
"extra": {
2222
"display-name": "Stats Permissions",
23-
"lang-min-ver": "1.0.0-rc1",
23+
"lang-min-ver": "1.0.0",
2424
"soft-require": {
2525
"phpbb/phpbb": ">=3.2.10,<3.4.0@dev"
26+
},
27+
"version-check": {
28+
"host": "lukewcs.github.io",
29+
"directory": "/stats-permissions",
30+
"filename": "version_check.json",
31+
"ssl": true
2632
}
2733
}
2834
}

lukewcs/statspermissions/config/services.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ services:
1212
- '@template'
1313
- '@auth'
1414
- '@user'
15+
- '@dispatcher'
16+
1517
- '@language'

lukewcs/statspermissions/core/stats_permissions.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,34 @@ public function __construct(
2828
\phpbb\template\template $template,
2929
\phpbb\auth\auth $auth,
3030
\phpbb\user $user,
31+
\phpbb\event\dispatcher_interface $dispatcher,
3132
$language
3233
)
3334
{
3435
$this->config = $config;
3536
$this->template = $template;
3637
$this->auth = $auth;
3738
$this->user = $user;
39+
$this->phpbb_dispatcher = $dispatcher;
3840
$this->language = $language;
3941
}
4042

4143
public function set_template_vars()
4244
{
45+
$force_api_mode = false;
46+
47+
/**
48+
* Overriding the variables that regulate the conditions for the Stats Permissions display.
49+
*
50+
* @event lukewcs.statspermissions.display_condition
51+
* @var bool force_api_mode Forces the API mode so that Stats Permissions is not displayed, but only the template variables are generated.
52+
* @since 1.0.0
53+
*/
54+
$vars = ['force_api_mode'];
55+
extract($this->phpbb_dispatcher->trigger_event('lukewcs.statspermissions.display_condition', compact($vars)));
56+
57+
$force_api_mode = ($force_api_mode === true);
58+
4359
// Set display permission variables
4460
if ($this->config['stats_permissions_admin_mode'])
4561
{
@@ -90,6 +106,7 @@ public function set_template_vars()
90106
'NEWEST_USER' => false,
91107
'STATSPERM_STATS' => $permission_stats,
92108
'STATSPERM_NEWEST' => $permission_newest,
109+
'STATSPERM_API_MODE' => $force_api_mode,
93110
]);
94111
}
95112

lukewcs/statspermissions/language/de/acp_stats_permissions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$lang = array_merge($lang, [
4040
// language pack author
4141
'STATS_PERMISSIONS_LANG_DESC' => 'Deutsch (Du)',
42-
'STATS_PERMISSIONS_LANG_EXT_VER' => '1.0.0-rc1',
42+
'STATS_PERMISSIONS_LANG_EXT_VER' => '1.0.0',
4343
'STATS_PERMISSIONS_LANG_AUTHOR' => 'LukeWCS',
4444

4545
// config head

lukewcs/statspermissions/language/de_x_sie/acp_stats_permissions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$lang = array_merge($lang, [
4040
// language pack author
4141
'STATS_PERMISSIONS_LANG_DESC' => 'Deutsch (Sie)',
42-
'STATS_PERMISSIONS_LANG_EXT_VER' => '1.0.0-rc1',
42+
'STATS_PERMISSIONS_LANG_EXT_VER' => '1.0.0',
4343
'STATS_PERMISSIONS_LANG_AUTHOR' => 'LukeWCS',
4444

4545
// config head

lukewcs/statspermissions/language/en/acp_stats_permissions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$lang = array_merge($lang, [
4040
// language pack author
4141
'STATS_PERMISSIONS_LANG_DESC' => 'English',
42-
'STATS_PERMISSIONS_LANG_EXT_VER' => '1.0.0-rc1',
42+
'STATS_PERMISSIONS_LANG_EXT_VER' => '1.0.0',
4343
'STATS_PERMISSIONS_LANG_AUTHOR' => 'LukeWCS',
4444

4545
// config head

lukewcs/statspermissions/styles/prosilver/template/event/index_body_stat_blocks_after.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{% if STATSPERM_STATS || STATSPERM_NEWEST %}
2-
<div class="stat-block statistics">
1+
{% if (STATSPERM_STATS || STATSPERM_NEWEST) && !STATSPERM_API_MODE %}
2+
<div class="stat-block statsperm-statistics">
33
<h3>{{ lang('STATISTICS') }}</h3>
44
<p>
55
{% EVENT index_body_block_stats_prepend %}

stats-permissions_build_changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#### Builds 1.0.0
22

3+
* b8 (Release):
4+
* API-Modus eingebaut.
5+
* Event `lukewcs.statspermissions.display_condition` eingebaut.
6+
* Versionsprüfung hinzugefügt.
7+
* GitHub: GitHub Pages eingerichtet für Versionsprüfung.
38
* b7 (RC1):
49
* `composer.json` aktualisiert.
510
* Kleinere Änderungen in den Sprachdateien.

stats-permissions_changelog_de.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
#### 1.0.0 Release
2+
3+
(2022-03-26)
4+
5+
* Den API-Modus von LFWWH übernommen, damit andere Entwickler die Anzeige des Templates deaktivieren können. Dieser Modus kann momentan nur per PHP Event getriggert werden, die ACP Einstellung dafür kommt später.
6+
* Das PHP Event `lukewcs.statspermissions.display_condition` eingebaut, mit dem bestimmte Variablen übersteuert werden können um das Verhalten von StatsPerm zu ändern. Hilfreich für Bridge-Entwickler. Die folgenden Event-Variablen werden erstmalig unterstützt:
7+
* force_api_mode: Erzwingt den API-Modus damit StatsPerm nicht angezeigt wird, sondern lediglich die Template Variablen erzeugt werden.
8+
* Versionsprüfung hinzugefügt.
9+
110
#### 1.0.0-rc1 Release
211

12+
(2022-02-28)
13+
314
* Erste öffentliche Version.
415
* Komplette Überarbeitung und Anpassung an die aktuellen Richtlinien.
516
* Vorhandene Funktionen und Eigenschaften die von LFWWH 2.0.0 bereits 2019 und 2020 übernommen wurden auf den neuesten Stand gebracht, primär das Rechtesystem.

0 commit comments

Comments
 (0)