first commit
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @defgroup controllers_grid_files_fileList_linkAction File List Link Actions
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file controllers/grid/files/fileList/linkAction/DownloadAllLinkAction.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 DownloadAllLinkAction
|
||||
*
|
||||
* @ingroup controllers_grid_files_fileList_linkAction
|
||||
*
|
||||
* @brief An action to download all files in a submission file grid.
|
||||
*/
|
||||
|
||||
namespace PKP\controllers\grid\files\fileList\linkAction;
|
||||
|
||||
use APP\core\Request;
|
||||
use PKP\linkAction\LinkAction;
|
||||
use PKP\linkAction\request\PostAndRedirectAction;
|
||||
|
||||
class DownloadAllLinkAction extends LinkAction
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Request $request
|
||||
* @param array $actionArgs
|
||||
*/
|
||||
public function __construct($request, $actionArgs)
|
||||
{
|
||||
// Instantiate the redirect action request.
|
||||
$router = $request->getRouter();
|
||||
$redirectRequest = new PostAndRedirectAction(
|
||||
$router->url($request, null, 'api.file.FileApiHandler', 'recordDownload', null, $actionArgs),
|
||||
$router->url($request, null, 'api.file.FileApiHandler', 'downloadAllFiles', null, $actionArgs)
|
||||
);
|
||||
|
||||
// Configure the link action.
|
||||
parent::__construct('downloadAll', $redirectRequest, __('submission.files.downloadAll'), 'getPackage');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* @file controllers/grid/files/fileList/linkAction/SelectFilesLinkAction.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 SelectFilesLinkAction
|
||||
*
|
||||
* @ingroup controllers_grid_files_fileList_linkAction
|
||||
*
|
||||
* @brief An abstract base action for actions to open up a modal that allows users to
|
||||
* select files from a file list grid.
|
||||
*/
|
||||
|
||||
namespace PKP\controllers\grid\files\fileList\linkAction;
|
||||
|
||||
use APP\core\Request;
|
||||
use PKP\linkAction\LinkAction;
|
||||
use PKP\linkAction\request\AjaxModal;
|
||||
|
||||
class SelectFilesLinkAction extends LinkAction
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Request $request
|
||||
* @param array $actionArgs The parameters required by the
|
||||
* link action target to identify a list of files.
|
||||
* @param string $actionLabel The localized label of the link action.
|
||||
* @param string $modalTitle the (optional) title to be used for the modal.
|
||||
*/
|
||||
public function __construct($request, $actionArgs, $actionLabel, $modalTitle = null)
|
||||
{
|
||||
// Create an ajax action request that'll contain
|
||||
// the file selection grid.
|
||||
$modalTitle ??= $actionLabel;
|
||||
$router = $request->getRouter();
|
||||
$ajaxModal = new AjaxModal(
|
||||
$router->url($request, null, null, 'selectFiles', null, $actionArgs),
|
||||
$modalTitle,
|
||||
'modal_add_file'
|
||||
);
|
||||
|
||||
// Configure the link action.
|
||||
parent::__construct('selectFiles', $ajaxModal, $actionLabel, 'add');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @file controllers/grid/files/fileList/linkAction/SelectReviewFilesLinkAction.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 SelectReviewFilesLinkAction
|
||||
*
|
||||
* @ingroup controllers_grid_files_fileList_linkAction
|
||||
*
|
||||
* @brief An action to open up the modal that allows users to select review files
|
||||
* from a file list grid.
|
||||
*/
|
||||
|
||||
namespace PKP\controllers\grid\files\fileList\linkAction;
|
||||
|
||||
use APP\core\Request;
|
||||
use PKP\submission\reviewRound\ReviewRound;
|
||||
|
||||
class SelectReviewFilesLinkAction extends SelectFilesLinkAction
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Request $request
|
||||
* @param ReviewRound $reviewRound The review round from which to
|
||||
* select review files.
|
||||
* @param string $actionLabel The localized label of the link action.
|
||||
* @param string $modalTitle the (optional) title to be used for the modal.
|
||||
*/
|
||||
public function __construct($request, $reviewRound, $actionLabel, $modalTitle = null)
|
||||
{
|
||||
$actionArgs = ['submissionId' => $reviewRound->getSubmissionId(),
|
||||
'stageId' => $reviewRound->getStageId(), 'reviewRoundId' => $reviewRound->getId()];
|
||||
|
||||
parent::__construct($request, $actionArgs, $actionLabel, $modalTitle);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user