PKPFileUploadWizardHandler::initialize PHP Method

initialize() public method

public initialize ( $request, $args )
    function initialize($request, $args)
    {
        parent::initialize($request, $args);
        // Configure the wizard with the authorized submission and file stage.
        // Validated in authorize.
        $this->_fileStage = (int) $request->getUserVar('fileStage');
        // Set the uploader roles (if given).
        $uploaderRoles = $request->getUserVar('uploaderRoles');
        if (!empty($uploaderRoles)) {
            $this->_uploaderRoles = array();
            $uploaderRoles = explode('-', $uploaderRoles);
            foreach ($uploaderRoles as $uploaderRole) {
                if (!is_numeric($uploaderRole)) {
                    fatalError('Invalid uploader role!');
                }
                $this->_uploaderRoles[] = (int) $uploaderRole;
            }
        }
        // Set the uploader group IDs (if given).
        $uploaderGroupIds = $request->getUserVar('uploaderGroupIds');
        if (!empty($uploaderGroupIds)) {
            $this->_uploaderGroupIds = array();
            $uploaderGroupIds = explode('-', $uploaderGroupIds);
            foreach ($uploaderGroupIds as $uploaderGroupId) {
                if (!is_numeric($uploaderGroupId)) {
                    fatalError('Invalid uploader group ID!');
                }
                $this->_uploaderGroupIds[] = (int) $uploaderGroupId;
            }
        }
        // Do we allow revisions only?
        $this->_revisionOnly = (bool) $request->getUserVar('revisionOnly');
        $reviewRound = $this->getReviewRound();
        $this->_assocType = $request->getUserVar('assocType') ? (int) $request->getUserVar('assocType') : null;
        $this->_assocId = $request->getUserVar('assocId') ? (int) $request->getUserVar('assocId') : null;
        // The revised file will be non-null if we revise a single existing file.
        if ($this->getRevisionOnly() && $request->getUserVar('revisedFileId')) {
            // Validated in authorize.
            $this->_revisedFileId = (int) $request->getUserVar('revisedFileId');
        }
        // Load translations.
        AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APP_COMMON);
    }