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

controllers/grid/files/fileList/FileSelectionGridColumn.inc.php

00001 <?php
00014 import('lib.pkp.classes.controllers.grid.GridColumn');
00015 
00016 class FileSelectionGridColumn extends GridColumn {
00017 
00019    var $_selectName;
00020 
00021 
00027    function FileSelectionGridColumn($selectName) {
00028       assert(is_string($selectName) && !empty($selectName));
00029       $this->_selectName = $selectName;
00030 
00031       import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider');
00032       $cellProvider = new ColumnBasedGridCellProvider();
00033       parent::GridColumn('select', 'common.select', null, 'controllers/grid/gridRowSelectInput.tpl', $cellProvider,
00034             array('width' => 1));
00035    }
00036 
00037 
00038    //
00039    // Getters and Setters
00040    //
00045    function getSelectName() {
00046       return $this->_selectName;
00047    }
00048 
00049 
00050    //
00051    // Public methods
00052    //
00059    function getTemplateVarsFromRow($row) {
00060       // Retrieve the file data.
00061       $submissionFileData =& $row->getData();
00062 
00063       // Retrieve the monograph file.
00064       assert(isset($submissionFileData['submissionFile']));
00065       $monographFile =& $submissionFileData['submissionFile']; /* @var $monographFile MonographFile */
00066       assert(is_a($monographFile, 'MonographFile'));
00067 
00068       // Return the data expected by the column's cell template.
00069       assert(isset($submissionFileData['selected']));
00070       return array(
00071          'elementId' => $monographFile->getFileIdAndRevision(),
00072          'selectName' => $this->getSelectName(),
00073          'selected' => $submissionFileData['selected']);
00074    }
00075 }
00076 
00077 ?>

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