@DI\Observe("open_tool_desktop_dashboard")

@param DisplayToolEvent $event
761546
public function onDesktopOpen(DisplayToolEvent $event)
    {
        $content = $this->templating->render(
            'ClarolineDashboardBundle:tool:dashboards.html.twig',
            []
        );
        $event->setContent($content);
    }
761521
protected function dispatchEvent($event)
    {
        if (!$this->container) {
            throw new \RuntimeException("The container has not been set up.");
        }
        $dir = $this->container->getParameter('base_dir');
        if (!is_dir($dir) || !is_readable($dir)) {
            throw new \RuntimeException("'${dir}' is not a valid readable directory.");
        }
        $dispatcher = $this->container->get('event_dispatcher');
        $dispatcher->dispatch($event);
    }
1143478
protected function doesEventStartOutsideWindow(array $event)
    {
        return !$this->isValidDate($event['DTSTART']) || $this->isOutOfRange($event['DTSTART'], $this->windowMinTimestamp, $this->windowMaxTimestamp);
    }
821076
public static function run($event)
    {
        static::$io = $event->getIO();
        static::$composer = $event->getComposer();

        // Set the root theme folder dir.
        static::set_root();

        // Display snap logo!
        static::write_intro();

        $strategy = static::$io->select(
            "\n<comment>Please choose a templating system for your theme:</comment>",
            static::$strategies,
            0
        );

        switch ($strategy) {
            case '0':
                static::$io->write("<info>Setup finished.\nEnjoy SnapWP!</info>");
                exit;
                break;

            case '1':
                static::install_blade();
                break;
        }
    }
513779
public function onDisplayTool(OpenAdministrationToolEvent $event)
    {
        $content = $this->templating->render(
            'ClarolineCoreBundle:administration:users.html.twig', [
                // todo : put it in the async load of form
                'parameters' => $this->parametersSerializer->serialize(),
                'profile' => $this->profileSerializer->serialize(),
                'platformRoles' => $this->finder->search('Claroline\CoreBundle\Entity\Role', [
                    'filters' => ['type' => Role::PLATFORM_ROLE],
                ]),
            ]
        );

        $event->setResponse(new Response($content));
        $event->stopPropagation();
    }
525505
public function onProductShow(ResourceControllerEvent $event): void
    {
        $product = $event->getSubject();
        if (!$product instanceof ProductInterface) {
            return;
        }

        $currentRequest = $this->requestStack->getCurrentRequest();
        if ($currentRequest instanceof Request) {
            $currentRequest->attributes->set('nglayouts_sylius_product', $product);
            // We set context here instead in a ContextProvider, since sylius.product.show
            // event happens too late, after onKernelRequest event has already been executed
            $this->context->set('sylius_product_id', (int) $product->getId());
        }
    }
447112
public function onDisplayWorkspace(DisplayToolEvent $event)
    {
        $workspace = $event->getWorkspace();

        $content = $this->templating->render(
            'ClarolineCoreBundle:workspace:logs.html.twig', [
                'workspace' => $workspace,
                'actions' => $this->eventManager->getEventsForApiFilter(LogGenericEvent::DISPLAYED_WORKSPACE),
            ]
        );

        $event->setContent($content);
        $event->stopPropagation();
    }
1137627
public function onCommand(ConsoleCommandEvent $event)
    {
        $output = $event->getOutput();
        if ($output instanceof ConsoleOutputInterface) {
            $output = $output->getErrorOutput();
        }

        $this->setOutput($output);
    }
1070333
public function onConfigure(ConfigureWidgetEvent $event)
    {
        $instance = $event->getInstance();
        $config = $this->logManager->getLogConfig($instance);

        if ($config === null) {
            $config = new LogWidgetConfig();
            $config->setWidgetInstance($instance);
        }

        if ($instance->isDesktop()) {
            $workspaces = array();
            $workspacesVisibility = array();
            if (!$instance->isAdmin()) {
                $workspaces = $this->workspaceManager->getWorkspacesByUserAndRoleNames(
                    $instance->getUser(),
                    array('ROLE_WS_COLLABORATOR', 'ROLE_WS_MANAGER')
                );
                $workspacesVisibility = $this
                    ->logManager
                    ->getWorkspaceVisibilityForDesktopWidget($instance->getUser(), $workspaces);
            }

            $workspacesVisibility['amount'] = $config->getAmount();

            $form = $this
                ->formFactory
                ->create(
                    new LogDesktopWidgetConfigType(),
                    $workspacesVisibility,
                    array('workspaces' => $workspaces)
                );
            $content = $this->twig->render(
                'ClarolineCoreBundle:Log:config_desktop_widget_form.html.twig',
                array(
                    'form' => $form->createView(),
                    'instance' => $instance
                )
            );
        } else {
            $form    = $this->formFactory->create($this->logWorkspaceWidgetConfigForm, $config);
            $content = $this->twig->render(
                'ClarolineCoreBundle:Log:config_workspace_widget_form.html.twig',
                array(
                    'form'      => $form->createView(),
                    'instance' => $instance
                )
            );
        }

        $event->setContent($content);
    }
