Fix palette choices, template drawer, and canvas layer labels

This commit is contained in:
2026-11-28 11:59:15 +08:00
parent 5c37952bca
commit f9af7af86c
16 changed files with 141 additions and 81 deletions
+6 -1
View File
@@ -116,7 +116,12 @@ final class DesignLibrary
}
$id = filter_var($value, FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
if ($id === false || !self::find($id, $kind)) {
throw new RuntimeException('所选页头、页脚或配色方案不存在。');
$label = match ($kind) {
'header' => '页头',
'footer' => '页脚',
default => '配色方案',
};
throw new RuntimeException('所选' . $label . '已不可用。请保留修改,重新打开页面后再选择。');
}
return $id;