You are here

function gallery_assist_update_6107 in Gallery Assist 6

Implementation of hook_update_N().

File

./gallery_assist.install, line 899
Install, update and uninstall functions and DB tables for the Gallery Assist module.

Code

function gallery_assist_update_6107() {
  $ret = array();

  // Add the GA public staus as field.
  $db = array(
    'ga_public_status' => array(
      'type' => 'int',
      'not null' => TRUE,
      'default' => 2,
      'description' => 'Gallery Assist gallery public status.',
    ),
  );
  db_change_field($ret, 'gallery_assist', 'comments', 'ga_public_status', $db['ga_public_status']);

  // @TODO: GA: Update the ga_public_status from all existing galleries.
  // Add new settings parameter.
  $types = array(
    'default' => 'Default',
  );
  $types += node_get_types('names');
  foreach (array_keys($types) as $type) {
    $settings = variable_get("gallery_assist_{$type}_data", array());
    $settings['ga_cover_sticky'] = 1;
    variable_set("gallery_assist_{$type}_data", $settings);
  }
  return $ret;
}