Skip to content

Commit

Permalink
Merge pull request #182 from HanashiDev/next
Browse files Browse the repository at this point in the history
WSC 6.1: Version 2.7.0
  • Loading branch information
Hanashi authored Aug 31, 2024
2 parents 8563e0f + 3af0f36 commit ad9d29d
Show file tree
Hide file tree
Showing 76 changed files with 1,606 additions and 585 deletions.
1 change: 1 addition & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
php:
- '8.1'
- '8.2'
- '8.3'
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
Expand Down
31 changes: 7 additions & 24 deletions acpMenu.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/2019/acpMenu.xsd">
<import>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord">
<parent>wcf.acp.menu.link.configuration</parent>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.management.discord">
<parent>wcf.acp.menu.link.management</parent>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord.discordBotList">
<controller>wcf\acp\page\DiscordBotListPage</controller>
<parent>wcf.acp.menu.link.configuration.discord</parent>
<permissions>admin.discord.canManageConnection</permissions>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord.discordBotList.add">
<controller>wcf\acp\form\DiscordBotAddManagerForm</controller>
<parent>wcf.acp.menu.link.configuration.discord.discordBotList</parent>
<permissions>admin.discord.canManageConnection</permissions>
<icon>plus</icon>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord.discordWebhookList">
<controller>wcf\acp\page\DiscordWebhookListPage</controller>
<parent>wcf.acp.menu.link.configuration.discord</parent>
<permissions>admin.discord.canManageWebhooks</permissions>
</acpmenuitem>
</import>
<delete>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord.discordWebhookList"/>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord.discordBotList.add"/>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord.discordBotList"/>
<acpmenuitem name="wcf.acp.menu.link.management.discord"/>
<acpmenuitem name="wcf.acp.menu.link.configuration.discord"/>
</delete>
</data>
6 changes: 6 additions & 0 deletions acpTemplateDelete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/6.0/acpTemplateDelete.xsd">
<delete>
<template>__discordSecretFormField</template>
</delete>
</data>
13 changes: 0 additions & 13 deletions acptemplates/__discordSecretFormField.tpl

This file was deleted.

2 changes: 1 addition & 1 deletion acptemplates/discordBotAdd.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</nav>
</header>

{@$form->getHtml()}
{unsafe:$form->getHtml()}

{include file='footer'}
19 changes: 15 additions & 4 deletions acptemplates/discordBotAddManager.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,26 @@

{lang}wcf.acp.discordBotAddManager.step6Intro{/lang}<br><br>

{if $discordSyncInstalled}
{lang}wcf.acp.discordBotAddManager.step6DiscordSync{/lang}<br><br>
{/if}
{event name='outro'}

{lang}wcf.acp.discordBotAddManager.step6Outro{/lang}
{/if}
</div>

{if $step == 1}
{if $neededIntents|count}
<p class="warning">
{lang}wcf.acp.discordBotAddManager.gatewaysNeeded{/lang} {', '|implode:$neededIntents}
</p>
{else}
<p class="info">{lang}wcf.acp.discordBotAddManager.noGatewaysNeeded{/lang}</p>
{/if}
{/if}

{event name='message'}

{if $step != 6 && $step != 0}
{@$form->getHtml()}
{unsafe:$form->getHtml()}
{/if}
{if $step == 0}
<div class="formSubmit">
Expand Down
12 changes: 6 additions & 6 deletions acptemplates/discordBotList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<thead>
<tr>
<th class="columnIcon"></th>
<th class="columnID columnBotID{if $sortField == 'botID'} active {@$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={@$pageNo}&sortField=botID&sortOrder={if $sortField == 'botID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
<th class="columnTitle columnBotName{if $sortField == 'botName'} active {@$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={@$pageNo}&sortField=botName&sortOrder={if $sortField == 'botName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.discordBotList.botName{/lang}</a></th>
<th class="columnText columnGuildName{if $sortField == 'guildName'} active {@$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={@$pageNo}&sortField=guildName&sortOrder={if $sortField == 'guildName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.discordBotList.server{/lang}</a></th>
<th class="columnDate columnBotTime{if $sortField == 'botTime'} active {@$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={@$pageNo}&sortField=botTime&sortOrder={if $sortField == 'botTime' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.date{/lang}</a></th>
<th class="columnID columnBotID{if $sortField == 'botID'} active {$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={$pageNo}&sortField=botID&sortOrder={if $sortField == 'botID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
<th class="columnTitle columnBotName{if $sortField == 'botName'} active {$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={$pageNo}&sortField=botName&sortOrder={if $sortField == 'botName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.discordBotList.botName{/lang}</a></th>
<th class="columnText columnGuildName{if $sortField == 'guildName'} active {$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={$pageNo}&sortField=guildName&sortOrder={if $sortField == 'guildName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.discordBotList.server{/lang}</a></th>
<th class="columnDate columnBotTime{if $sortField == 'botTime'} active {$sortOrder}{/if}"><a href="{link controller='DiscordBotList'}pageNo={$pageNo}&sortField=botTime&sortOrder={if $sortField == 'botTime' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.date{/lang}</a></th>

