christopherbolt/silverstripe-publishwithme 问题修复 & 功能扩展

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

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

christopherbolt/silverstripe-publishwithme

Composer 安装命令:

composer require christopherbolt/silverstripe-publishwithme

包简介

Publishes/Unpublishes versioned DataObjects that are attached to a Page or parent DataObject when the parent object is published.

README 文档

README

Publishes/Un-publishes versioned DataObjects that are attached to a Page when the page is published.

Lets imagine that you have a staff profiles page where each staff member is a DataObject in a has_many relation. Without any versioning edits to a staff member would be published immediately breaking workflow approval processes and breaking the draft, publish and history functionality of Silverstripe. Or if they did have the Versioned extension they would need to be published independantly from the page which complicates workflow. This module allows those edits to be published when the page is published. Also supports un-publishing, revert to live and history rollback with the page. This allows objects to behave as if they are part of the page.

Upgrading from SilverStripe 3

Most of the functionality of this plugin is now built into SilverStripe 4 and can be enabled by using the $owns config that is baked into SS4. To upgrade please replace the $publish_with_me config with $owns. In SS4 all this plugin does is enhance the Saved / Published button to show that the page needs publishing if any $owns objects have unpublished changes.

Requirements

SS 4.x, see 1.0 branch for SS 3.x

Usage

Add the PublishWithMe extension to your page (or parent DataObject):

private static $extensions = array(
    "PublishWithMe"
);

Still on your page (or parent DataObject) define which relations should be managed by this extension, this is a list of array keys from your has_one and/or has_many relations, this just now uses the $owns config that is built into SS4:

private static $owns = array(
    'Staff',
);

The DataObjects to be published with the page must have the Versioned extension, in the example above you would add this to your StaffMember object:

private static $extensions = array(
    Versioned::class,
);

If your dataobjects themselves contain relations that should be published with the page then also add the PublishWithMe extension and the $owns config and ensure that the child data objects have the Versioned extension etc.

Installation

composer require christopherbolt/silverstripe-publishwithme ^2

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固