Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.woltlab.wcf/fileDelete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
<file>lib/system/upload/AvatarUploadFileValidationStrategy.class.php</file>
<file>lib/system/upload/UserCoverPhotoUploadFileSaveStrategy.class.php</file>
<file>lib/system/upload/UserCoverPhotoUploadFileValidationStrategy.class.php</file>
<file>lib/system/upload/TrophyImageUploadFileValidationStrategy.class.php</file>
</delete>
</data>
5 changes: 5 additions & 0 deletions com.woltlab.wcf/objectType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,11 @@
<definitionname>com.woltlab.wcf.file</definitionname>
<classname>wcf\system\file\processor\UnfurlUrlImageFileProcessor</classname>
</type>
<type>
<name>com.woltlab.wcf.trophy</name>
<definitionname>com.woltlab.wcf.file</definitionname>
<classname>wcf\system\file\processor\TrophyFileProcessor</classname>
</type>
<!-- deprecated -->
<type>
<name>com.woltlab.wcf.page.controller</name>
Expand Down
1 change: 1 addition & 0 deletions com.woltlab.wcf/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
<instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_6.3_step1.php</instruction>
<instruction type="script">acp/update_com.woltlab.wcf_6.3_userGroupAssignment.php</instruction>
<instruction type="script">acp/update_com.woltlab.wcf_6.3_notice.php</instruction>
<instruction type="script">acp/update_com.woltlab.wcf_6.3_trophy.php</instruction>
-->
</package>
6 changes: 3 additions & 3 deletions com.woltlab.wcf/templates/shared_colorFormField.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
</span>
{else}
<a href="#" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
<span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
</a>
<button type="button" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
<span class="colorPickerButton__color"{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
</button>
<input type="hidden" {*
*}id="{$field->getPrefixedId()}" {*
*}name="{$field->getPrefixedId()}" {*
Expand Down
4 changes: 4 additions & 0 deletions com.woltlab.wcf/templates/shared_conditionFormContainer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<button type="button" class="button" id="{$container->getPrefixedId()}AddCondition">
{lang}wcf.condition.add{/lang}
</button>

{if $container->isRequired() && $container->isEmpty()}
<small class="innerError">{lang}wcf.global.form.error.empty{/lang}</small>
{/if}
</section>

{include file='shared_formContainerDependencies'}
Expand Down
2 changes: 1 addition & 1 deletion com.woltlab.wcf/templates/shared_trophyImage.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<img
src="{$__wcf->getPath()}images/trophy/{$trophy->iconFile}"
src="{$trophy->getFile()->getFullSizeImageSource()}"
width="{$size}"
height="{$size}"
{if $showTooltip}title="{$trophy->getTitle()}"{/if}
Expand Down
31 changes: 31 additions & 0 deletions ts/WoltLabSuite/Core/Component/Icon/Badge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Handles the display of an icon badge with customizable colors.
*
* @author Olaf Braun
* @copyright 2001-2025 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 6.3
*/

export function setup(iconFieldId: string, colorFieldId: string, backgroundColorFieldId: string) {
const container = document.getElementById(`${iconFieldId}_icon`)!;
container.classList.add("iconBadge");

if (colorFieldId !== "") {
const colorInput = document.getElementById(colorFieldId) as HTMLInputElement;
colorInput.addEventListener("color-picker:submit", () => {
container.style.setProperty("color", colorInput.value);
});

container.style.setProperty("color", colorInput.value);
}

if (backgroundColorFieldId !== "") {
const backgroundColorInput = document.getElementById(backgroundColorFieldId) as HTMLInputElement;
backgroundColorInput.addEventListener("color-picker:submit", () => {
container.style.setProperty("background-color", backgroundColorInput.value);
});

container.style.setProperty("background-color", backgroundColorInput.value);
}
}
18 changes: 9 additions & 9 deletions ts/WoltLabSuite/Core/Ui/Color/Picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ class UiColorPicker implements DialogCallbackObject {
<div class="colorPickerComparison">
<small>${Language.get("wcf.style.colorPicker.new")}</small>
<div class="colorPickerColorNew">
<span style="background-color: ${this.input.value}"></span>
<span style="background-color: ${this.input.value}; flex: 1 auto"></span>
</div>
<div class="colorPickerColorOld">
<span style="background-color: ${this.input.value}"></span>
<span style="background-color: ${this.input.value}; flex: 1 auto"></span>
</div>
<small>${Language.get("wcf.style.colorPicker.current")}</small>
</div>
Expand Down Expand Up @@ -356,13 +356,13 @@ class UiColorPicker implements DialogCallbackObject {
this.oldColor!.style.backgroundColor = colorString;
this.input.value = colorString;

if (!(this.element instanceof HTMLButtonElement)) {
const span = this.element.querySelector("span");
if (span) {
span.style.backgroundColor = colorString;
} else {
this.element.style.backgroundColor = colorString;
}
const event = new CustomEvent<void>("color-picker:submit");
this.input.dispatchEvent(event);

const span = this.element.querySelector("span")
if (span !== null) {
span.classList.add("colorPickerButton__color");
span.style.setProperty("background-color", colorString);
}

UiDialog.close(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
*/

use wcf\system\database\table\column\DefaultFalseBooleanDatabaseTableColumn;
use wcf\system\database\table\column\IntDatabaseTableColumn;
use wcf\system\database\table\column\MediumtextDatabaseTableColumn;
use wcf\system\database\table\index\DatabaseTableForeignKey;
use wcf\system\database\table\PartialDatabaseTable;

return [
Expand All @@ -23,4 +25,17 @@
MediumtextDatabaseTableColumn::create('conditions'),
DefaultFalseBooleanDatabaseTableColumn::create('isLegacy'),
]),
PartialDatabaseTable::create('wcf1_trophy')
->columns([
MediumtextDatabaseTableColumn::create('conditions'),
DefaultFalseBooleanDatabaseTableColumn::create('isLegacy'),
IntDatabaseTableColumn::create('imageFileID'),
])
->foreignKeys([
DatabaseTableForeignKey::create()
->columns(['imageFileID'])
->referencedTable('wcf1_file')
->referencedColumns(['fileID'])
->onDelete('SET NULL'),
]),
];
Loading