feat: Enhance topic management and synchronization features
This commit is contained in:
@@ -109,13 +109,21 @@ class SiteController extends Controller
|
||||
|
||||
$topics = Topic::findBySiteWithGlobal((int) $id);
|
||||
$globalTopics = GlobalTopic::findAllGrouped();
|
||||
$assignedGlobalIds = array_filter(array_column($topics, 'global_topic_id'));
|
||||
$assignedGlobalIds = array_values(array_unique(array_map(
|
||||
static fn($v) => (int) $v,
|
||||
array_filter(array_column($topics, 'global_topic_id'))
|
||||
)));
|
||||
$assignedTopicNames = array_values(array_unique(array_filter(array_map(
|
||||
static fn($name) => mb_strtolower(trim((string) $name)),
|
||||
array_column($topics, 'name')
|
||||
))));
|
||||
|
||||
$this->view('sites/edit', [
|
||||
'site' => $site,
|
||||
'topics' => $topics,
|
||||
'globalTopics' => $globalTopics,
|
||||
'assignedGlobalIds' => $assignedGlobalIds,
|
||||
'assignedTopicNames' => $assignedTopicNames,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user