Пример #1
0
 /**
  * @DI\InjectParams({
  *     "apiManager"      = @DI\Inject("claroline.manager.api_manager"),
  *     "eventDispatcher" = @DI\Inject("event_dispatcher"),
  *     "homeTabManager"  = @DI\Inject("claroline.manager.home_tab_manager"),
  *     "pluginManager"   = @DI\Inject("claroline.manager.plugin_manager"),
  *     "request"         = @DI\Inject("request"),
  *     "serializer"      = @DI\Inject("jms_serializer"),
  *     "widgetManager"   = @DI\Inject("claroline.manager.widget_manager")
  * })
  */
 public function __construct(ApiManager $apiManager, EventDispatcherInterface $eventDispatcher, HomeTabManager $homeTabManager, PluginManager $pluginManager, Request $request, Serializer $serializer, WidgetManager $widgetManager)
 {
     $this->apiManager = $apiManager;
     $this->bundles = $pluginManager->getEnabled(true);
     $this->eventDispatcher = $eventDispatcher;
     $this->homeTabManager = $homeTabManager;
     $this->pluginManager = $pluginManager;
     $this->request = $request;
     $this->serializer = $serializer;
     $this->widgetManager = $widgetManager;
 }
 /**
  * @DI\InjectParams({
  *     "apiManager"      = @DI\Inject("claroline.manager.api_manager"),
  *     "authorization"   = @DI\Inject("security.authorization_checker"),
  *     "eventDispatcher" = @DI\Inject("event_dispatcher"),
  *     "homeTabManager"  = @DI\Inject("claroline.manager.home_tab_manager"),
  *     "pluginManager"   = @DI\Inject("claroline.manager.plugin_manager"),
  *     "request"         = @DI\Inject("request"),
  *     "serializer"      = @DI\Inject("jms_serializer"),
  *     "tokenStorage"    = @DI\Inject("security.token_storage"),
  *     "utils"           = @DI\Inject("claroline.security.utilities"),
  *     "widgetManager"   = @DI\Inject("claroline.manager.widget_manager")
  * })
  */
 public function __construct(ApiManager $apiManager, AuthorizationCheckerInterface $authorization, EventDispatcherInterface $eventDispatcher, HomeTabManager $homeTabManager, PluginManager $pluginManager, Request $request, Serializer $serializer, TokenStorageInterface $tokenStorage, Utilities $utils, WidgetManager $widgetManager)
 {
     $this->apiManager = $apiManager;
     $this->authorization = $authorization;
     $this->bundles = $pluginManager->getEnabled(true);
     $this->eventDispatcher = $eventDispatcher;
     $this->homeTabManager = $homeTabManager;
     $this->pluginManager = $pluginManager;
     $this->request = $request;
     $this->serializer = $serializer;
     $this->tokenStorage = $tokenStorage;
     $this->utils = $utils;
     $this->widgetManager = $widgetManager;
 }
Пример #3
0
 public function searchResourcesByType($query, $page = 1, $resourceType = null)
 {
     if ($resourceType === null || $resourceType == 'all') {
         $resourceTypes = $this->getPortalEnabledResourceTypes();
     } else {
         $resourceTypes = array($resourceType);
     }
     $isTagEnabled = $this->pluginManager->isLoaded('ClarolineTagBundle');
     $totalItems = $this->portalRepo->countSearchResultsByResourceTypes($query, $resourceTypes, $isTagEnabled);
     $pageResults = $this->portalRepo->searchResourcesByResourceTypes($query, $resourceTypes, $isTagEnabled, $page, $this->maxResultsPerPage);
     $pagerfantaRepresentation = new PaginatedCollectionRepresentation();
     $paginatedCollection = $pagerfantaRepresentation->createRepresentationFromValues($pageResults, $totalItems, $this->maxResultsPerPage, $page);
     return $paginatedCollection;
 }