_canEdit = $canEdit; parent::__construct(); } // // Getters and Setters // /** * @copydoc GridDataProvider::getAuthorizationPolicy() */ public function getAuthorizationPolicy($request, $args, $roleAssignments) { $this->_context = $request->getContext(); return new ContextAccessPolicy($request, $roleAssignments); } /** * @copydoc GridDataProvider::getRequestArgs() */ public function getRequestArgs() { return ['canEdit' => $this->canEdit()]; } /** * get the current context * * @return $context Context */ public function &getContext() { return $this->_context; } /** * get whether or not this grid is editable (has actions). * * @return bool $canEdit */ public function canEdit() { return $this->_canEdit; } /** * @copydoc CategoryGridHandler::loadCategoryData() * * @param null|mixed $filter */ public function loadCategoryData($request, $fileType, $filter = null) { // Elements to be displayed in the grid $libraryFileDao = DAORegistry::getDAO('LibraryFileDAO'); /** @var LibraryFileDAO $libraryFileDao */ $context = $this->getContext(); $libraryFiles = $libraryFileDao->getByContextId($context->getId(), $fileType); return $libraryFiles->toAssociativeArray(); } }