Uname:Linux server2.hostofiraq.site 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64

Base Dir : /home/iscmbt-kufa-atu/public_html

User : iscmbt-kufa-atu


403WebShell
403Webshell
Server IP : 89.117.53.150  /  Your IP : 216.73.216.11
Web Server : Apache
System : Linux server2.hostofiraq.site 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
User : iscmbt-kufa-atu ( 1014)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/iscmbt-kufa-atu/quarantine/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/iscmbt-kufa-atu/quarantine/DependentFilesGridDataProvider.php
<?php

/**
 * @file controllers/grid/files/dependent/DependentFilesGridDataProvider.php
 *
 * Copyright (c) 2014-2021 Simon Fraser University
 * Copyright (c) 2000-2021 John Willinsky
 * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
 *
 * @class DependentFilesGridDataProvider
 *
 * @ingroup controllers_grid_files_dependent
 *
 * @brief Provide access to dependent file data for grids.
 */

namespace PKP\controllers\grid\files\dependent;

use APP\core\Application;
use APP\facades\Repo;
use PKP\controllers\api\file\linkAction\AddFileLinkAction;
use PKP\controllers\grid\files\SubmissionFilesGridDataProvider;
use PKP\submissionFile\SubmissionFile;

class DependentFilesGridDataProvider extends SubmissionFilesGridDataProvider
{
    /**
     * The submission file id for the parent file.
     *
     * @var int
     */
    public $_assocId;

    /**
     * Constructor
     *
     * @param int $assocId Association ID
     */
    public function __construct($assocId)
    {
        assert(is_numeric($assocId));
        $this->_assocId = (int) $assocId;
        parent::__construct(SubmissionFile::SUBMISSION_FILE_DEPENDENT);
    }

    /**
     * @copydoc GridDataProvider::loadData()
     */
    public function loadData($filter = [])
    {
        // Retrieve all dependent files for the given file stage and original submission file id (i.e. the main galley/production file)
        $submissionFiles = Repo::submissionFile()
            ->getCollector()
            ->filterByAssoc(
                Application::ASSOC_TYPE_SUBMISSION_FILE,
                [$this->getAssocId()]
            )->filterBySubmissionIds([$this->getSubmission()->getId()])
            ->filterByFileStages([$this->getFileStage()])
            ->includeDependentFiles()
            ->getMany()
            ->toArray();
        return $this->prepareSubmissionFileData($submissionFiles, $this->_viewableOnly, $filter);
    }

    /**
     * Overridden from SubmissionFilesGridDataProvider - we need to also include the assocType and assocId
     *
     * @copydoc FilesGridDataProvider::getAddFileAction()
     */
    public function getAddFileAction($request)
    {
        $submission = $this->getSubmission();
        return new AddFileLinkAction(
            $request,
            $submission->getId(),
            $this->getStageId(),
            $this->getUploaderRoles(),
            $this->getFileStage(),
            Application::ASSOC_TYPE_SUBMISSION_FILE,
            $this->getAssocId(),
            null,
            null,
            $this->isDependent()
        );
    }

    /**
     * returns the id of the parent submission file for these dependent files.
     *
     * @return int
     */
    public function getAssocId()
    {
        return $this->_assocId;
    }

    /**
     * Convenience function to make the argument to the AddFileLinkAction more obvious.
     *
     * @return true
     */
    public function isDependent()
    {
        return true;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit