studiobosco/wn-lockrecords-plugin 问题修复 & 功能扩展

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

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

studiobosco/wn-lockrecords-plugin

Composer 安装命令:

composer require studiobosco/wn-lockrecords-plugin

包简介

WinterCMS LockRecords Plugin

README 文档

README

Provides lockable records in the backend. Lockabe records can only be edited by a single backend user at the same time. Locked records can be unlocked manually or will be unlocked automatically after a certain amount of time if no editing form is opened.

Usage

This plugin provides the StudioBosco\LockRecords\Traits\Lockable Model Trait and the StudioBosco\LockRecords\Behaviors\LockRecordsController controller behavior.

To make a model lockable

  1. Just add the trait or the behavior:
class MyModel {
    use \StudioBosco\LockRecords\Traits\Lockable;

    // or

    public $implement = [
        \StudioBosco\LockRecords\Behaviors\LockableModel::class,
    ];

    ...
}
  1. Add the behavior to the backend controller. It should contain the form and list behaviors.
class MyController extends Backend\Classes\Controller {

    /**
     * @var array Behaviors that are implemented by this controller.
     */
    public $implement = [
        \Backend.Behaviors.FormController::class,
        \Backend.Behaviors.ListController::class,
        \StudioBosco\LockRecords\Behaviors\LockRecordsController::class,
    ];

    ...
}
  1. Customize the duration after which records get unlocked automatically by visiting backend/system/settings/update/studiobosco/lockrecords/settings. It is 10 minutes by default.

  2. Set permissions to manually unlock records if desired.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-06