{event name='columns'}
</tr>
Expand Down Expand Up @@ -58,7 +58,7 @@
{$discordBot->guildName}
</td>
<td class="columnDate">
{@$discordBot->botTime|time}
{time time=$discordBot->botTime}
</td>

{event name='columnsItem'}
Expand All @@ -71,7 +71,7 @@
<footer class="contentFooter">
{hascontent}
<div class="paginationBottom">
{content}{@$pagesLinks}{/content}
{content}{unsafe:$pagesLinks}{/content}
</div>
{/hascontent}

Expand Down
22 changes: 10 additions & 12 deletions acptemplates/discordBotMultiSelectOptionType.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@
<ul class="scrollableCheckboxList" id="{$optionName}" style="height: 200px;">
{foreach from=$discordBotList item=discordBot}
<li>
<label><input type="checkbox" name="values[{$optionName}][]" value="{@$discordBot->botID}"{if $discordBot->botID|in_array:$value} checked{/if}> {$discordBot->botName} ({lang}wcf.acp.discordBotList.server{/lang}: {$discordBot->guildName})</label>
<label><input type="checkbox" name="values[{$optionName}][]" value="{$discordBot->botID}"{if $discordBot->botID|in_array:$value} checked{/if}> {$discordBot->botName} ({lang}wcf.acp.discordBotList.server{/lang}: {$discordBot->guildName})</label>
</li>
{/foreach}
</ul>

<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
Language.addObject({
'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
});
require(['WoltLabSuite/Core/Ui/ItemList/Filter'], function(UiItemListFilter) {
{jsphrase name='wcf.global.filter.button.visibility'}
{jsphrase name='wcf.global.filter.button.clear'}
{jsphrase name='wcf.global.filter.error.noMatches'}
{jsphrase name='wcf.global.filter.placeholder'}
{jsphrase name='wcf.global.filter.visibility.activeOnly'}
{jsphrase name='wcf.global.filter.visibility.highlightActive'}
{jsphrase name='wcf.global.filter.visibility.showAll'}
new UiItemListFilter('{$optionName|encodeJS}');
new UiItemListFilter('{unsafe:$optionName|encodeJS}');
});
</script>
{else}
Expand Down
2 changes: 1 addition & 1 deletion acptemplates/discordBotSelectOptionType.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<select id="{$option->optionName}" name="values[{$option->optionName}]">
<option></option>
{foreach from=$discordBotList item=discordBot}
<option value="{@$discordBot->botID}"{if $discordBot->botID == $value} selected{/if}>
<option value="{$discordBot->botID}"{if $discordBot->botID == $value} selected{/if}>
{$discordBot->botName} (Server: {$discordBot->guildName})
</option>
{/foreach}
Expand Down
40 changes: 17 additions & 23 deletions acptemplates/discordChannelMultiSelect.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,20 @@
</div>
<script data-relocate="true">
require(['WoltLabSuite/Core/Ui/ItemList/Filter'], function(UiItemListFilter) {
new UiItemListFilter('{$optionName|encodeJS}_{$bot['botID']|encodeJS}');
new UiItemListFilter('{unsafe:$optionName|encodeJS}_{unsafe:$bot['botID']|encodeJS}');
});
</script>
{/foreach}
</div>
</div>
<script data-relocate="true">
require(['Language'], function(Language) {
Language.addObject({
'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
});
});
{jsphrase name='wcf.global.filter.button.visibility'}
{jsphrase name='wcf.global.filter.button.clear'}
{jsphrase name='wcf.global.filter.error.noMatches'}
{jsphrase name='wcf.global.filter.placeholder'}
{jsphrase name='wcf.global.filter.visibility.activeOnly'}
{jsphrase name='wcf.global.filter.visibility.highlightActive'}
{jsphrase name='wcf.global.filter.visibility.showAll'}
</script>
{else if $bots|count == 1}
<ul class="scrollableCheckboxList" id="{$optionName}" style="height: 200px;">
Expand All @@ -61,18 +57,16 @@
</ul>

