• Main Page
  • Modules
  • Classes
  • Files
  • File List

controllers/grid/settings/library/LibraryFileAdminGridDataProvider.inc.php

00001 <?php
00002 
00016 import('lib.pkp.classes.controllers.grid.CategoryGridDataProvider');
00017 
00018 class LibraryFileAdminGridDataProvider extends CategoryGridDataProvider {
00019 
00021    var $_context;
00022 
00024    var $_canEdit;
00025 
00029    function LibraryFileAdminGridDataProvider($canEdit) {
00030       $this->_canEdit = $canEdit;
00031       parent::CategoryGridDataProvider();
00032    }
00033 
00034 
00035    //
00036    // Getters and Setters
00037    //
00038 
00042    function getAuthorizationPolicy(&$request, $args, $roleAssignments) {
00043       $this->_context =& $request->getPress();
00044       import('classes.security.authorization.OmpPressAccessPolicy');
00045       $policy = new OmpPressAccessPolicy($request, $roleAssignments);
00046       return $policy;
00047    }
00048 
00052    function getRequestArgs() {
00053       return array('canEdit' => $this->getCanEdit());
00054    }
00055 
00060    function &getContext() {
00061       return $this->_context;
00062    }
00063 
00064 
00069    function getCanEdit() {
00070       return $this->_canEdit;
00071    }
00072 
00073 
00077    function getCategoryData(&$fileType, $filter = null) {
00078 
00079       // Elements to be displayed in the grid
00080       $libraryFileDao =& DAORegistry::getDAO('LibraryFileDAO');
00081       $context = $this->getContext();
00082       $libraryFiles =& $libraryFileDao->getByPressId($context->getId(), $fileType);
00083 
00084       return $libraryFiles->toAssociativeArray();
00085    }
00086 }
00087 
00088 ?>

Generated on Mon Sep 17 2012 13:58:56 for Open Monograph Press by  doxygen 1.7.1