You are here

function node_gallery_update_6203 in Node Gallery 6.2

Same name and namespace in other branches
  1. 6.3 node_gallery.install \node_gallery_update_6203()

File

./node_gallery.install, line 387
Node gallery install file.

Code

function node_gallery_update_6203() {
  $ret = array();
  drupal_set_message(t('Node Gallery Access has been removed from core, and migrated to it\'s own module - you may download the new version from !url.', array(
    'url' => l('http://drupal.org/project/node_gallery_access', 'http://drupal.org/project/node_gallery_access'),
  )));
  $contribdir = drupal_get_path('module', 'node_gallery') . '/contrib/node_gallery_access';

  //Does the contrib node_gallery_access exist?
  if (is_dir($contribdir)) {

    //Is it enabled?
    if (module_exists('node_gallery_access')) {
      module_disable(array(
        'node_gallery_access',
      ));
      drupal_set_message(t('Node Gallery Access (contrib version) has been disabled, but your data is still there.  Simply download the new version after removing the old one, and everything will upgrade automatically.'));
    }

    //We could go to the trouble to try a recursive delete, but most modules/* files aren't writable by Apache anyways.
    $ret['#abort'] = array(
      'success' => FALSE,
      'query' => 'Old contrib version of Node Gallery Access was found at ' . $contribdir . '.  Please remove that directory and all of it\'s subfolders then rerun ' . l('update.php', 'update.php'),
    );
  }
  return $ret;
}