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

controllers/grid/files/SubmissionFilesGridRow.inc.php

00001 <?php
00002 
00015 // Import grid base classes.
00016 import('lib.pkp.classes.controllers.grid.GridRow');
00017 
00018 class SubmissionFilesGridRow extends GridRow {
00019 
00021    var $_canDelete;
00022 
00024    var $_canViewNotes;
00025 
00027    var $_stageId;
00028 
00035    function SubmissionFilesGridRow($canDelete, $canViewNotes, $stageId = null) {
00036       $this->_canDelete = $canDelete;
00037       $this->_canViewNotes = $canViewNotes;
00038       $this->_stageId = $stageId;
00039       parent::GridRow();
00040    }
00041 
00042 
00043    //
00044    // Getters and Setters
00045    //
00050    function canDelete() {
00051       return $this->_canDelete;
00052    }
00053 
00058    function canViewNotes() {
00059       return $this->_canViewNotes;
00060    }
00061 
00066    function getStageId() {
00067       return $this->_stageId;
00068    }
00069 
00070    //
00071    // Overridden template methods from GridRow
00072    //
00076    function initialize(&$request, $template = 'controllers/grid/gridRow.tpl') {
00077       parent::initialize($request, $template);
00078 
00079       // Retrieve the monograph file.
00080       $submissionFileData =& $this->getData();
00081       assert(isset($submissionFileData['submissionFile']));
00082       $monographFile =& $submissionFileData['submissionFile']; /* @var $monographFile MonographFile */
00083       assert(is_a($monographFile, 'MonographFile'));
00084 
00085       // File grid row actions:
00086       // 1) Delete file action.
00087       if ($this->canDelete()) {
00088          import('controllers.api.file.linkAction.DeleteFileLinkAction');
00089          $this->addAction(new DeleteFileLinkAction($request, $monographFile, $this->getStageId()));
00090       }
00091 
00092       // 2) Information center action.
00093       if ($this->canViewNotes()) {
00094          import('controllers.informationCenter.linkAction.FileInfoCenterLinkAction');
00095          $this->addAction(new FileInfoCenterLinkAction($request, $monographFile, $this->getStageId()));
00096       }
00097    }
00098 }
00099 
00100 ?>

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