<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
Language.addObject({
'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
});
require(['WoltLabSuite/Core/Ui/ItemList/Filter'], function(UiItemListFilter) {
{jsphrase name='wcf.global.filter.button.visibility'}
{jsphrase name='wcf.global.filter.button.clear'}
{jsphrase name='wcf.global.filter.error.noMatches'}
{jsphrase name='wcf.global.filter.placeholder'}
{jsphrase name='wcf.global.filter.visibility.activeOnly'}
{jsphrase name='wcf.global.filter.visibility.highlightActive'}
{jsphrase name='wcf.global.filter.visibility.showAll'}
new UiItemListFilter('{$optionName|encodeJS}');
new UiItemListFilter('{unsafe:$optionName|encodeJS}');
});
</script>
{else}
Expand Down
40 changes: 17 additions & 23 deletions acptemplates/discordChannelSelectOptionType.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,20 @@
</div>
<script data-relocate="true">
require(['WoltLabSuite/Core/Ui/ItemList/Filter'], function(UiItemListFilter) {
new UiItemListFilter('{$optionName|encodeJS}_{$bot['botID']|encodeJS}');
new UiItemListFilter('{unsafe:$optionName|encodeJS}_{unsafe:$bot['botID']|encodeJS}');
});
</script>
{/foreach}
</div>
</div>
<script data-relocate="true">
require(['Language'], function(Language) {
Language.addObject({
'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
});
});
{jsphrase name='wcf.global.filter.button.visibility'}
{jsphrase name='wcf.global.filter.button.clear'}
{jsphrase name='wcf.global.filter.error.noMatches'}
{jsphrase name='wcf.global.filter.placeholder'}
{jsphrase name='wcf.global.filter.visibility.activeOnly'}
{jsphrase name='wcf.global.filter.visibility.highlightActive'}
{jsphrase name='wcf.global.filter.visibility.showAll'}
</script>
{else if $bots|count == 1}
<ul class="scrollableCheckboxList" id="{$optionName}" style="height: 200px;">
Expand All @@ -61,18 +57,16 @@
</ul>

<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
Language.addObject({
'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
});
require(['WoltLabSuite/Core/Ui/ItemList/Filter'], function(UiItemListFilter) {
{jsphrase name='wcf.global.filter.button.visibility'}
{jsphrase name='wcf.global.filter.button.clear'}
{jsphrase name='wcf.global.filter.error.noMatches'}
{jsphrase name='wcf.global.filter.placeholder'}
{jsphrase name='wcf.global.filter.visibility.activeOnly'}
{jsphrase name='wcf.global.filter.visibility.highlightActive'}
{jsphrase name='wcf.global.filter.visibility.showAll'}
new UiItemListFilter('{$optionName|encodeJS}');
new UiItemListFilter('{unsafe:$optionName|encodeJS}');
});
</script>
{else}
Expand Down
26 changes: 11 additions & 15 deletions acptemplates/discordEmbedColorOptionType.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
</div>

<script data-relocate="true">
require(['WoltLabSuite/Core/Ui/Color/Picker', 'Language'], function(UiColorPicker, Language) {
Language.addObject({
'wcf.style.colorPicker': '{jslang}wcf.style.colorPicker{/jslang}',
'wcf.style.colorPicker.new': '{jslang}wcf.style.colorPicker.new{/jslang}',
'wcf.style.colorPicker.current': '{jslang}wcf.style.colorPicker.current{/jslang}',
'wcf.style.colorPicker.button.apply': '{jslang}wcf.style.colorPicker.button.apply{/jslang}',
'wcf.style.colorPicker.hue': '{jslang}wcf.style.colorPicker.hue{/jslang}',
'wcf.style.colorPicker.saturation': '{jslang}wcf.style.colorPicker.saturation{/jslang}',
'wcf.style.colorPicker.lightness': '{jslang}wcf.style.colorPicker.lightness{/jslang}',
'wcf.style.colorPicker.color': '{jslang}wcf.style.colorPicker.color{/jslang}',
'wcf.style.colorPicker.hexAlpha': '{jslang}wcf.style.colorPicker.hexAlpha{/jslang}',
'wcf.style.colorPicker.error.invalidColor': '{jslang}wcf.style.colorPicker.error.invalidColor{/jslang}'
});
require(['WoltLabSuite/Core/Ui/Color/Picker'], function(UiColorPicker) {
{jsphrase name='wcf.style.colorPicker'}
{jsphrase name='wcf.style.colorPicker.new'}
{jsphrase name='wcf.style.colorPicker.current'}
{jsphrase name='wcf.style.colorPicker.button.apply'}
{jsphrase name='wcf.style.colorPicker.hue'}
{jsphrase name='wcf.style.colorPicker.saturation'}
{jsphrase name='wcf.style.colorPicker.lightness'}
{jsphrase name='wcf.style.colorPicker.color'}
{jsphrase name='wcf.style.colorPicker.hexAlpha'}
{jsphrase name='wcf.style.colorPicker.error.invalidColor'}
UiColorPicker.fromSelector('.jsDiscordColorPicker{$optionName}');
});
Expand Down
Loading

0 comments on commit ad9d29d

Please sign in to comment.