定制 coldtrick/csv_exporter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

coldtrick/csv_exporter

最新稳定版本:v14.0

Composer 安装命令:

composer require coldtrick/csv_exporter

包简介

Export all searchable entities to a CSV

README 文档

README

Elgg 6.3 Lint Checks Latest Stable Version License

This plugin allows you to export all searchable entities to a CSV.

How to

As an administrator go to the Admin section. Under Administer -> Utilities you can find the CSV Exporter menu item.

If a few easy steps you can select the CSV content.

  1. Select what you wish to export (Users, Groups, Blogs etc.)
  2. Once you've selected what you wish to export you get a choice of which columns to include
  3. Now you can click on Preview to check if this is what you wish to export
    or you can click Download CSV to export all the content to a CSV file

Developers

By default all searchable entities are exportable, if however you wish to change this list use the event

elgg_register_event_handler("allowed_type_subtypes", "csv_exporter", "your function");

and change the result array.

You can add your own values to the available list by registering a event like

elgg_register_event_handler("get_exportable_values", "csv_exporter", "your function");

This event gets the following params:

  • type: the type of the entity to supply the values for
  • subtype: the subtype of the entity to supply the values for
  • readable: true|false, if true the result must be an associative array in the format array(label => value), this is used to display the checkboxes to the user.
    If false just return the value as part of an array (eg array(value)).

In order to export the correct values you have to also register an event

elgg_register_event_handler("export_value", "csv_exporter", "your function");

This event gets the following params:

  • type: the type of the entity to supply the values for
  • subtype: the subtype of the entity to supply the values for
  • entity: the entity for which to export the value
  • exportable_value: the value to export

If you return anything other than null this value will be used, otherwise the system will try to get the exportable_value as a metadata field.

In order to allow group admins to export basic information add the configuration with the following event:

elgg_register_event_handler("get_exportable_values:group", "csv_exporter", "your function");

This event gets the following params:

  • type: the type of the entity to supply the values for
  • subtype: the subtype of the entity to supply the values for

Return an array with [value] where:

  • value: the same name as in the get_exportable_values, csv_exporter event

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2015-05-28