Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_export_tables()

Description

Get array of tables to export when exporting system config and data

Parameters

ColumnTypeDefaultDescription
$exportcollection int 0 - Optional collection id to include resources and data from

Return

array

Location

include/migration_functions.php lines 546 to 622

Definition

 
function get_export_tables($exportcollection=0)
    {
    global 
$plugins;
    if((string)(int)
$exportcollection !== (string)$exportcollection)
        {
        
$exportcollection=0;
        }
        
    
// Create array of tables to export
    
$exporttables = array();
    
$exporttables["sysvars"] = array();
    
$exporttables["preview_size"] = array();
    
$exporttables["workflow_actions"] = array();
    
    if(
in_array("rse_workflow",$plugins))
        {
        
$exporttables["archive_states"] = array();
        }

    
$exporttables["user"] = array();
    
$exporttables["user"]["scramble"]=array("username"=>"mix_text","email"=>"mix_email","fullname"=>"mix_text","comments"=>"mix_text","created"=>"mix_date");
    
$exporttables["user_preferences"] = array();

    
$exporttables["usergroup"] = array();
    
$exporttables["usergroup"]["scramble"]=array("name"=>"mix_text","welcome_message"=>"mix_text","search_filter"=>"mix_text","edit_filter"=>"mix_text");


    
$exporttables["dash_tile"] = array();
    
$exporttables["dash_tile"]["scramble"]=array("title"=>"mix_text","txt"=>"mix_text","url"=>"mix_url");
    
$exporttables["user_dash_tile"] = array();
    
$exporttables["usergroup_dash_tile"] = array();

    
$exporttables["resource_type"] = array();
    
$exporttables["resource_type_field"] = array();
    
$exporttables["resource_type_field"]["scramble"]=array("title"=>"mix_text","name"=>"mix_text");

    
$exporttables["node"] = array();
    
$exporttables["node"]["scramble"]=array("name"=>"mix_text");

    
$exporttables["filter"] = array();
    
$exporttables["filter"]["scramble"]=array("name"=>"mix_text");
    
$exporttables["filter_rule"] = array();
    
$exporttables["filter_rule_node"] = array();

    
// Optional tables
    
if($exportcollection != 0)
        {
        
// Collections 
        
$exporttables["collection"] = array();
        
$exporttables["collection"]["exportcondition"] = "WHERE ref = '$exportcollection'";    
        
$exporttables["collection"]["scramble"]=array("name"=>"mix_text","description"=>"mix_text","keywords"=>"mix_text","created"=>"mix_date");

        
$exporttables["user_collection"] = array();
        
$exporttables["usergroup_collection"] = array();
        
$exporttables["collection_resource"] = array(); 
        
//  Resources and resource metadata
        
$exporttables["resource"] = array();
        
$exporttables["resource"]["scramble"]=array("field8"=>"mix_text","creation_date"=>"mix_date");
        
$exporttables["resource"]["exportcondition"] = " WHERE ref IN (SELECT resource FROM collection_resource WHERE collection='$exportcollection')";

        
$exporttables["resource_node"] = array();
        
$exporttables["resource_custom_access"] = array();
        
$exporttables["resource_dimensions"] = array();
        
$exporttables["resource_related"] = array();
        
$exporttables["resource_alt_files"] = array();
        
$exporttables["resource_alt_files"]["scramble"]=array("name"=>"mix_text","description"=>"mix_text","file_name"=>"mix_filename");
        
$exporttables["annotation"] = array();
        
$exporttables["annotation_node"] = array();
        }

    
$extra_tables hook("export_add_tables");
    if(
is_array($extra_tables))
        {
        
$exporttables array_merge($exporttables,$extra_tables);
        }
    return 
$exporttables;
    }

This article was last updated 9th June 2023 11:35 Europe/London time based on the source file dated 23rd January 2023 09:10 Europe/London time.