coldtrick/csv_exporter

export all searchable entities to a CSV

Installs: 1 470

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 2

Open Issues: 3

Type:elgg-plugin

v5.1 2020-01-06 14:45 UTC

This package is auto-updated.

Last update: 2020-04-06 15:20:07 UTC


README

Elgg 3.0 Build Status Scrutinizer Code Quality 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

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

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

This hook get 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 a plugin hook

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

This hook get 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 plugin hook:

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

This hook get 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 hook