Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
SubmissionFilesGridRow.inc.php
1 <?php
2 
16 // Import grid base classes.
17 import('lib.pkp.classes.controllers.grid.GridRow');
18 
20 
22  var $_canDelete;
23 
25  var $_canViewNotes;
26 
28  var $_stageId;
29 
36  function SubmissionFilesGridRow($canDelete, $canViewNotes, $stageId = null) {
37  $this->_canDelete = $canDelete;
38  $this->_canViewNotes = $canViewNotes;
39  $this->_stageId = $stageId;
40  parent::GridRow();
41  }
42 
43 
44  //
45  // Getters and Setters
46  //
51  function canDelete() {
52  return $this->_canDelete;
53  }
54 
59  function canViewNotes() {
60  return $this->_canViewNotes;
61  }
62 
67  function getStageId() {
68  return $this->_stageId;
69  }
70 
71  //
72  // Overridden template methods from GridRow
73  //
77  function initialize($request, $template = 'controllers/grid/gridRow.tpl') {
78  parent::initialize($request, $template);
79 
80  // Retrieve the submission file.
81  $submissionFileData =& $this->getData();
82  assert(isset($submissionFileData['submissionFile']));
83  $submissionFile =& $submissionFileData['submissionFile']; /* @var $submissionFile SubmissionFile */
84  assert(is_a($submissionFile, 'SubmissionFile'));
85 
86  // File grid row actions:
87  // 1) Delete file action.
88  if ($this->canDelete()) {
89  import('lib.pkp.controllers.api.file.linkAction.DeleteFileLinkAction');
90  $this->addAction(new DeleteFileLinkAction($request, $submissionFile, $this->getStageId()));
91  }
92 
93  // 2) Information center action.
94  if ($this->canViewNotes()) {
95  import('lib.pkp.controllers.informationCenter.linkAction.FileInfoCenterLinkAction');
96  $this->addAction(new FileInfoCenterLinkAction($request, $submissionFile, $this->getStageId()));
97  }
98  }
99 }
100 
101 ?>
A base action to open up the information center for a file.
An action to delete a file.
& getData()
Class defining basic operations for handling HTML gridRows.
Definition: GridRow.inc.php:25
SubmissionFilesGridRow($canDelete, $canViewNotes, $stageId=null)
initialize($request, $template= 'controllers/grid/gridRow.tpl')
addAction($action, $position=GRID_ACTION_POSITION_DEFAULT)
Handle submission file grid row requests.