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

controllers/api/file/linkAction/AddFileLinkAction.inc.php

00001 <?php
00018 import('controllers.api.file.linkAction.BaseAddFileLinkAction');
00019 
00020 class AddFileLinkAction extends BaseAddFileLinkAction {
00021 
00040    function AddFileLinkAction(&$request, $monographId, $stageId, $uploaderRoles,
00041          $fileStage, $assocType = null, $assocId = null, $reviewRoundId = null) {
00042 
00043       // Create the action arguments array.
00044       $actionArgs = array('fileStage' => $fileStage, 'reviewRoundId' => $reviewRoundId);
00045       if (is_numeric($assocType) && is_numeric($assocId)) {
00046          $actionArgs['assocType'] = (int)$assocType;
00047          $actionArgs['assocId'] = (int)$assocId;
00048       }
00049 
00050       // Identify text labels based on the file stage.
00051       $textLabels = AddFileLinkAction::_getTextLabels($fileStage);
00052 
00053       // Call the parent class constructor.
00054       parent::BaseAddFileLinkAction(
00055          $request, $monographId, $stageId, $uploaderRoles, $actionArgs,
00056          __($textLabels['wizardTitle']), __($textLabels['buttonLabel'])
00057       );
00058    }
00059 
00060 
00061    //
00062    // Private methods
00063    //
00072    function _getTextLabels($fileStage) {
00073       static $textLabels = array(
00074          MONOGRAPH_FILE_SUBMISSION => array(
00075             'wizardTitle' => 'submission.submit.uploadSubmissionFile',
00076             'buttonLabel' => 'submission.addFile'
00077          ),
00078          MONOGRAPH_FILE_REVIEW_FILE => array(
00079             'wizardTitle' => 'editor.submissionReview.uploadFile',
00080             'buttonLabel' => 'editor.submissionReview.uploadFile'
00081          ),
00082          MONOGRAPH_FILE_REVIEW_ATTACHMENT => array(
00083             'wizardTitle' => 'editor.submissionReview.uploadAttachment',
00084             'buttonLabel' => 'editor.submissionReview.uploadAttachment'
00085          ),
00086          MONOGRAPH_FILE_REVIEW_REVISION => array(
00087             'wizardTitle' => 'editor.submissionReview.uploadFile',
00088             'buttonLabel' => 'submission.addFile'
00089          ),
00090          MONOGRAPH_FILE_FINAL => array(
00091             'wizardTitle' => 'submission.upload.finalDraft',
00092             'buttonLabel' => 'submission.addFile'
00093          ),
00094          MONOGRAPH_FILE_COPYEDIT => array(
00095             'wizardTitle' => 'submission.upload.copyeditedVersion',
00096             'buttonLabel' => 'submission.addFile'
00097          ),
00098          MONOGRAPH_FILE_FAIR_COPY => array(
00099             'wizardTitle' => 'submission.upload.fairCopy',
00100             'buttonLabel' => 'submission.addFile'
00101          ),
00102          MONOGRAPH_FILE_PRODUCTION_READY => array(
00103             'wizardTitle' => 'submission.upload.productionReady',
00104             'buttonLabel' => 'submission.addFile'
00105          ),
00106          MONOGRAPH_FILE_PROOF => array(
00107             'wizardTitle' => 'submission.upload.proof',
00108             'buttonLabel' => 'submission.addFile'
00109          ),
00110       );
00111 
00112       assert(isset($textLabels[$fileStage]));
00113       return $textLabels[$fileStage];
00114    }
00115 }
00116 
00117 ?>

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