You are here

function fasttoggle_defaults_from_config_data in Fasttoggle 7

Get default values from configuration data.

Parameters

array $config_data: The configuration data to be checked.

Return value

array The default values, keyed by group and instance concatenated with an underscore.

2 calls to fasttoggle_defaults_from_config_data()
fasttoggle_get_allowed_links in ./fasttoggle.module
Get the list of links the current user may utilise.
fasttoggle_get_settings_form_items in ./fasttoggle.admin.inc
Get settings form items.

File

./fasttoggle.module, line 734
Enables fast toggling of binary or not so binary settings.

Code

function fasttoggle_defaults_from_config_data(array $config_data) {
  $result = array();
  foreach ($config_data['fields'] as $group_name => $group_data) {
    foreach ($group_data['instances'] as $instance_name => $instance_data) {
      if (isset($instance_data['default']) && $instance_data['default'] !== FALSE) {
        $result["{$group_name}_{$instance_name}"] = $instance_data['default'];
      }
    }
  }
  return $result;
}