283614
public function onDisplayWorkspaceResourceManager(DisplayToolEvent $event)
    {
        $event->setContent($this->resourceWorkspace($event->getWorkspace()->getId()));
    }
936713
public function onSettingDisplay(AnEvent $event)
    {
        $tabs = $event->tabs;
        $viewer = get_viewer();

        if ($viewer->admin() || $viewer->eql($this->getItem())) {
            $tabs->insert('account', array('label' => AnTranslator::_('COM-PEOPLE-SETTING-TAB-ACCOUNT')));
        }
    }
1258915
public function onDisplayWorkspace(DisplayToolEvent $event)
    {
        $workspace = $event->getWorkspace();

        $content = $this->templating->render(
            'ClarolineCoreBundle:tool:trash.html.twig', [
                'workspace' => $workspace,
                'context' => [
                    'type' => Tool::WORKSPACE,
                    'data' => $this->serializer->serialize($workspace),
                ],
            ]
        );

        $event->setContent($content);
        $event->stopPropagation();
    }
34898
public function onDisplayTool(OpenAdministrationToolEvent $event)
    {
        $workspaceTools = $this->toolManager->getAvailableWorkspaceTools();

        $content = $this->templating->render(
            'ClarolineCoreBundle:administration:workspaces.html.twig',
            [
                'parameters' => $this->parametersSerializer->serialize(),
                'tools' => array_map(function (Tool $tool) {
                    return ['name' => $tool->getName()];
                }, $workspaceTools),
                'models' => $this->finder->search(
                    Workspace::class,
                    ['filters' => ['model' => true]],
                    [Options::SERIALIZE_MINIMAL]
                ),
            ]
        );

        $event->setResponse(new Response($content));
        $event->stopPropagation();
    }
883374
public function onToolOpen(DisplayToolEvent $event)
    {
        // Get media center user from database
        $loggedUser = $this->container->get('security.token_storage')->getToken()->getUser();
        try {
            $mediacenter = $this->getMediacenterManager()->getMediacenter();
            $mediacenterUserManager = $this->getMediacenterUserManager();
            $token = $mediacenterUserManager->getMediacenterUserToken($loggedUser, $mediacenter);
            $mediacener_portal = $mediacenter->getUrl().'?userName='.$loggedUser->getUsername().'&token='.$token;
            $content = new RedirectResponse($mediacener_portal);
        } catch (NoMediacenterException $nme) {
            $content = $this->templating->render('IcapInwicastBundle:MediaCenter:error.html.twig');
        }

        // Return view to event (Claroline specification)
        $event->setContent($content);
        $event->stopPropagation();
    }
887133
public function onDisplayWorkspace(DisplayToolEvent $event)
    {
        $workspace = $event->getWorkspace();

        $content = $this->templating->render(
            'ClarolineCoreBundle:tool:resources.html.twig', [
                'workspace' => $workspace,
                'context' => [
                    'type' => Widget::CONTEXT_WORKSPACE,
                    'data' => $this->serializer->serialize($workspace),
                ],
                'root' => $this->serializer->serialize(
                    $this->resourceRepository->findWorkspaceRoot($workspace)
                ),
            ]
        );

        $event->setContent($content);
        $event->stopPropagation();
    }
619287
public function onDisplayWorkspace(DisplayToolEvent $event)
    {
        $workspace = $event->getWorkspace();

        $content = $this->templating->render(
            'ClarolineCoreBundle:workspace:users.html.twig', [
                'workspace' => $workspace,
                'restrictions' => [
                    'hasUserManagementAccess' => $this->authorization->isGranted('OPEN', $this->om
                        ->getRepository('ClarolineCoreBundle:Tool\AdminTool')
                        ->findOneBy(['name' => 'user_management'])
                    ),
                ],
            ]
        );

        $event->setContent($content);
        $event->stopPropagation();
    }
817929
public function onContextPaneInit(ContextPaneEvent $event)
    {
        $contextPane = $event->getContextPane();

        $subscriber = $this->notificationService->getSubscriber($this->currentUser->id());
        $limit = 10;

        $cursor = $subscriber
            ->fetch()
            ->addSort(Field::MSG_SENT, CursorInterface::SORT_DESC)
            ->addSort(Field::MSG_ID, CursorInterface::SORT_DESC)
            ->setRange($limit, 0)
        ;

        $unreadCount = $subscriber->fetch([Field::MSG_UNREAD => 1])->count();

        $contextPane
            ->addTab('notification', $this->t("Notifications"), 'bell', 0, $unreadCount)
            ->add(
                notification_block_render_messages($cursor, true), // @todo hardcoded funtion call, twig template would have been better
                'notification'
            )
        ;

        // Set default tab on dashboard
        if (current_path() == 'admin/dashboard') {
            $contextPane->setDefaultTab('notification');
        }
    }