Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource 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 584 to 664

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","theme"=>"mix_text","theme2"=>"mix_text","theme3"=>"mix_text","theme4"=>"mix_text","theme5"=>"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_data"] = array();
        
$exporttables["resource_data"]["scramble"]=array("value");
        
$exporttables["resource_data"]["exportcondition"] = " WHERE resource IN (SELECT resource FROM collection_resource WHERE collection='$exportcollection')";
        
$exporttables["resource_data"]["scramble"]=array("value"=>"mix_text");

        
$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 30th November 2020 16:35 Europe/London time based on the source file dated 26th November 2020 16:30 Europe/London time.