You are here

function fe_paths_prepare_config in File Entity Paths 7.2

Prepare configuration entity to save.

Parameters

$config:

1 call to fe_paths_prepare_config()
fe_paths_entity_edit_form_submit in ./fe_paths.admin.inc
Form submit function for File Entity Paths configuration add/edit form.

File

./fe_paths.module, line 575
Contains functions for the File Entity Paths module.

Code

function fe_paths_prepare_config(&$config) {
  $info = entity_get_info('fe_paths_config');

  // Remove all unnecessary values from the config.
  foreach ($config as $key => $value) {
    if (!in_array($key, $info['schema_fields_sql']['base table'])) {
      unset($config[$key]);
    }
  }

  // Make an object
  $config = (object) $config;

  // Set status, if necessary.
  if (!isset($config->status)) {
    $config->status = 1;
  }
}