You are here

function node_accessibility_update_7100 in Node Accessibility 7

Switch to variable_set()/variable_get() node type settings.

If enabled, cf_settings will now be utilized.

see: https://drupal.org/node/2101573

File

./node_accessibility.install, line 125
Install file for node accessibility.

Code

function node_accessibility_update_7100() {
  $query = db_select('node_accessibility_types', 'nat');
  $query
    ->fields('nat');
  $query
    ->orderBy('nat.type', 'ASC');
  $node_type_settings = array();
  $results = (array) $query
    ->execute()
    ->fetchAll();
  foreach ($results as $result) {
    $node_type_settings[$result->type] = array();
    $node_type_settings[$result->type]['required'] = $result->required;
    $node_type_settings[$result->type]['standards'] = unserialize($result->standards);
    $node_type_settings[$result->type]['method'] = $result->method;
    $node_type_settings[$result->type]['format'] = $result->format;
  }
  if (function_exists('cf_settings_register')) {
    cf_settings_register('node_accessibility_node_type_settings', 'drupal_variables', 'node_accessibility', array());
    cf_settings_register('node_accessibility_alter_revision_menu', 'drupal_variables', 'node_accessibility', TRUE);
  }
  variable_set('node_accessibility_node_type_settings', $node_type_settings);
  db_drop_table('node_accessibility_types');
}