Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AddFileLinkAction.inc.php
1 <?php
2 
16 import('lib.pkp.controllers.api.file.linkAction.BaseAddFileLinkAction');
17 
19 
42  function AddFileLinkAction($request, $submissionId, $stageId, $uploaderRoles,
43  $uploaderGroupIds, $fileStage, $assocType = null, $assocId = null, $reviewRoundId = null, $dependentFilesOnly = false) {
44 
45  // Create the action arguments array.
46  $actionArgs = array('fileStage' => $fileStage, 'reviewRoundId' => $reviewRoundId);
47  if (is_numeric($assocType) && is_numeric($assocId)) {
48  $actionArgs['assocType'] = (int)$assocType;
49  $actionArgs['assocId'] = (int)$assocId;
50  }
51 
52  if ($dependentFilesOnly) $actionArgs['dependentFilesOnly'] = true;
53 
54  // Identify text labels based on the file stage.
55  $textLabels = AddFileLinkAction::_getTextLabels($fileStage);
56 
57  // Call the parent class constructor.
58  parent::BaseAddFileLinkAction(
59  $request, $submissionId, $stageId, $uploaderRoles, $uploaderGroupIds, $actionArgs,
60  __($textLabels['wizardTitle']), __($textLabels['buttonLabel'])
61  );
62  }
63 
64 
65  //
66  // Private methods
67  //
76  function _getTextLabels($fileStage) {
77  static $textLabels = array(
78  SUBMISSION_FILE_SUBMISSION => array(
79  'wizardTitle' => 'submission.submit.uploadSubmissionFile',
80  'buttonLabel' => 'submission.addFile'
81  ),
82  SUBMISSION_FILE_REVIEW_FILE => array(
83  'wizardTitle' => 'editor.submissionReview.uploadFile',
84  'buttonLabel' => 'editor.submissionReview.uploadFile'
85  ),
86  SUBMISSION_FILE_REVIEW_ATTACHMENT => array(
87  'wizardTitle' => 'editor.submissionReview.uploadAttachment',
88  'buttonLabel' => 'editor.submissionReview.uploadAttachment'
89  ),
90  SUBMISSION_FILE_REVIEW_REVISION => array(
91  'wizardTitle' => 'editor.submissionReview.uploadFile',
92  'buttonLabel' => 'submission.addFile'
93  ),
94  SUBMISSION_FILE_FINAL => array(
95  'wizardTitle' => 'submission.upload.finalDraft',
96  'buttonLabel' => 'submission.addFile'
97  ),
98  SUBMISSION_FILE_COPYEDIT => array(
99  'wizardTitle' => 'submission.upload.copyeditedVersion',
100  'buttonLabel' => 'submission.addFile'
101  ),
102  SUBMISSION_FILE_FAIR_COPY => array(
103  'wizardTitle' => 'submission.upload.fairCopy',
104  'buttonLabel' => 'submission.addFile'
105  ),
106  SUBMISSION_FILE_PRODUCTION_READY => array(
107  'wizardTitle' => 'submission.upload.productionReady',
108  'buttonLabel' => 'submission.addFile'
109  ),
110  SUBMISSION_FILE_PROOF => array(
111  'wizardTitle' => 'submission.upload.proof',
112  'buttonLabel' => 'submission.addFile'
113  ),
114  SUBMISSION_FILE_DEPENDENT => array(
115  'wizardTitle' => 'submission.upload.dependent',
116  'buttonLabel' => 'submission.addFile'
117  ),
118  );
119 
120  assert(isset($textLabels[$fileStage]));
121  return $textLabels[$fileStage];
122  }
123 }
124 
125 ?>
AddFileLinkAction($request, $submissionId, $stageId, $uploaderRoles, $uploaderGroupIds, $fileStage, $assocType=null, $assocId=null, $reviewRoundId=null, $dependentFilesOnly=false)
An action to add a submission file.
Abstract base class for file upload actions.