-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dedicated style variables for the toggle button
- Loading branch information
Showing
4 changed files
with
49 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
wcfsetup/install/files/acp/update_com.woltlab.wcf_6.2_styleVariables.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use wcf\system\WCF; | ||
|
||
$styleVariables = [ | ||
['wcfToggleButtonBackground', 'rgba(105, 109, 114, 1)', 'rgba(89, 89, 89, 1)'], | ||
['wcfToggleButtonBackgroundActive', 'rgba(60, 118, 61, 1)', 'rgba(0, 113, 84, 1)'], | ||
['wcfToggleButtonSliderBackground', 'rgba(250, 250, 250, 1)', 'rgba(203, 203, 203, 1)'], | ||
['wcfToggleButtonSliderBackgroundActive', 'rgba(250, 250, 250, 1)', 'rgba(203, 203, 203, 1)'], | ||
]; | ||
|
||
$sql = "INSERT INTO wcf1_style_variable | ||
(variableName, defaultValue, defaultValueDarkMode) | ||
VALUES (?, ?, ?) | ||
ON DUPLICATE KEY UPDATE defaultValue = VALUES(defaultValue), | ||
defaultValueDarkMode = VALUES(defaultValueDarkMode)"; | ||
$statement = WCF::getDB()->prepare($sql); | ||
|
||
foreach ($styleVariables as $data) { | ||
[$variableName, $defaultValue, $defaultValueDarkMode] = $data; | ||
|
||
$statement->execute([ | ||
$variableName, | ||
$defaultValue, | ||
$defaultValueDarkMode, | ||
]); | ||
} |
Oops, something went wrong.