You are here

function imce_update_7000 in IMCE 7

Updates from 6.x to 7.x.

File

./imce.install, line 39
Installs, updates, and uninstalls IMCE.

Code

function imce_update_7000() {

  // Update role-profile assignments
  $roles_profiles = variable_get('imce_roles_profiles', array());
  if (!empty($roles_profiles)) {
    $scheme = variable_get('file_default_scheme', 'public');
    foreach ($roles_profiles as $rid => &$role) {
      $role[$scheme . '_pid'] = $role['pid'];
      unset($role['pid']);
    }
    variable_set('imce_roles_profiles', $roles_profiles);
  }

  // Update textarea ids
  $ids = str_replace(' ', '', variable_get('imce_settings_textarea', ''));
  if ($ids != '') {
    $ids = explode(',', $ids);
    foreach ($ids as &$id) {
      $id .= '*';
    }
    variable_set('imce_settings_textarea', implode(', ', $ids));
  }
}