SelectableSubmissionFileListCategoryGridHandler::isDataElementInCategorySelected PHP Method

isDataElementInCategorySelected() public method

public isDataElementInCategorySelected ( $categoryDataId, &$gridDataElement )
    function isDataElementInCategorySelected($categoryDataId, &$gridDataElement)
    {
        $currentStageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
        $submissionFile = $gridDataElement['submissionFile'];
        // Check for special cases when the file needs to be unselected.
        $dataProvider = $this->getDataProvider();
        if ($dataProvider->getFileStage() != $submissionFile->getFileStage()) {
            return false;
        } elseif ($currentStageId == WORKFLOW_STAGE_ID_INTERNAL_REVIEW || $currentStageId == WORKFLOW_STAGE_ID_EXTERNAL_REVIEW) {
            if ($currentStageId != $categoryDataId) {
                return false;
            }
        }
        // Passed the checks above. If viewable then select it.
        return $submissionFile->getViewable();
    }