Skip to content

Commit 2c63df8

Browse files
committed
Merge branch 'master' into dev/4.0
2 parents 0a92379 + a90fa74 commit 2c63df8

File tree

8 files changed

+28
-24
lines changed

8 files changed

+28
-24
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ This is the repository for the development of the Topic Prefixes phpBB extension
44

55
[![Build Status](https://github.com/phpbb-extensions/topicprefixes/actions/workflows/tests.yml/badge.svg)](https://github.com/phpbb-extensions/topicprefixes/actions)
66
[![codecov](https://codecov.io/gh/phpbb-extensions/topicprefixes/branch/master/graph/badge.svg?token=Dc0GWOeQWj)](https://codecov.io/gh/phpbb-extensions/topicprefixes)
7-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpbb-extensions/topicprefixes/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpbb-extensions/topicprefixes/?branch=master)
87

98
The phpBB Topic Prefixes extension allows phpBB board administrators to create topic prefix tags that users can easily add to their topic titles. Features include:
109

adm/style/acp_topic_prefixes.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.tp-toggle-on,
2+
.tp-toggle-off {
3+
font-weight: 900;
4+
}
5+
6+
.tp-toggle-on:before {
7+
content: "\f205";
8+
}
9+
10+
.tp-toggle-off:before {
11+
content: "\f204";
12+
}

adm/style/acp_topic_prefixes.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ <h1>{{ lang('TOPIC_PREFIXES') }}</h1>
3434
<td><strong>{{ prefix.PREFIX_TAG }}</strong></td>
3535
<td>
3636
<a href="{{ prefix.U_EDIT }}" style="text-decoration: none" title="{{ lang('TOPIC_PREFIX_TOGGLE_STATE') }}" data-ajax="tp_toggle">
37-
{{ Icon('font', {
38-
'toggle-on': prefix.PREFIX_ENABLED,
39-
'toggle-off': true
40-
}, '', true, 'fas acp-icon') }}
37+
<i class="fa fa-fw tp-toggle-{{ prefix.PREFIX_ENABLED ? 'on' : 'off' }} acp-icon"></i>
4138
</a>
4239
</td>
4340
<td class="actions">
@@ -71,4 +68,5 @@ <h1>{{ lang('TOPIC_PREFIXES') }}</h1>
7168
{% endif %}
7269

7370
{% INCLUDEJS '@phpbb_topicprefixes/acp_topic_prefixes.js' %}
71+
{% INCLUDECSS '@phpbb_topicprefixes/acp_topic_prefixes.css' %}
7472
{% include 'overall_footer.html' %}

adm/style/acp_topic_prefixes.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
(function($) {
2-
1+
(function() {
32
'use strict';
43

5-
$('#select_forum').on('change', function() {
6-
$(this).closest('form').trigger('submit');
4+
document.getElementById('select_forum').addEventListener('change', function() {
5+
this.closest('form').submit();
76
});
87

98
phpbb.addAjaxCallback('tp_toggle', function(res) {
@@ -12,8 +11,7 @@
1211
}
1312

1413
const icon = this.querySelector('i');
15-
icon.classList.toggle('fa-toggle-on');
16-
icon.classList.toggle('fa-toggle-off');
14+
icon.classList.toggle('tp-toggle-on');
15+
icon.classList.toggle('tp-toggle-off');
1716
});
18-
19-
})(jQuery);
17+
})();

composer.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "phpbb-extension",
44
"description": "An official phpBB extension for topic prefixes.",
55
"homepage": "https://www.phpbb.com/customise/db/extension/topicprefixes/",
6-
"version": "1.1.0-dev",
6+
"version": "1.0.2-dev",
77
"license": "GPL-2.0-only",
88
"authors": [
99
{
@@ -18,7 +18,7 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">=8.1",
21+
"php": ">=5.4",
2222
"composer/installers": "^1.0 || ^2.0"
2323
},
2424
"require-dev": {
@@ -27,16 +27,13 @@
2727
"extra": {
2828
"display-name": "phpBB Topic Prefixes",
2929
"soft-require": {
30-
"phpbb/phpbb": ">=4.0.0@dev"
30+
"phpbb/phpbb": ">=3.2.0"
3131
},
3232
"version-check": {
3333
"host": "www.phpbb.com",
3434
"directory": "/customise/db/extension/topicprefixes",
3535
"filename": "version_check",
3636
"ssl": true
37-
},
38-
"branch-alias": {
39-
"dev-develop": "1.1.x-dev"
4037
}
4138
}
4239
}

controller/admin_controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ protected function get_forum_info($forum_id)
340340
* @param bool $content The content of the JSON response (true|false)
341341
* @access protected
342342
*/
343-
protected function send_json_response(bool $content): void
343+
protected function send_json_response($content)
344344
{
345345
$json_response = new json_response;
346346
$json_response->send([

ext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ class ext extends \phpbb\extension\base
2525
* The current phpBB version should meet or exceed
2626
* the minimum version required by this extension:
2727
*
28-
* Requires phpBB 4.0.0 and PHP 8.1
28+
* Requires phpBB 3.2.0 and PHP 5.4
2929
*
3030
* @return bool
3131
*/
3232
public function is_enableable()
3333
{
34-
return PHP_VERSION_ID >= 80100 && phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '>=');
34+
return phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=') && PHP_VERSION_ID >= 50400;
3535
}
3636
}

tests/functional/functional_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ public function test_acp_disable_prefix()
7979

8080
// Disable the prefix
8181
$crawler = self::request('GET', 'adm/index.php?i=\phpbb\topicprefixes\acp\topic_prefixes_module&mode=manage&action=edit&forum_id=' . self::FORUM_ID . "&prefix_id={$prefix}&hash={$hash}&sid={$this->sid}");
82-
self::assertCount(1, $crawler->filter('tr')->eq(2)->filter('.fa-toggle-off'));
82+
self::assertCount(1, $crawler->filter('tr')->eq(2)->filter('.tp-toggle-off'));
8383

8484
// Enable the prefix
8585
$crawler = self::request('GET', 'adm/index.php?i=\phpbb\topicprefixes\acp\topic_prefixes_module&mode=manage&action=edit&forum_id=' . self::FORUM_ID . "&prefix_id={$prefix}&hash={$hash}&sid={$this->sid}");
86-
self::assertCount(1, $crawler->filter('tr')->eq(2)->filter('.fa-toggle-on'));
86+
self::assertCount(1, $crawler->filter('tr')->eq(2)->filter('.tp-toggle-on'));
8787
}
8888

8989
public function test_acp_delete_prefix()

0 commit comments

Comments
 (0)