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
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
00060 import('controllers.api.file.linkAction.DownloadLibraryFileLinkAction');
00061 $cellActions[] = new DownloadLibraryFileLinkAction($request, $element);
00062 }
00063
00064 return $cellActions;
00065 }
00066 }
00067
00068
00069 ?>