• Services
  • What we do & Sell own
  • Cases
  • We are


1. Funtionality

1.1. Function

The module helps admin and users to export the content of site objects in specific formats. The supported formats are defined by drivers and managed by administrator.

Driver is a collection of settings:

– Elements (name and type) that must be present in the export;

– The possibility of admin to arbitrarily add fields to export;

– File type (extension);

– Additional settings;

– Template of text data (if required).

A selection of exported data can be limited by a number of criteria which are defined by the logics of the exported object. The module of the exported object must provide the following callback methods:

– A method that provides a list of fields for export (name and type);

– Methods that provide a search for objects (for admin and users);

– A method that processes data received from a search for objects;

– A method that returns the objects matching the search criteria with required fields.

Depending on settings in admin panel, export is carried out by cronjob or upon request.

1.2. Admin mode

There are two lists: export formats and selections.

An export format includes name, status, link to details, options to edit settings and fields. Settings are available if a driver supports an option to define additional settings. Fields can be edited if a driver supports an option to add fields to export. You can add or remove fields (name and type). There are the following field types: text, integer, file and URL.

A selection includes export name, driver name, object name, status, date of creation and actions (create, edit, delete or export a selection). There are three tabs on pages of creating or editing a selection: general settings, custom fields and selection criteria.

Creation of a new selection starts from general settings:

– Name

– Driver

– Module

– Type of export (browser or file).

If you choose file type of export:

  • File format (you can specify time of export);
  • Type of export (upon request, on a certain date or by cronjob).

If you choose browser type of export:

  • Enable export (you will see a link to the export page that will be available to site users);
  • Allow users to change the criteria (you will see a link to the form where users can change criteria).

The other two tabs are available after general settings are saved.

‘Custom fields’ tab contains a list of established connections between driver elements and fields. Elements without established connections have two selects: available elements and fields available for the chosen element.

‘Selection criteria’ tab contains a form provided by the object module. Saved criteria are used for selection generation.

If the selection is enabled, the script checks the settings, and displays an error message if there are any issues.

1.3. User mode

Choose ‘Browser’ type of export and enable the selection to provide an export option for site users. Depending on whether you check ‘Allow users to change the criteria’ or not, a user will get a link to a form with option to change criteria or an export file in the necessary format.

1.4. Related modules

The module uses the functionality of the following related modules:

  • menu — menu in admin panel;
  • ausers — moderator permissions;
  • cronjob — scheduled tasks;
  • seo — seo url generation.

1.5. Functionality related to other modules

The module provides a link used to export data.

1.6. Specific funtionality

No specific functionality.


2. Implementation

2.1. API

The module API class (Api_export) implements one method:

public function generate($selection_id);

Gets an exported selection. The method runs the process of data generation according to the specified selection. The result is a file with data in a certain format or an archive with photos and other files.


$selection_id integer — selection id