kukrik/qcubed-filefinder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kukrik/qcubed-filefinder

Composer 安装命令:

composer require kukrik/qcubed-filefinder

包简介

QCubed-4 plugin for FileFinder

README 文档

README

FileFinder for QCubed-4

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.

These plugins work starting from PHP version 8.3+.

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 qcubed-4/plugin-bootstrap

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-11