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

controllers/grid/files/LibraryFileGridCellProvider.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.GridCellProvider');
00016 
00017 class LibraryFileGridCellProvider extends GridCellProvider {
00021    function LibraryFileGridCellProvider() {
00022       parent::GridCellProvider();
00023    }
00024 
00032    function getTemplateVarsFromRowColumn(&$row, $column) {
00033       $element =& $row->getData();
00034       $columnId = $column->getId();
00035       assert(is_a($element, 'DataObject') && !empty($columnId));
00036       switch ($columnId) {
00037          case 'files':
00038             // handled by our link action.
00039             return array('label' => '');
00040       }
00041    }
00042 
00049    function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT) {
00050 
00051       $columnId = $column->getId();
00052       $element =& $row->getData();
00053 
00054       $cellActions = array();
00055 
00056       switch ($columnId) {
00057          case 'files':
00058             assert(is_a($element, 'LibraryFile'));
00059             // Create the cell action to download a file.
00060             import('controllers.api.file.linkAction.DownloadLibraryFileLinkAction');
00061             $cellActions[] = new DownloadLibraryFileLinkAction($request, $element);
00062       }
00063 
00064       return $cellActions;
00065    }
00066 }
00067 
00068 
00069 ?>

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