kukrik/qcubed-filefinder

QCubed v4 plugin for FileFinder

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:qcubed-library

dev-master 2024-09-13 10:46 UTC

This package is auto-updated.

Last update: 2024-09-13 10:46:51 UTC


README

FileFinder for QCubed v4

Simple Examples: Options for Implementing Pop-Up Windows

At times, you may require a quick and effortless method to search for and retrieve data from another PHP page through a pop-up window, among other functionalities.

This straightforward Filefinder plugin serves this purpose aptly and can be utilized repeatedly. To achieve this, you'll need to add one or more buttons that can trigger a pop-up according to your requirements. Each pop-up can be tailored to accommodate various datasets or other content.

Here's a simple example: Begin by specifying the data-popup button: 'some name tag'; at this stage, configuration is necessary:

    $button = new Bs\Button($this);
    $button-> etc...
    $button->setDataAttribute('popup', 'some name tag');

    $object = new Q\Plugin\FileFinder($this);
    $object->PopupUrl = "finder.php"; // Any php page
    $object->TargetPopupName = 'some name tag';

The default width and height of the popup window are set to 95%. It is possible to adjust the dimensions of the popup to be smaller. For this, you can use the following syntax:

    $object->PopupWidth = '...%';
    $object->PopupHeight = '...%';

Replace '...%' with the desired percentage value for width and height respectively.

Image of kukrik

In this example, we are using finder.php, which is based on FileHandler: https://github.com/kukrik/qcubed-filemanager.

Finder is placed in a popup window, where you can make some configurations as desired.

If you want to limit file selection by file type, you can change the default values of LockedDocuments and LockedImages to true on lines 168-169 in finder.php.

Additionally, you need to go to line 2659 to view and configure it. Please follow the instructions and recommendations provided there.

    // Here, the "files" table needs to be updated to indicate that the selected image(s) are now locked.
    // If this is not done, the file manager will not provide accurate information about whether
    // the files are free or not. This is to prevent accidentally deleting files that are in use by others.
    $objFiles = Files::loadById($arrSome["data-id"]);
    $objFiles->setLockedFile($objFiles->getLockedFile() + 1);
    //$objFiles->save();


    // First, you need to create your own table with your chosen name and define the necessary columns.
    // However, here you must definitely add a column named "file_id", where you will pull the "id" value
    // from the "files" table.
    //
    //This is necessary so that when you need to delete from your table, you can release the lock in
    // the "files" table based on the "file_id". This ensures that FileHandler reflects the correct
    // information to other users.

    // $objSome = new Some();
    // $objSome->setFileId($arrSome["data-id"]);
    // $objSome->.... etc;
    // $objSome->.... etc;

If you have not previously installed QCubed Bootstrap and twitter bootstrap, run the following actions on the command line of your main installation directory by Composer:

    composer require twbs/bootstrap v3.3.7

and

    composer require kukrik/qcubed-filefinder
    composer require kukrik/bootstrap