15 new ActionFilter\Authentication(),
17 new ActionFilter\Csrf(),
18 new ActionFilter\CloseSession(),
22 public function minimizeAction(
JsonPayload $payload)
24 $toolbar = $this->getToolbar($payload);
25 if ($toolbar ===
null)
30 $itemOptions = $this->getItemOptions($payload);
31 $result = $toolbar->createOrUpdateItem($itemOptions);
34 if (!$result->isSuccess())
41 $toolbarItem = $result->getData()[
'item'];
43 'title' => $toolbarItem->getTitle(),
44 'entityType' => $toolbarItem->getEntityType(),
45 'entityId' => $toolbarItem->getEntityId(),
46 'url' => $toolbarItem->getUrl(),
57 $this->minimizeAction($payload);
62 [$entityType, $entityId] = $this->getItemId($payload);
63 $toolbar = $this->getToolbar($payload);
64 $toolbar?->removeItem($entityType, $entityId);
69 $toolbar = $this->getToolbar($payload);
70 $toolbar?->removeAll();
75 $toolbar = $this->getToolbar($payload);
76 $toolbar?->collapse();
81 $toolbar = $this->getToolbar($payload);
91 isset(
$request[
'toolbar'][
'context']) && is_string(
$request[
'toolbar'][
'context'])
92 ? trim(
$request[
'toolbar'][
'context'])
96 if ($context ===
null || strlen($context) < 1)
101 return SidePanel\Toolbar::getOrCreate($context);
104 private function getItemOptions(
JsonPayload $payload): array
112 private function getItemId(JsonPayload $payload): array
114 $options = $this->getItemOptions($payload);
116 isset($options[
'entityType']) && is_string($options[
'entityType'])
117 ? trim($options[
'entityType'])
122 isset($options[
'entityId']) && is_string($options[
'entityId'])
123 ? trim($options[
'entityId'])
127 return [$entityType, $entityId];