/**
  * Widget configuration
  * @DI\Observe("widget_exo_stat_configuration")
  * @param ConfigureWidgetEvent $event
  */
 public function onConfigure(ConfigureWidgetEvent $event)
 {
     $widgetInstance = $event->getInstance();
     $params = array();
     $params['_controller'] = 'CPASimUSanteExoverrideBundle:ExoverrideWidget:userStatWidgetConfigureForm';
     $params['widgetInstance'] = $widgetInstance->getId();
     $this->redirect($params, $event);
 }
 /**
  * @DI\Observe("widget_innova_path_widget_configuration")
  *
  * @param ConfigureWidgetEvent $event
  */
 public function onConfigure(ConfigureWidgetEvent $event)
 {
     $instance = $event->getInstance();
     $config = $this->pathManager->getWidgetConfig($instance);
     $form = $this->formFactory->create('innova_path_widget_config', $config);
     $content = $this->twig->render('InnovaPathBundle:Widget:config.html.twig', ['form' => $form->createView(), 'instance' => $instance, 'tags' => $this->tagManager->getPlatformTags()]);
     $event->setContent($content);
     $event->stopPropagation();
 }
 /**
  * @DI\Observe("widget_claroline_rssreader_configuration")
  */
 public function onConfigure(ConfigureWidgetEvent $event)
 {
     $instance = $event->getInstance();
     $config = $this->rssManager->getConfig($instance);
     if ($config === null) {
         $config = new Config();
     }
     $form = $this->formFactory->create(new ConfigType(), $config);
     $content = $this->templating->render('ClarolineRssReaderBundle::formRss.html.twig', ['form' => $form->createView(), 'isAdmin' => $instance->isAdmin(), 'config' => $instance]);
     $event->setContent($content);
 }
 /**
  * @DI\Observe("widget_simple_text_configuration")
  */
 public function onConfig(ConfigureWidgetEvent $event)
 {
     $instance = $event->getInstance();
     $txtConfig = $this->simpleTextManager->getTextConfig($instance);
     if ($txtConfig === null) {
         $txtConfig = new SimpleTextConfig();
         $txtConfig->setWidgetInstance($instance);
     }
     $form = $this->formFactory->create(new SimpleTextType('widget_text_' . rand(0, 1000000000)), $txtConfig);
     $content = $this->templating->render('ClarolineCoreBundle:Widget:config_simple_text_form.html.twig', ['form' => $form->createView(), 'config' => $instance]);
     $event->setContent($content);
 }
 /**
  * @DI\Observe("widget_claroline_forum_widget_configuration")
  */
 public function onConfigure(ConfigureWidgetEvent $event)
 {
     $widgetInstance = $event->getInstance();
     $lastMessageWidgetConfig = $this->forumManager->getConfig($widgetInstance);
     if (is_null($lastMessageWidgetConfig)) {
         $lastMessageWidgetConfig = new LastMessageWidgetConfig();
         $lastMessageWidgetConfig->setWidgetInstance($widgetInstance);
     }
     $form = $this->formFactory->create(new LastMessageWidgetConfigType(), $lastMessageWidgetConfig);
     $content = $this->templatingEngine->render('ClarolineForumBundle:Widget:lastMessageWidgetConfig.html.twig', array('form' => $form->createView(), 'widgetInstance' => $widgetInstance));
     $event->setContent($content);
 }
 /**
  * @DI\Observe("widget_claroline_tag_resources_widget_configuration")
  *
  * @param ConfigureWidgetEvent $event
  * @throws \Claroline\CoreBundle\Listener\NoHttpRequestException
  */
 public function onResourcesTagsWidgetConfigure(ConfigureWidgetEvent $event)
 {
     if (!$this->request) {
         throw new NoHttpRequestException();
     }
     $widgetInstance = $event->getInstance();
     $params = array();
     $params['_controller'] = 'ClarolineTagBundle:Tag:resourcesTagsWidgetConfigureForm';
     $params['widgetInstance'] = $widgetInstance->getId();
     $subRequest = $this->request->duplicate(array(), null, $params);
     $response = $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
     $event->setContent($response->getContent());
 }
 /**
  * @DI\Observe("widget_claroline_announcement_widget_configuration")
  */
 public function onConfig(ConfigureWidgetEvent $event)
 {
     if (!$this->request) {
         throw new NoHttpRequestException();
     }
     $widgetInstance = $event->getInstance();
     $params = [];
     $params['_controller'] = 'ClarolineAnnouncementBundle:Announcement:announcementsWidgetConfigureForm';
     $params['widgetInstance'] = $widgetInstance->getId();
     $subRequest = $this->request->duplicate([], null, $params);
     $response = $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
     $event->setContent($response->getContent());
 }
 /**
  * @DI\Observe("widget_core_resource_logger_configuration")
  *
  * @param ConfigureWidgetEvent $event
  */
 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);
 }
 /**
  * @DI\Observe("widget_inwicast_claroline_plugin_configuration")
  */
 public function onConfigure(ConfigureWidgetEvent $event)
 {
     // Get widget instance
     $widgetInstance = $event->getInstance();
     // Get mediacenter user from database
     $loggedUser = $this->container->get("security.context")->getToken()->getUser();
     try {
         $mediacenter = $this->getMediacenterManager()->getMediacenter();
         $mediaManager = $this->getMediaManager();
         $medialist = $mediaManager->getMediaListForUser($loggedUser, $mediacenter);
         // Return form
         $content = $this->templating->render('InwicastClarolinePluginBundle:Media:videosList.html.twig', array('medialist' => $medialist, 'widget' => $widgetInstance, 'username' => $loggedUser->getUsername(), 'mediacenter' => $mediacenter));
     } catch (NoMediacenterException $nme) {
         $content = $this->templating->render('InwicastClarolinePluginBundle:Mediacenter:error.html.twig');
     }
     // Return view to event (Claroline specification)
     $event->setContent($content);
     $event->stopPropagation();
 }
 /**
  * @DI\Observe("widget_tag_list_configuration")
  */
 public function onWidgetTagListConfiguration(ConfigureWidgetEvent $event)
 {
     /** @var \icap\BlogBundle\Entity\WidgetTagListBlog $widgetTagListBlog */
     $widgetTagListBlog = $this->widgetManager->getWidgetTagListBlogByWdgetInstance($event->getInstance());
     if (null === $widgetTagListBlog) {
         $widgetTagListBlog = new WidgetTagListBlog();
         $widgetTagListBlog->setResourceNode($this->widgetManager->getResourceNodeOfWidgetTagListBlog($event->getInstance()));
     }
     $form = $this->formFactory->create($this->widgetTagListBlogType, $widgetTagListBlog);
     $content = $this->templatingEngine->render('IcapBlogBundle:widget:tagListBlogConfigure.html.twig', array('form' => $form->createView(), 'widgetInstance' => $event->getInstance()));
     $event->setContent($content);
 }
 /**
  * @DI\Observe("widget_badge_usage_configuration")
  *
  * @param ConfigureWidgetEvent $event
  */
 public function onConfig(ConfigureWidgetEvent $event)
 {
     $badgeWidgetConfig = $this->badgeWidgetManager->getBadgeUsageConfigForInstance($event->getInstance());
     $this->badgeUsageForm->setData($badgeWidgetConfig);
     $content = $this->templating->render('IcapBadgeBundle:Widget:badge_usage_config.html.twig', ['form' => $this->badgeUsageForm->createView(), 'instance' => $event->getInstance()]);
     $event->setContent($content);
 }