| Server IP : 195.134.90.114 / Your IP : 216.73.216.86 Web Server : Apache/2.4.58 System : Linux nepub 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/public_html/lib/pkp/controllers/grid/files/ |
Upload File : |
<?php
/**
* @file controllers/grid/files/SubmissionFilesGridRow.inc.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class SubmissionFilesGridRow
* @ingroup controllers_grid_files
*
* @brief Handle submission file grid row requests.
*/
// Import grid base classes.
import('lib.pkp.classes.controllers.grid.GridRow');
class SubmissionFilesGridRow extends GridRow {
/** @var FilesGridCapabilities */
var $_capabilities;
/** @var int */
var $_stageId;
/**
* Constructor
* @param $capabilities FilesGridCapabilities
* @param $stageId int Stage ID (optional)
*/
function __construct($capabilities = null, $stageId = null) {
$this->_capabilities = $capabilities;
$this->_stageId = $stageId;
parent::__construct();
}
//
// Getters and Setters
//
/**
* Can the user delete files from this grid?
* @return boolean
*/
function canDelete() {
return $this->_capabilities->canDelete();
}
/**
* Can the user view file notes on this grid?
* @return boolean
*/
function canViewNotes() {
return $this->_capabilities->canViewNotes();
}
/**
* Can the user manage files in this grid?
* @return boolean
*/
function canEdit() {
return $this->_capabilities->canEdit();
}
/**
* Get the stage id, if any.
* @return int Stage ID
*/
function getStageId() {
return $this->_stageId;
}
//
// Overridden template methods from GridRow
//
/**
* @copydoc GridRow::initialize()
*/
function initialize($request, $template = 'controllers/grid/gridRow.tpl') {
parent::initialize($request, $template);
// Retrieve the submission file.
$submissionFileData =& $this->getData();
assert(isset($submissionFileData['submissionFile']));
$submissionFile =& $submissionFileData['submissionFile']; /* @var $submissionFile SubmissionFile */
assert(is_a($submissionFile, 'SubmissionFile'));
// File grid row actions:
// 1) Information center action.
if ($this->canViewNotes()) {
import('lib.pkp.controllers.informationCenter.linkAction.FileInfoCenterLinkAction');
$this->addAction(new FileInfoCenterLinkAction($request, $submissionFile, $this->getStageId()));
}
// 2) Edit metadata action.
if ($this->canEdit()) {
import('lib.pkp.controllers.api.file.linkAction.EditFileLinkAction');
$this->addAction(new EditFileLinkAction($request, $submissionFile, $this->getStageId()));
}
// 3) Delete file action.
if ($this->canDelete()) {
import('lib.pkp.controllers.api.file.linkAction.DeleteFileLinkAction');
$this->addAction(new DeleteFileLinkAction($request, $submissionFile, $this->getStageId()));
}
}
}